From: Nick Dokos <nicholas.dokos@hp.com>
To: emacs-orgmode@gnu.org
Cc: nicholas.dokos@hp.com
Subject: [PATCH] Move definition of macro org-save-outline-visibility from org.el to org-macs.el.
Date: Thu, 19 Aug 2010 11:26:12 -0400 [thread overview]
Message-ID: <23399.1282231572@gamaville.dokosmarshall.org> (raw)
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
reply other threads:[~2010-08-19 15:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23399.1282231572@gamaville.dokosmarshall.org \
--to=nicholas.dokos@hp.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.