diff --git a/doc/ChangeLog b/doc/ChangeLog index 41ff00b29..67d570991 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2010-04-26 Carsten Dominik + + * org.texi (Conflicts): Document new work-around for windmove.el. + (Plain lists): Describe counter start cookies. + (External links): Add example for a doi link. + 2010-04-23 Carsten Dominik * org.texi (Plain lists): Document the commands to promote/demote diff --git a/doc/org.texi b/doc/org.texi index 527ce719a..d36f495e1 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -1222,7 +1222,9 @@ visually indistinguishable from true headlines. In short: even though as bullets. @item @emph{Ordered} list items start with a numeral followed by either a period or -a right parenthesis, such as @samp{1.} or @samp{1)}. +a right parenthesis, such as @samp{1.} or @samp{1)}. If you want a list to +start a different value (e.g. 20), start the text of the item with +@code{[@@start:20]}. @item @emph{Description} list items are unordered list items, and contain the separator @samp{ :: } to separate the description @emph{term} from the @@ -2804,6 +2806,7 @@ the colon. The following list shows examples for each link type. @example http://www.astro.uva.nl/~dominik @r{on the web} +doi:10.1000/182 @r{DOI for an electronic resource} file:/home/dominik/images/jupiter.jpg @r{file, absolute path} /home/dominik/images/jupiter.jpg @r{same as above} file:papers/last.pdf @r{file, relative path} @@ -11371,7 +11374,18 @@ fixed this problem: @item @file{windmove.el} by Hovav Shacham @cindex @file{windmove.el} This package also uses the @kbd{S-} keys, so everything written -in the paragraph above about CUA mode also applies here. +in the paragraph above about CUA mode also applies here. If you want make +the windmove function active in locations where Org-mode does not have +special functionality on @kbd{S-@key{cursor}}, add this to your +configuration: + +@lisp +;; Make windmove work in org-mode: +(add-hook 'org-shiftup-final-hook 'windmove-up) +(add-hook 'org-shiftleft-final-hook 'windmove-left) +(add-hook 'org-shiftdown-final-hook 'windmove-down) +(add-hook 'org-shiftright-final-hook 'windmove-right) +@end lisp @item @file{viper.el} by Michael Kifer @cindex @file{viper.el} diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01f9646c7..3b97d17c8 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,38 @@ +2010-04-26 Carsten Dominik + + * org.el (org-link-types, org-open-at-point): Add doi links. + + * org-ascii.el (org-export-ascii-preprocess): Remove list + startcounter cookies. + + * org-list.el (org-renumber-ordered-list): Respect counter + start values. + + * org-latex.el (org-export-latex-lists): Accept ordered list + item offset cookie. + + * org-html.el (org-export-as-html): Accept ordered list + item offset cookie. + + * org-indent.el (org-indent-mode): Turn off `indent-tabs-mode' + which messes up alignment of tags. + 2010-04-25 Carsten Dominik + * org-clock.el (org-clock-cancel, org-clock-out): Make sure + the modeline display is removed. + + * org-exp.el (org-export-format-drawer-function): Fix + docstring. + + * org-agenda.el (org-agenda-refile): New optional argument + NO-UPDATE. + (org-agenda-refile): Call `org-agenda-redo' unless NO-UPDATE + is set. + (org-agenda-bulk-action): Call the refile command with updates + suppressed - but arrange for `org-agenda-redo' to be called at + the end. + * org.el (org-mode): Make table mapping quiet. (org-table-map-tables): New optional argument QUIETLY. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c68038da3..d8039163f 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6198,7 +6198,7 @@ If this information is not given, the function uses the tree at point." (delete-region (point-at-bol) (1+ (point-at-eol))))) (beginning-of-line 0)))))) -(defun org-agenda-refile (&optional goto rfloc) +(defun org-agenda-refile (&optional goto rfloc no-update) "Refile the item at point." (interactive "P") (if (equal goto '(16)) @@ -6217,7 +6217,8 @@ If this information is not given, the function uses the tree at point." (widen) (goto-char marker) (org-remove-subtree-entries-from-agenda) - (org-refile goto buffer rfloc))))))) + (org-refile goto buffer rfloc))))) + (unless no-update (org-agenda-redo)))) (defun org-agenda-open-link (&optional arg) "Follow the link in the current line, if any. @@ -7426,6 +7427,7 @@ The prefix arg is passed through to the command if possible." (let* ((action (read-char-exclusive)) (org-log-refile (if org-log-refile 'time nil)) (entries (reverse org-agenda-bulk-marked-entries)) + redo-at-end cmd rfloc state e tag pos (cnt 0) (cntskip 0)) (cond ((equal action ?$) @@ -7445,7 +7447,8 @@ The prefix arg is passed through to the command if possible." (find-buffer-visiting (nth 1 rfloc)) (error "This should not happen")))) - (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc)))) + (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t) + redo-at-end t)) ((equal action ?t) (setq state (org-icompleting-read @@ -7506,6 +7509,7 @@ The prefix arg is passed through to the command if possible." (setq cnt (1+ cnt)))) (setq org-agenda-bulk-marked-entries nil) (org-agenda-bulk-remove-all-marks) + (when redo-at-end (org-agenda-redo)) (message "Acted on %d entries%s" cnt (if (= cntskip 0) diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el index 02578cce7..7ed1f0e76 100644 --- a/lisp/org-ascii.el +++ b/lisp/org-ascii.el @@ -565,7 +565,12 @@ publishing directory." (goto-char (point-min)) (while (re-search-forward "<<]*\\)>>>?\\([ \t]*\\)" nil t) (org-if-unprotected-at (match-beginning 1) - (replace-match "\\1\\2")))) + (replace-match "\\1\\2"))) + ;; Remove list start counters + (goto-char (point-min)) + (while (re-search-forward "\\[@start:[0-9]+\\] ?" nil t) + (org-if-unprotected + (replace-match "")))) (defun org-html-expand-for-ascii (line) "Handle quoted HTML for ASCII export." diff --git a/lisp/org-clock.el b/lisp/org-clock.el index c8bf6cc8c..07c1083ce 100755 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1194,8 +1194,11 @@ line and position cursor in that line." If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (interactive) (catch 'exit - (if (not (org-clocking-p)) - (if fail-quietly (throw 'exit t) (error "No active clock"))) + (when (not (org-clocking-p)) + (setq global-mode-string + (delq 'org-mode-line-string global-mode-string)) + (force-mode-line-update) + (if fail-quietly (throw 'exit t) (error "No active clock"))) (let (ts te s h m remove) (save-excursion ; Do not replace this with `with-current-buffer'. (with-no-warnings (set-buffer (org-clocking-buffer))) @@ -1263,8 +1266,11 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (defun org-clock-cancel () "Cancel the running clock be removing the start timestamp." (interactive) - (if (not (org-clocking-p)) - (error "No active clock")) + (when (not (org-clocking-p)) + (setq global-mode-string + (delq 'org-mode-line-string global-mode-string)) + (force-mode-line-update) + (error "No active clock")) (save-excursion ; Do not replace this with `with-current-buffer'. (with-no-warnings (set-buffer (org-clocking-buffer))) (goto-char org-clock-marker) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 44bde65bd..f467d571e 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1343,9 +1343,9 @@ the current file." (defvar org-export-format-drawer-function nil "Function to be called to format the contents of a drawer. The function must accept three parameters: - BACKEND one of the symbols html, docbook, latex, ascii, xoxo NAME the drawer name, like \"PROPERTIES\" CONTENT the content of the drawer. + BACKEND one of the symbols html, docbook, latex, ascii, xoxo The function should return the text to be inserted into the buffer. If this is nil, `org-export-format-drawer' is used as a default.") diff --git a/lisp/org-html.el b/lisp/org-html.el index 92798d211..3ac2b18d2 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -710,7 +710,7 @@ PUB-DIR is set, use this as the publishing directory." table-buffer table-orig-buffer ind item-type starter didclose rpl path attr desc descp desc1 desc2 link - snumber fnc item-tag + snumber fnc item-tag initial-number footnotes footref-seen id-file href ) @@ -1284,7 +1284,11 @@ lang=\"%s\" xml:lang=\"%s\"> starter (if (match-beginning 2) (substring (match-string 2 line) 0 -1)) line (substring line (match-beginning 5)) + initial-number nil item-tag nil) + (if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line) + (setq initial-number (match-string 1 line) + line (replace-match "" t t line))) (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line)) (setq item-type "d" item-tag (match-string 1 line) @@ -1309,11 +1313,15 @@ lang=\"%s\" xml:lang=\"%s\"> ((and starter (or (not in-local-list) (> ind (car local-list-indent)))) + ;; check for a specified start number ;; Start new (level of) list (org-close-par-maybe) (insert (cond ((equal item-type "u") "
    \n
  • \n") - ((equal item-type "o") "
      \n
    1. \n") + ((equal item-type "o") + (if initial-number + (format "
        \n
      1. \n" initial-number) + "
          \n
        1. \n")) ((equal item-type "d") (format "
          \n
          %s
          \n" item-tag)))) (push item-type local-list-type) diff --git a/lisp/org-indent.el b/lisp/org-indent.el index c8754725a..1d1075431 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -131,6 +131,7 @@ FIXME: How to update when broken?" (setq org-indent-mode nil) (if org-indent-mode (progn + (org-set-local 'indent-tabs-mode nil) (or org-indent-strings (org-indent-initialize)) (when org-indent-mode-turns-off-org-adapt-indentation (org-set-local 'org-adapt-indentation nil)) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 773ec0f4a..9850e9bcd 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -2166,13 +2166,23 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (defun org-export-latex-lists () "Convert plain text lists in current buffer into LaTeX lists." - (goto-char (point-min)) - (while (re-search-forward org-list-beginning-re nil t) - (org-if-unprotected - (beginning-of-line) - (insert (org-list-to-latex (org-list-parse-list t) - org-export-latex-list-parameters)) - "\n"))) + (let (res) + (goto-char (point-min)) + (while (re-search-forward org-list-beginning-re nil t) + (org-if-unprotected + (beginning-of-line) + (setq res (org-list-to-latex (org-list-parse-list t) + org-export-latex-list-parameters)) + (while (string-match "^\\(\\\\item[ \t]+\\)\\[@start:\\([0-9]+\\)\\]" + res) + (setq res (replace-match + (concat (format "\\setcounter{enumi}{%d}" + (1- (string-to-number + (match-string 2 res)))) + "\n" + (match-string 1 res)) + t t res))) + (insert res "\n"))))) (defconst org-latex-entities '("\\!" diff --git a/lisp/org-list.el b/lisp/org-list.el index 212d17211..34deff5ee 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -224,7 +224,7 @@ of `org-plain-list-ordered-item-terminator'." (< (point) (match-end 0)))) (defun org-in-item-p () - "It the cursor inside a plain list item. + "Is the cursor inside a plain list item. Does not have to be the first line." (save-excursion (condition-case nil @@ -841,6 +841,10 @@ with something like \"1.\" or \"2)\"." (setq bobp (bobp)) (looking-at "[ \t]*[0-9]+\\([.)]\\)") (setq fmt (concat "%d" (or (match-string 1) "."))) + (save-excursion + (goto-char (match-end 0)) + (if (looking-at "[ \t]*\\[@start:\\([0-9]+\\)") + (setq n (1- (string-to-number (match-string 1)))))) (beginning-of-line 0) ;; walk forward and replace these numbers (catch 'exit diff --git a/lisp/org.el b/lisp/org.el index 9c2f848fa..992050418 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4496,7 +4496,7 @@ The following commands are available: (defconst org-non-link-chars "]\t\n\r<>") (defvar org-link-types '("http" "https" "ftp" "mailto" "file" "news" - "shell" "elisp")) + "shell" "elisp" "doi")) (defvar org-link-types-re nil "Matches a link that has a url-like prefix like \"http:\"") (defvar org-link-re-with-space nil @@ -8680,6 +8680,11 @@ application the system uses for this file type." (browse-url (concat type ":" (org-link-escape path org-link-escape-chars-browser)))) + ((string= type "doi") + (browse-url (concat "http://dx.doi.org/" + (org-link-escape + path org-link-escape-chars-browser)))) + ((member type '("message")) (browse-url (concat type ":" path)))