Browse Source

Make `org-save-outline-visibility' macro return a useful value

Modified from a patch by Paul Sexton
Carsten Dominik 14 years ago
parent
commit
d8625e809f
1 changed files with 5 additions and 3 deletions
  1. 5 3
      lisp/org-macs.el

+ 5 - 3
lisp/org-macs.el

@@ -323,16 +323,18 @@ but it also means that the buffer should stay alive
 during the operation, because otherwise all these markers will
 during the operation, because otherwise all these markers will
 point nowhere."
 point nowhere."
   (declare (indent 1))
   (declare (indent 1))
-  `(let ((data (org-outline-overlay-data ,use-markers)))
+  `(let ((data (org-outline-overlay-data ,use-markers))
+	 rtn)
      (unwind-protect
      (unwind-protect
 	 (progn
 	 (progn
-	   ,@body
+	   (setq rtn (progn ,@body))
 	   (org-set-outline-overlay-data data))
 	   (org-set-outline-overlay-data data))
        (when ,use-markers
        (when ,use-markers
 	 (mapc (lambda (c)
 	 (mapc (lambda (c)
 		 (and (markerp (car c)) (move-marker (car c) nil))
 		 (and (markerp (car c)) (move-marker (car c) nil))
 		 (and (markerp (cdr c)) (move-marker (cdr c) nil)))
 		 (and (markerp (cdr c)) (move-marker (cdr c) nil)))
-	       data)))))
+	       data)))
+     rtn))
 
 
 (defmacro org-with-wide-buffer (&rest body)
 (defmacro org-with-wide-buffer (&rest body)
  "Execute body while temporarily widening the buffer."
  "Execute body while temporarily widening the buffer."