[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Showing hidden subtree automatically if point is hidden wh
From: |
Bastien |
Subject: |
Re: [Orgmode] Showing hidden subtree automatically if point is hidden when the buffer is opened |
Date: |
Tue, 28 Jul 2009 04:45:55 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
User <address@hidden> writes:
> 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.
I added this entry on org-hacks.org (Worg):
Fix a problem with saveplace.el putting you back in a folded position:
#+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.
--
Bastien