From mboxrd@z Thu Jan 1 00:00:00 1970 From: User Subject: Showing hidden subtree automatically if point is hidden when the buffer is opened Date: Mon, 27 Jul 2009 14:00:07 +0000 (UTC) Message-ID: 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 1MVQkg-0004Gw-LO for emacs-orgmode@gnu.org; Mon, 27 Jul 2009 10:00:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVQkc-0004Ds-Q8 for emacs-orgmode@gnu.org; Mon, 27 Jul 2009 10:00:30 -0400 Received: from [199.232.76.173] (port=35557 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVQkc-0004Dc-Hw for emacs-orgmode@gnu.org; Mon, 27 Jul 2009 10:00:26 -0400 Received: from main.gmane.org ([80.91.229.2]:36123 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 1MVQkb-0005SY-91 for emacs-orgmode@gnu.org; Mon, 27 Jul 2009 10:00:25 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MVQkU-0004DR-TP for emacs-orgmode@gnu.org; Mon, 27 Jul 2009 14:00:21 +0000 Received: from dsl51B792D2.pool.t-online.hu ([81.183.146.210]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jul 2009 14:00:18 +0000 Received: from spamfilteraccount by dsl51B792D2.pool.t-online.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jul 2009 14:00:18 +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 I use folded view by default, but I also use saveplace.el, because it's nice to continue from the point I left off in the buffer, instead of navigating there again manually. The problem is the restored point can be in an automatically folded section when the buffer is opened, so I added this little code to my org-mode hook which opens the subtree automatically if point is hidden: (run-with-idle-timer 0 nil (lambda () (when (outline-invisible-p) (save-excursion (outline-previous-visible-heading 1) (org-show-subtree))))) I haven't seen an option for this in org, so I post the code here if someone has a similar problem.