emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Paul Sexton <psexton@xnet.co.nz>
To: emacs-orgmode@gnu.org
Subject: [patch] make 'org-save-outline-visibility' return a useful value
Date: Fri, 22 Apr 2011 03:11:45 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110422T050353-1@post.gmane.org> (raw)

The macro 'org-save-outline-visibility' in org-macs.el seems like 
it should return the value of the last statement in its body (like 
save-excursion and save-restriction do). Instead it discards this
value and returns nothing useful.

The macro is only used in 2 places in the org sources, and its
return value is ignored in both. I feel it would be more useful if 
it returned the value of the last expression in its body. A patch 
to this effect is attached.

Paul



--- C:/Users/paul/org-macs.el	Fri Apr 22 14:57:07 2011
+++ C:/Users/paul/org-macs-new.el	Fri Apr 22 14:56:51 2011
@@ -325,8 +325,9 @@
   (declare (indent 1))
   `(let ((data (org-outline-overlay-data ,use-markers)))
      (unwind-protect
+	 (prog1
 	 (progn
-	   ,@body
+               ,@body)
 	   (org-set-outline-overlay-data data))
        (when ,use-markers
 	 (mapc (lambda (c)

             reply	other threads:[~2011-04-22  3:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22  3:11 Paul Sexton [this message]
2011-05-02  7:44 ` Carsten Dominik

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110422T050353-1@post.gmane.org \
    --to=psexton@xnet.co.nz \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [patch] make '\''org-save-outline-visibility'\'' return a useful value' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).