From mboxrd@z Thu Jan 1 00:00:00 1970 From: User Subject: Re: Showing hidden subtree automatically if point is hidden when the buffer is opened Date: Tue, 28 Jul 2009 04:19:33 +0000 (UTC) Message-ID: References: <878wi9agq8.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVeAP-0001FA-Fe for emacs-orgmode@gnu.org; Tue, 28 Jul 2009 00:19:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVeAL-0001Ep-9d for emacs-orgmode@gnu.org; Tue, 28 Jul 2009 00:19:56 -0400 Received: from [199.232.76.173] (port=54934 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVeAJ-0001Em-W2 for emacs-orgmode@gnu.org; Tue, 28 Jul 2009 00:19:52 -0400 Received: from main.gmane.org ([80.91.229.2]:45941 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVeAJ-0004n8-J0 for emacs-orgmode@gnu.org; Tue, 28 Jul 2009 00:19:51 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MVeAE-00079J-4v for emacs-orgmode@gnu.org; Tue, 28 Jul 2009 04:19:46 +0000 Received: from dsl51B61250.pool.t-online.hu ([81.182.18.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Jul 2009 04:19:46 +0000 Received: from spamfilteraccount by dsl51B61250.pool.t-online.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Jul 2009 04:19:46 +0000 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 Bastien googlemail.com> writes: > > #+begin_src emacs-lisp > (add-hook 'org-mode-hook > (lambda () > (when (outline-invisible-p) > (save-excursion > (outline-previous-visible-heading 1) > (org-show-subtree))))) > #+end_src > > Note that I removed the timer - no sure why it was useful. Feel free to > modify this hack the way you want on Worg. > I added the timer, because I didn't know in which order the hooks are run. If org-mode hook runs first and then saveplace's hook which restores point then the above code has no effect. The null timer guarantees the code runs when all the hooks are executed.