From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos 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 Message-ID: <23399.1282231572@gamaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=43234 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Om70n-00025O-D0 for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 11:26:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Om70l-00073o-UN for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 11:26:37 -0400 Received: from vms173015pub.verizon.net ([206.46.173.15]:35206) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Om70l-00073W-Q1 for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 11:26:35 -0400 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173015.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L7E007HYO7Q7R10@vms173015.mailsrvcs.net> for emacs-orgmode@gnu.org; Thu, 19 Aug 2010 10:26:14 -0500 (CDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: nicholas.dokos@hp.com 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 --- 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