From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Sexton Subject: [patch] make 'org-save-outline-visibility' return a useful value Date: Fri, 22 Apr 2011 03:11:45 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD6ml-00086y-IA for emacs-orgmode@gnu.org; Thu, 21 Apr 2011 23:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QD6mk-0006QG-KJ for emacs-orgmode@gnu.org; Thu, 21 Apr 2011 23:11:59 -0400 Received: from lo.gmane.org ([80.91.229.12]:57720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QD6mk-0006QA-Dx for emacs-orgmode@gnu.org; Thu, 21 Apr 2011 23:11:58 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QD6mh-0007M4-Sr for emacs-orgmode@gnu.org; Fri, 22 Apr 2011 05:11:56 +0200 Received: from ip-118-90-34-236.xdsl.xnet.co.nz ([118.90.34.236]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Apr 2011 05:11:55 +0200 Received: from psexton by ip-118-90-34-236.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Apr 2011 05:11:55 +0200 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: emacs-orgmode@gnu.org 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)