* [PATCH] Move definition of macro org-save-outline-visibility from org.el to org-macs.el.
@ 2010-08-19 15:26 Nick Dokos
0 siblings, 0 replies; only message in thread
From: Nick Dokos @ 2010-08-19 15:26 UTC (permalink / raw
To: emacs-orgmode; +Cc: nicholas.dokos
It is used by ob.el so it has to be in a file that is require'd by ob.el,
otherwise compiling it leads to problems: the compiler thinks it's a
function it hasn't seen, so when it tries to call it, it fails.
Another solution would be to (require 'org) in ob.el.
Reported-by: Austin Frank, ref: http://thread.gmane.org/gmane.emacs.orgmode/28048
Signed-off-by: Nick Dokos <nicholas.dokos@hp.com>
---
lisp/org-macs.el | 22 ++++++++++++++++++++++
lisp/org.el | 20 --------------------
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 77527d2..918dd46 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -307,6 +307,28 @@ The number of levels is controlled by `org-inlinetask-min-level'"
(nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level)))
(format "\\*\\{1,%d\\} " nstars))))
+;;; moved here from org.el so that ob.el can use it too.
+(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
diff --git a/lisp/org.el b/lisp/org.el
index 31d2411..0e1d191 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6247,26 +6247,6 @@ DATA should have been made by `org-outline-overlay-data'."
(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
(defconst org-block-regexp
--
1.7.2.1.95.g3d045.dirty
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-08-19 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19 15:26 [PATCH] Move definition of macro org-save-outline-visibility from org.el to org-macs.el Nick Dokos
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.