emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Showing hidden subtree automatically if point is hidden when the buffer is opened
@ 2009-07-27 14:00 User
  2009-07-27 20:45 ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: User @ 2009-07-27 14:00 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-07-29  5:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 14:00 Showing hidden subtree automatically if point is hidden when the buffer is opened User
2009-07-27 20:45 ` Bastien
2009-07-28  4:19   ` User
2009-07-28 11:59     ` Bastien
2009-07-28 18:27       ` Bastien
2009-07-28 18:46         ` User
     [not found]           ` <8035.1248807278@alphaville.usa.hp.com>
     [not found]             ` <9cf79dfd0907281208r7e43fdfbn17af4d9e521e6fc8@mail.gmail.com>
2009-07-28 19:18               ` Nick Dokos
2009-07-29  5:41           ` Bastien

Code repositories for project(s) associated with this public 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).