diff options
author | Noorul Islam <noorul@noorul.com> | 2010-08-07 11:04:18 +0000 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-08-08 08:43:00 +0200 |
commit | 383802d063a9f2dd959d5574b226fa8ec7f8be41 (patch) | |
tree | c48b4743ae1f54d49c7279c96d917173ac218e24 | |
parent | b8a0692f93eeb57298392fcda6ac25f5705ac309 (diff) | |
download | org-mode-383802d063a9f2dd959d5574b226fa8ec7f8be41.tar.gz |
Fix :VISIBILITY: handling of nested "folded" properties
On Fri, Jul 30, 2010 at 4:38 PM, Rainer Stengele
<rainer.stengele@online.de>wrote:
> Having
>
> * headline 1
> :PROPERTIES:
> :VISIBILITY: folded
> :END:
> ** headline 2.1
> - stuff
> ** headline 2.1
> :PROPERTIES:
> :VISIBILITY: folded
> :END:
> - stuff
>
> C-u C-u <TAB>
> Switch back to the startup visibility of the buffer, i.e. whatever is
> requested by startup options and VISIBILITY properties in individual
> entries.
>
>
> does not result in
>
>
> * headline 1...>
>
>
> as expected. Instead I get:
>
>
> * headline 1...>
> ** headline 2.1...>
> ** headline 2.1...>
>
>
> removing the second folded propertiy results correctly in:
>
> * headline 1...>
>
>
> This looks like a bug in the :VISIBILITY: handling!?
>
>
>
I am not sure whether this is a bug. But it looks like the above scenario
was not considered initially. I might be wrong.
The attached patch seems to solve this problem.
* lisp/org.el: org-set-visibility-according-to-property ()
Use backward search instead of forward, so that top hierarchy gets
priority.
Thanks and Regards
Noorul
-rw-r--r-- | lisp/org.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 6038428..9a86293 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5981,8 +5981,8 @@ With a numeric prefix, show all headlines up to that level." (interactive) (let (org-show-entry-below state) (save-excursion - (goto-char (point-min)) - (while (re-search-forward + (goto-char (point-max)) + (while (re-search-backward "^[ \t]*:VISIBILITY:[ \t]+\\([a-z]+\\)" nil t) (setq state (match-string 1)) |