emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108000: Merge Org 7.8.10 -- impor


From: Bastien Guerry
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108000: Merge Org 7.8.10 -- important bug fixes since Org 7.8.09.
Date: Wed, 16 May 2012 19:33:50 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 108000
committer: Bastien Guerry <address@hidden>
branch nick: emacs-24
timestamp: Wed 2012-05-16 19:33:50 +0200
message:
  Merge Org 7.8.10 -- important bug fixes since Org 7.8.09.
modified:
  doc/misc/ChangeLog
  doc/misc/org.texi
  etc/refcards/orgcard.pdf
  etc/refcards/orgcard.tex
  lisp/org/ChangeLog
  lisp/org/ob.el
  lisp/org/org-agenda.el
  lisp/org/org-bibtex.el
  lisp/org/org-list.el
  lisp/org/org-protocol.el
  lisp/org/org-table.el
  lisp/org/org.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2012-05-12 19:00:30 +0000
+++ b/doc/misc/ChangeLog        2012-05-16 17:33:50 +0000
@@ -1,3 +1,7 @@
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org.texi (Durations and time values): Fix typo.
+
 2012-05-12  Andreas Schwab  <address@hidden>
 
        * cc-mode.texi: Avoid space before macro in 4th argument of cross

=== modified file 'doc/misc/org.texi'
--- a/doc/misc/org.texi 2012-05-02 01:22:26 +0000
+++ b/doc/misc/org.texi 2012-05-16 17:33:50 +0000
@@ -4,8 +4,8 @@
 @setfilename ../../info/org
 @settitle The Org Manual
 
address@hidden VERSION 7.8.09
address@hidden DATE April 2012
address@hidden VERSION 7.8.10
address@hidden DATE May 2012
 
 @c Use proper quote and backtick for code sections in PDF output
 @c Cf. Texinfo manual 14.2
@@ -2625,7 +2625,7 @@
 
 Input duration values must be of the form @code{[HH:MM[:SS]}, where seconds
 are optional.  With the @code{T} flag, computed durations will be displayed
-as @code{[HH:MM:SS} (see the first formula above).  With the @code{t} flag,
+as @code{HH:MM:SS} (see the first formula above).  With the @code{t} flag,
 computed durations will be displayed according to the value of the variable
 @code{org-table-duration-custom-format}, which defaults to @code{'hours} and
 will display the result as a fraction of hours (see the second formula in the
@@ -7900,9 +7900,9 @@
 Delete other windows.
 @c
 @orgcmdkskc{v d,d,org-agenda-day-view}
address@hidden w,w,org-agenda-day-view}
address@hidden w,w,org-agenda-week-view}
 @xorgcmd{v m,org-agenda-month-view}
address@hidden y,org-agenda-month-year}
address@hidden y,org-agenda-year-view}
 @xorgcmd{v SPC,org-agenda-reset-view}
 @vindex org-agenda-span
 Switch to day/week/month/year view.  When switching to day or week view, this

=== modified file 'etc/refcards/orgcard.pdf'
Binary files a/etc/refcards/orgcard.pdf 2012-04-11 10:59:50 +0000 and 
b/etc/refcards/orgcard.pdf        2012-05-16 17:33:50 +0000 differ
=== modified file 'etc/refcards/orgcard.tex'
--- a/etc/refcards/orgcard.tex  2012-04-11 10:59:50 +0000
+++ b/etc/refcards/orgcard.tex  2012-05-16 17:33:50 +0000
@@ -1,5 +1,5 @@
 % Reference Card for Org Mode
-\def\orgversionnumber{7.8.09}
+\def\orgversionnumber{7.8.10}
 \def\versionyear{2012}          % latest update
 \def\year{2012}                 % latest copyright year
 

