From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [patch] make 'org-save-outline-visibility' return a useful value Date: Mon, 2 May 2011 09:44:04 +0200 Message-ID: <84ADCA5E-43CF-4E35-B7F2-77CC63BE8C92@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGnnf-00020t-MW for emacs-orgmode@gnu.org; Mon, 02 May 2011 03:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGnne-0002xz-Qs for emacs-orgmode@gnu.org; Mon, 02 May 2011 03:44:11 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:42729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGnne-0002xv-Lt for emacs-orgmode@gnu.org; Mon, 02 May 2011 03:44:10 -0400 Received: by ewy9 with SMTP id 9so1880029ewy.0 for ; Mon, 02 May 2011 00:44:09 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Paul Sexton Cc: emacs-orgmode@gnu.org Hi Paul, I think this patch is buggy, if only because it introduces an extra closing parenthesis. I have applied a different version - please verify that it does behave as intended. - Carsten On Apr 22, 2011, at 5:11 AM, Paul Sexton wrote: > 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) > > > - Carsten