emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r101133: Fix previous Org change.


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101133: Fix previous Org change.
Date: Wed, 18 Aug 2010 20:45:46 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101133
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2010-08-18 20:45:46 -0700
message:
  Fix previous Org change.
  * org.el (org-outline-overlay-data, org-set-outline-overlay-data)
  (org-save-outline-visibility): Move to org-macs.
  * org-macs.el (org-outline-overlay-data, org-set-outline-overlay-data)
  (org-save-outline-visibility): Move here from org.el.
  (show-all): Autoload it.
  * ob.el: Don't require org when compiling.
modified:
  lisp/org/ChangeLog
  lisp/org/ob.el
  lisp/org/org-macs.el
  lisp/org/org.el
=== modified file 'lisp/org/ChangeLog'
--- a/lisp/org/ChangeLog        2010-08-18 02:44:25 +0000
+++ b/lisp/org/ChangeLog        2010-08-19 03:45:46 +0000
@@ -1,3 +1,12 @@
+2010-08-19  Glenn Morris  <address@hidden>
+
+       * org.el (org-outline-overlay-data, org-set-outline-overlay-data)
+       (org-save-outline-visibility): Move to org-macs.
+       * org-macs.el (org-outline-overlay-data, org-set-outline-overlay-data)
+       (org-save-outline-visibility): Move here from org.el.
+       (show-all): Autoload it.
+       * ob.el: Don't require org when compiling.
+
 2010-08-18  Glenn Morris  <address@hidden>
 
        * ob.el: Require org when compiling.

=== modified file 'lisp/org/ob.el'
--- a/lisp/org/ob.el    2010-08-18 02:44:25 +0000
+++ b/lisp/org/ob.el    2010-08-19 03:45:46 +0000
@@ -30,8 +30,7 @@
 
 ;;; Code:
 (eval-when-compile
-  (require 'cl)
-  (require 'org))                  ; org-save-outline-visibility macro
+  (require 'cl))
 (require 'org-macs)
 
 (defvar org-babel-call-process-region-original)

=== modified file 'lisp/org/org-macs.el'
--- a/lisp/org/org-macs.el      2010-07-19 09:47:27 +0000
+++ b/lisp/org/org-macs.el      2010-08-19 03:45:46 +0000
@@ -300,6 +300,66 @@
           (nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level)))
       (format "\\*\\{1,%d\\} " nstars))))
 
+
+;;; Saving and restoring visibility
+
+(defun org-outline-overlay-data (&optional use-markers)
+  "Return a list of the locations of all outline overlays.
+The are overlays with the `invisible' property value `outline'.
+The return values is a list of cons cells, with start and stop
+positions for each overlay.
+If USE-MARKERS is set, return the positions as markers."
+  (let (beg end)
+    (save-excursion
+      (save-restriction
+       (widen)
+       (delq nil
+             (mapcar (lambda (o)
+                       (when (eq (overlay-get o 'invisible) 'outline)
+                         (setq beg (overlay-start o)
+                               end (overlay-end o))
+                         (and beg end (> end beg)
+                              (if use-markers
+                                  (cons (move-marker (make-marker) beg)
+                                        (move-marker (make-marker) end))
+                                (cons beg end)))))
+                     (overlays-in (point-min) (point-max))))))))
+
+(autoload 'show-all "outline" nil t)
+
+(defun org-set-outline-overlay-data (data)
+  "Create visibility overlays for all positions in DATA.
+DATA should have been made by `org-outline-overlay-data'."
+  (let (o)
+    (save-excursion
+      (save-restriction
+       (widen)
+       (show-all)
+       (mapc (lambda (c)
+               (setq o (make-overlay (car c) (cdr c)))
+               (overlay-put o 'invisible 'outline))
+             data)))))
+
+(defmacro org-save-outline-visibility (use-markers &rest body)
+  "Save and restore outline visibility around BODY.
+If USE-MARKERS is non-nil, use markers for the positions.
+This means that the buffer may change while running BODY,
+but it also means that the buffer should stay alive
+during the operation, because otherwise all these markers will
+point nowhere."
+  (declare (indent 1))
+  `(let ((data (org-outline-overlay-data ,use-markers)))
+     (unwind-protect
+        (progn
+          ,@body
+          (org-set-outline-overlay-data data))
+       (when ,use-markers
+        (mapc (lambda (c)
+                (and (markerp (car c)) (move-marker (car c) nil))
+                (and (markerp (cdr c)) (move-marker (cdr c) nil)))
+              data)))))
+
+
 (provide 'org-macs)
 
 ;; arch-tag: 7e6a73ce-aac9-4fc0-9b30-ce6f89dc6668

=== modified file 'lisp/org/org.el'
--- a/lisp/org/org.el   2010-07-19 09:47:27 +0000
+++ b/lisp/org/org.el   2010-08-19 03:45:46 +0000
@@ -6190,62 +6190,6 @@
     (beginning-of-line)
     (recenter (prefix-numeric-value N))))
 
-;;; Saving and restoring visibility
-
-(defun org-outline-overlay-data (&optional use-markers)
-  "Return a list of the locations of all outline overlays.
-The are overlays with the `invisible' property value `outline'.
-The return values is a list of cons cells, with start and stop
-positions for each overlay.
-If USE-MARKERS is set, return the positions as markers."
-  (let (beg end)
-    (save-excursion
-      (save-restriction
-       (widen)
-       (delq nil
-             (mapcar (lambda (o)
-                       (when (eq (overlay-get o 'invisible) 'outline)
-                         (setq beg (overlay-start o)
-                               end (overlay-end o))
-                         (and beg end (> end beg)
-                              (if use-markers
-                                  (cons (move-marker (make-marker) beg)
-                                        (move-marker (make-marker) end))
-                                (cons beg end)))))
-                     (overlays-in (point-min) (point-max))))))))
-
-(defun org-set-outline-overlay-data (data)
-  "Create visibility overlays for all positions in DATA.
-DATA should have been made by `org-outline-overlay-data'."
-  (let (o)
-    (save-excursion
-      (save-restriction
-       (widen)
-       (show-all)
-       (mapc (lambda (c)
-               (setq o (make-overlay (car c) (cdr c)))
-               (overlay-put o 'invisible 'outline))
-             data)))))
-
-(defmacro org-save-outline-visibility (use-markers &rest body)
-  "Save and restore outline visibility around BODY.
-If USE-MARKERS is non-nil, use markers for the positions.
-This means that the buffer may change while running BODY,
-but it also means that the buffer should stay alive
-during the operation, because otherwise all these markers will
-point nowhere."
-  (declare (indent 1))
-  `(let ((data (org-outline-overlay-data ,use-markers)))
-     (unwind-protect
-        (progn
-          ,@body
-          (org-set-outline-overlay-data data))
-       (when ,use-markers
-        (mapc (lambda (c)
-                (and (markerp (car c)) (move-marker (car c) nil))
-                (and (markerp (cdr c)) (move-marker (cdr c) nil)))
-              data)))))
-
 
 ;;; Folding of blocks
 


reply via email to

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