=== modified file 'lisp/org/ChangeLog'
--- a/lisp/org/ChangeLog        2012-04-26 20:46:10 +0000
+++ b/lisp/org/ChangeLog        2012-05-16 17:33:50 +0000
@@ -1,3 +1,79 @@
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org.el (org-scan-tags): Correctly match TODO keywords.
+
+2012-05-16  Nicolas Goaziou  <address@hidden>
+
+       * org-list.el (org-list-struct): Fix white spaces.
+       (org-list-swap-items, org-list-send-item): Fix visibility
+       preservation.
+
+2012-05-16  Nicolas Goaziou  <address@hidden>
+
+       * org-list.el (org-list-swap-items, org-list-send-item): Preserve
+       visibility when moving items.
+
+2012-05-16  Mark E. Shoulson  <address@hidden>  (tiny change)
+
+       * org.el (org-fontify-entities): Hide {} when prettifying
+       entities.
+
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org.el (org-cycle-internal-global): Prevent the display of
+       messages when cycling from with a Gnus article buffer.
+
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org-table.el (org-table-time-seconds-to-string): Fix bug about
+       handling a negative duration value.
+
+2012-05-16  Nicolas Goaziou  <address@hidden>
+
+       * org.el (org-link-expand-abbrev): Fix docstring.
+
+2012-05-16  Nicolas Goaziou  <address@hidden>
+
+       * org.el (org-translate-link): Fix bug.
+
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org-agenda.el (org-agenda-bulk-mark-regexp): Fix bug when
+       setting the number of marked entries.
+
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org-table.el (org-tbl-calc-modes): Rename from
+       `org-table-modes'.
+       (org-set-calc-mode, org-table-eval-formula): Use it.
+
+2012-05-16  Eric Schulte  <address@hidden>
+
+       * ob.el (org-babel-find-named-result): Fix bug finding empty named
+       results.
+
+2012-05-16  Nicolas Goaziou  <address@hidden>
+
+       * org.el (org-set-regexps-and-options): Fix
+       `org-planning-or-clock-line-re' regexp.  Indeed "\\>" will never
+       match since time keywords must end with colons, which are not word
+       constituent.
+
+2012-05-16  Bastien Guerry  <address@hidden>
+
+       * org-ctags.el (org-ctags-new-topic-template): Fix the option
+       default value back again.
+
+2012-05-16  Eric Schulte  <address@hidden>
+
+       * org-bibtex.el (org-bibtex-export-to-kill-ring): Don't rely on
+       kill-new to return a string.
+
+2012-05-16  Eric Schulte  <address@hidden>
+
+       * org-bibtex.el (org-bibtex-headline): Remove call to
+       bibtex-reformat which often hangs.
+
 2012-04-26  Nicolas Goaziou  <address@hidden>
 
        * org-table.el (org-table-number-fraction): Fix typo.

=== modified file 'lisp/org/ob.el'
--- a/lisp/org/ob.el    2012-04-03 12:02:21 +0000
+++ b/lisp/org/ob.el    2012-05-16 17:33:50 +0000
@@ -1498,7 +1498,7 @@
     (catch 'is-a-code-block
       (when (re-search-forward
             (concat org-babel-result-regexp
-                    "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]+") nil t)
+                    "[ \t]" (regexp-quote name) "[ \t]*[\n\f\v\r]") nil t)
        (when (and (string= "name" (downcase (match-string 1)))
                   (or (beginning-of-line 1)
                       (looking-at org-babel-src-block-regexp)

=== modified file 'lisp/org/org-agenda.el'
--- a/lisp/org/org-agenda.el    2012-04-26 17:30:04 +0000
+++ b/lisp/org/org-agenda.el    2012-05-16 17:33:50 +0000
@@ -8315,13 +8315,13 @@
 (defun org-agenda-bulk-mark-regexp (regexp)
   "Mark entries match REGEXP."
   (interactive "sMark entries matching regexp: ")
-  (let (entries-marked)
+  (let ((entries-marked 0))
     (save-excursion
       (goto-char (point-min))
       (goto-char (next-single-property-change (point) 'txt))
       (while (re-search-forward regexp nil t)
        (when (string-match regexp (get-text-property (point) 'txt))
-         (setq entries-marked (+ entries-marked 1))
+         (setq entries-marked (1+ entries-marked))
          (call-interactively 'org-agenda-bulk-mark))))
     (if (not entries-marked)
        (message "No entry matching this regexp."))))

=== modified file 'lisp/org/org-bibtex.el'
--- a/lisp/org/org-bibtex.el    2012-04-03 12:02:21 +0000
+++ b/lisp/org/org-bibtex.el    2012-05-16 17:33:50 +0000
@@ -369,7 +369,7 @@
                  (progn (goto-char (match-end 1)) (insert ", "))
                (bibtex-make-field "keywords" t t))
              (insert (mapconcat #'identity tags ", ")))
-            (bibtex-reformat) (buffer-string)))))))
+            (buffer-string)))))))
 
 (defun org-bibtex-ask (field)
   (unless (assoc field org-bibtex-fields)
@@ -661,7 +661,8 @@
 (defun org-bibtex-export-to-kill-ring ()
   "Export current headline to kill ring as bibtex entry."
   (interactive)
-  (kill-new (org-bibtex-headline)))
+  (let ((result (org-bibtex-headline)))
+    (kill-new result) result))
 
 (defun org-bibtex-search (string)
   "Search for bibliographical entries in agenda files.

=== modified file 'lisp/org/org-list.el'
--- a/lisp/org/org-list.el      2012-04-26 17:30:04 +0000
+++ b/lisp/org/org-list.el      2012-05-16 17:33:50 +0000
@@ -714,15 +714,15 @@
       ;;    equally indented than BEG-CELL's cdr.  Also, store ending
       ;;    position of items in END-LST-2.
       (catch 'exit
-       (while t
-         (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
+       (while t
+         (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
                        (org-get-indentation))))
-           (cond
-            ((>= (point) lim-down)
+           (cond
+            ((>= (point) lim-down)
              ;; At downward limit: this is de facto the end of the
              ;; list.  Save point as an ending position, and jump to
              ;; part 3.
-             (throw 'exit
+             (throw 'exit
                     (push (cons 0 (funcall end-before-blank)) end-lst-2)))
             ;; At a verbatim block, move to its end.  Point is at bol
             ;; and 'org-example property is set by whole lines:
@@ -1071,8 +1071,10 @@
 
 (defun org-list-swap-items (beg-A beg-B struct)
   "Swap item starting at BEG-A with item starting at BEG-B in STRUCT.
-Blank lines at the end of items are left in place.  Return the
-new structure after the changes.
+
+Blank lines at the end of items are left in place.  Item
+visibility is preserved.  Return the new structure after the
+changes.
 
 Assume BEG-A is lesser than BEG-B and that BEG-A and BEG-B belong
 to the same sub-list.
@@ -1089,7 +1091,17 @@
           (body-B (buffer-substring beg-B end-B-no-blank))
           (between-A-no-blank-and-B (buffer-substring end-A-no-blank beg-B))
           (sub-A (cons beg-A (org-list-get-subtree beg-A struct)))
-          (sub-B (cons beg-B (org-list-get-subtree beg-B struct))))
+          (sub-B (cons beg-B (org-list-get-subtree beg-B struct)))
+          ;; Store overlays responsible for visibility status.  We
+          ;; also need to store their boundaries as they will be
+          ;; removed from buffer.
+          (overlays (cons
+                     (mapcar (lambda (ov)
+                               (list ov (overlay-start ov) (overlay-end ov)))
+                             (overlays-in beg-A end-A))
+                     (mapcar (lambda (ov)
+                               (list ov (overlay-start ov) (overlay-end ov)))
+                             (overlays-in beg-B end-B)))))
       ;; 1. Move effectively items in buffer.
       (goto-char beg-A)
       (delete-region beg-A end-B-no-blank)
@@ -1122,7 +1134,22 @@
                    (setcar e (+ pos (- size-B size-A)))
                    (setcar (nthcdr 6 e) (+ end-e (- size-B size-A))))))))
            struct)
-      (sort struct (lambda (e1 e2) (< (car e1) (car e2)))))))
+      (setq struct (sort struct (lambda (e1 e2) (< (car e1) (car e2)))))
+      ;; Restore visibility status, by moving overlays to their new
+      ;; position.
+      (mapc (lambda (ov)
+             (move-overlay
+              (car ov)
+              (+ (nth 1 ov) (- (+ beg-B (- size-B size-A)) beg-A))
+              (+ (nth 2 ov) (- (+ beg-B (- size-B size-A)) beg-A))))
+           (car overlays))
+      (mapc (lambda (ov)
+             (move-overlay (car ov)
+                           (+ (nth 1 ov) (- beg-A beg-B))
+                           (+ (nth 2 ov) (- beg-A beg-B))))
+           (cdr overlays))
+      ;; Return structure.
+      struct)))
 
 (defun org-list-separating-blank-lines-number (pos struct prevs)
   "Return number of blank lines that should separate items in list.
@@ -1340,8 +1367,8 @@
 to another item in the same list as ITEM, and will move the
 latter just before the former.
 
-If DEST is `begin' \(respectively `end'\), ITEM will be moved at
-the beginning \(respectively end\) of the list it belongs to.
+If DEST is `begin' (respectively `end'), ITEM will be moved at
+the beginning (respectively end) of the list it belongs to.
 
 If DEST is a string like \"N\", where N is an integer, ITEM will
 be moved at the Nth position in the list.
@@ -1351,6 +1378,8 @@
 
 If DEST is `delete', ITEM will be deleted.
 
+Visibility of item is preserved.
+
 This function returns, destructively, the new list structure."
   (let* ((prevs (org-list-prevs-alist struct))
         (item-end (org-list-get-item-end item struct))
@@ -1393,7 +1422,9 @@
                             (org-list-get-last-item item struct prevs))
                            (point-at-eol)))))
                     (t dest)))
-        (org-M-RET-may-split-line nil))
+        (org-M-RET-may-split-line nil)
+        ;; Store visibility.
+        (visibility (overlays-in item item-end)))
     (cond
      ((eq dest 'delete) (org-list-delete-item item struct))
      ((eq dest 'kill)
@@ -1429,9 +1460,14 @@
                                                         (+ end shift)))))))
                               moved-items))
                      (lambda (e1 e2) (< (car e1) (car e2))))))
-      ;; 2. Eventually delete extra copy of the item and clean marker.
-      (prog1
-         (org-list-delete-item (marker-position item) struct)
+      ;; 2. Restore visibility.
+      (mapc (lambda (ov)
+             (move-overlay ov
+                           (+ (overlay-start ov) (- (point) item))
+                           (+ (overlay-end ov) (- (point) item))))
+           visibility)
+      ;; 3. Eventually delete extra copy of the item and clean marker.
+      (prog1 (org-list-delete-item (marker-position item) struct)
        (move-marker item nil)))
      (t struct))))
 

=== modified file 'lisp/org/org-protocol.el'
--- a/lisp/org/org-protocol.el  2012-04-01 20:27:06 +0000
+++ b/lisp/org/org-protocol.el  2012-05-16 17:33:50 +0000
@@ -225,7 +225,7 @@
   :type 'alist)
 
 (defcustom org-protocol-protocol-alist nil
-  "* Register custom handlers for org-protocol.
+  "Register custom handlers for org-protocol.
 
 Each element of this list must be of the form:
 

=== modified file 'lisp/org/org-table.el'
--- a/lisp/org/org-table.el     2012-04-26 17:30:04 +0000
+++ b/lisp/org/org-table.el     2012-05-16 17:33:50 +0000
@@ -2368,7 +2368,7 @@
                       (looking-at org-table-auto-recalculate-regexp))
        (org-table-recalculate) t))
 
-(defvar org-table-modes)
+(defvar org-tbl-calc-modes) ;; Dynamically bound in `org-table-eval-formula'
 (defsubst org-set-calc-mode (var &optional value)
   (if (stringp var)
       (setq var (assoc var '(("D" calc-angle-mode deg)
@@ -2376,10 +2376,10 @@
                             ("F" calc-prefer-frac t)
                             ("S" calc-symbolic-mode t)))
            value (nth 2 var) var (nth 1 var)))
-  (if (memq var org-table-modes)
-      (setcar (cdr (memq var org-table-modes)) value)
-    (cons var (cons value org-table-modes)))
-  org-table-modes)
+  (if (memq var org-tbl-calc-modes)
+      (setcar (cdr (memq var org-tbl-calc-modes)) value)
+    (cons var (cons value org-tbl-calc-modes)))
+  org-tbl-calc-modes)
 
 (defun org-table-eval-formula (&optional arg equation
                                         suppress-align suppress-const
@@ -2437,7 +2437,7 @@
                        equation
                      (org-table-get-formula equation (equal arg '(4)))))
           (n0 (org-table-current-column))
-          (modes (copy-sequence org-calc-default-modes))
+          (org-tbl-calc-modes (copy-sequence org-calc-default-modes))
           (numbers nil) ; was a variable, now fixed default
           (keep-empty nil)
           n form form0 formrpl formrg bw fmt x ev orig c lispp literal
@@ -2453,12 +2453,13 @@
              (setq c (string-to-char (match-string 1 fmt))
                    n (string-to-number (match-string 2 fmt)))
              (if (= c ?p)
-                 (setq modes (org-set-calc-mode 'calc-internal-prec n))
-               (setq modes (org-set-calc-mode
-                            'calc-float-format
-                            (list (cdr (assoc c '((?n . float) (?f . fix)
-                                                  (?s . sci) (?e . eng))))
-                                  n))))
+                 (setq org-tbl-calc-modes (org-set-calc-mode 
'calc-internal-prec n))
+               (setq org-tbl-calc-modes
+                     (org-set-calc-mode
+                      'calc-float-format
+                      (list (cdr (assoc c '((?n . float) (?f . fix)
+                                            (?s . sci) (?e . eng))))
+                            n))))
              (setq fmt (replace-match "" t t fmt)))
            (if (string-match "T" fmt)
                (setq duration t numbers t
@@ -2479,7 +2480,7 @@
                (setq keep-empty t
                      fmt (replace-match "" t t fmt)))
            (while (string-match "[DRFS]" fmt)
-             (setq modes (org-set-calc-mode (match-string 0 fmt)))
+             (setq org-tbl-calc-modes (org-set-calc-mode (match-string 0 fmt)))
              (setq fmt (replace-match "" t t fmt)))
            (unless (string-match "\\S-" fmt)
              (setq fmt nil))))
@@ -2588,7 +2589,7 @@
                                   duration-output-format) ev))
          (or (fboundp 'calc-eval)
              (error "Calc does not seem to be installed, and is needed to 
evaluate the formula"))
-         (setq ev (calc-eval (cons form modes) (if numbers 'num))
+         (setq ev (calc-eval (cons form org-tbl-calc-modes) (if numbers 'num))
                ev (if duration (org-table-time-seconds-to-string
                                 (string-to-number ev)
                                 duration-output-format) ev)))
@@ -3309,15 +3310,18 @@
   "Convert a number of seconds to a time string.
 If OUTPUT-FORMAT is non-nil, return a number of days, hours,
 minutes or seconds."
-  (cond ((eq output-format 'days)
-        (format "%.3f" (/ (float secs) 86400)))
-       ((eq output-format 'hours)
-        (format "%.2f" (/ (float secs) 3600)))
-       ((eq output-format 'minutes)
-        (format "%.1f" (/ (float secs) 60)))
-       ((eq output-format 'seconds)
-        (format "%d" secs))
-       (t (org-format-seconds "%.2h:%.2m:%.2s" secs))))
+  (let* ((secs0 (abs secs))
+        (res
+         (cond ((eq output-format 'days)
+                (format "%.3f" (/ (float secs0) 86400)))
+               ((eq output-format 'hours)
+                (format "%.2f" (/ (float secs0) 3600)))
+               ((eq output-format 'minutes)
+                (format "%.1f" (/ (float secs0) 60)))
+               ((eq output-format 'seconds)
+                (format "%d" secs0))
+               (t (org-format-seconds "%.2h:%.2m:%.2s" secs0)))))
+    (if (< secs 0) (concat "-" res) res)))
 
 (defun org-table-fedit-convert-buffer (function)
   "Convert all references in this buffer, using FUNCTION."

=== modified file 'lisp/org/org.el'
--- a/lisp/org/org.el   2012-04-26 17:30:04 +0000
+++ b/lisp/org/org.el   2012-05-16 17:33:50 +0000
@@ -6,7 +6,7 @@
 ;; Maintainer: Bastien Guerry <bzg at gnu dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
-;; Version: 7.8.09
+;; Version: 7.8.10
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -206,7 +206,7 @@
 
 ;;; Version
 
-(defconst org-version "7.8.09"
+(defconst org-version "7.8.10"
   "The version number of the file org.el.")
 
 ;;;###autoload
@@ -4789,10 +4789,11 @@
                    "\\|" org-clock-string "\\)\\)?"
                    " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} 
?[^]\r\n>]*?[]>]\\|<%%([^\r\n>]*>\\)")
            org-planning-or-clock-line-re
-           (concat "\\(?:^[ \t]*\\(" org-scheduled-string
-                   "\\|" org-deadline-string
-                   "\\|" org-closed-string "\\|" org-clock-string
-                   "\\)\\>\\)")
+           (concat "^[ \t]*\\("
+                   org-scheduled-string "\\|"
+                   org-deadline-string "\\|"
+                   org-closed-string "\\|"
+                   org-clock-string "\\)")
            org-all-time-keywords
            (mapcar (lambda (w) (substring w 0 -1))
                    (list org-scheduled-string org-deadline-string
@@ -5916,16 +5917,19 @@
     (when org-pretty-entities
       (catch 'match
        (while (re-search-forward
-               "\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|[^[:alpha:]\n]\\)"
+               
"\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
                limit t)
          (if (and (not (org-in-indented-comment-line))
                   (setq ee (org-entity-get (match-string 1)))
                   (= (length (nth 6 ee)) 1))
-             (progn
+             (let*
+                 ((end (if (equal (match-string 2) "{}")
+                           (match-end 2)
+                         (match-end 1))))
                (add-text-properties
-                (match-beginning 0) (match-end 1)
+                (match-beginning 0) end
                 (list 'font-lock-fontified t))
-               (compose-region (match-beginning 0) (match-end 1)
+               (compose-region (match-beginning 0) end
                                (nth 6 ee) nil)
                (backward-char 1)
                (throw 'match t))))
@@ -6255,34 +6259,36 @@
 
 (defun org-cycle-internal-global ()
   "Do the global cycling action."
-  (cond
-   ((and (eq last-command this-command)
-        (eq org-cycle-global-status 'overview))
-    ;; We just created the overview - now do table of contents
-    ;; This can be slow in very large buffers, so indicate action
-    (run-hook-with-args 'org-pre-cycle-hook 'contents)
-    (message "CONTENTS...")
-    (org-content)
-    (message "CONTENTS...done")
-    (setq org-cycle-global-status 'contents)
-    (run-hook-with-args 'org-cycle-hook 'contents))
-
-   ((and (eq last-command this-command)
-        (eq org-cycle-global-status 'contents))
-    ;; We just showed the table of contents - now show everything
-    (run-hook-with-args 'org-pre-cycle-hook 'all)
-    (show-all)
-    (message "SHOW ALL")
-    (setq org-cycle-global-status 'all)
-    (run-hook-with-args 'org-cycle-hook 'all))
-
-   (t
-    ;; Default action: go to overview
-    (run-hook-with-args 'org-pre-cycle-hook 'overview)
-    (org-overview)
-    (message "OVERVIEW")
-    (setq org-cycle-global-status 'overview)
-    (run-hook-with-args 'org-cycle-hook 'overview))))
+  ;; Hack to avoid display of messages for .org  attachments in Gnus
+  (let ((ga (string-match "\\*fontification" (buffer-name))))
+    (cond
+     ((and (eq last-command this-command)
+          (eq org-cycle-global-status 'overview))
+      ;; We just created the overview - now do table of contents
+      ;; This can be slow in very large buffers, so indicate action
+      (run-hook-with-args 'org-pre-cycle-hook 'contents)
+      (unless ga (message "CONTENTS..."))
+      (org-content)
+      (unless ga (message "CONTENTS...done"))
+      (setq org-cycle-global-status 'contents)
+      (run-hook-with-args 'org-cycle-hook 'contents))
+
+     ((and (eq last-command this-command)
+          (eq org-cycle-global-status 'contents))
+      ;; We just showed the table of contents - now show everything
+      (run-hook-with-args 'org-pre-cycle-hook 'all)
+      (show-all)
+      (unless ga (message "SHOW ALL"))
+      (setq org-cycle-global-status 'all)
+      (run-hook-with-args 'org-cycle-hook 'all))
+
+     (t
+      ;; Default action: go to overview
+      (run-hook-with-args 'org-pre-cycle-hook 'overview)
+      (org-overview)
+      (unless ga (message "OVERVIEW"))
+      (setq org-cycle-global-status 'overview)
+      (run-hook-with-args 'org-cycle-hook 'overview)))))
 
 (defun org-cycle-internal-local ()
   "Do the local cycling action."
@@ -8574,7 +8580,7 @@
 ;;; Link abbreviations
 
 (defun org-link-expand-abbrev (link)
-  "Apply replacements as defined in `org-link-abbrev-alist."
+  "Apply replacements as defined in `org-link-abbrev-alist'."
   (if (string-match "^\\([^:]*\\)\\(::?\\(.*\\)\\)?$" link)
       (let* ((key (match-string 1 link))
             (as (or (assoc key org-link-abbrev-alist-local)
@@ -9432,7 +9438,7 @@
           (string-match "\\([a-zA-Z0-9]+\\):\\(.*\\)" s))
       (progn
        (setq s (funcall org-link-translation-function
-                        (match-string 1) (match-string 2)))
+                        (match-string 1 s) (match-string 2 s)))
        (concat (car s) ":" (cdr s)))
     s))
 
@@ -12823,7 +12829,9 @@
                     " *\\(\\<\\("
                     (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
                     (org-re
-                     "\\>\\)\\)? 
*\\(.*?\\)\\(:[[:alnum:address@hidden:]+:\\)?[ \t]*$")))
+                     (if todo-only
+                         "\\>\\)\\)[ 
\t]+\\(.*?\\)\\(:[[:alnum:address@hidden:]+:\\)?[ \t]*$"
+                       "\\>\\)\\)? *\\([^ 
].*?\\)\\(:[[:alnum:address@hidden:]+:\\)?[ \t]*$"))))
         (props (list 'face 'default
                      'done-face 'org-agenda-done
                      'undone-face 'default


reply via email to

[Prev in Thread] Current Thread [Next in Thread]