From: Noorul Islam <noorul@noorul.com>
To: Rainer Stengele <rainer.stengele@online.de>
Cc: emacs-orgmode@gnu.org
Subject: [PATCH] Re: bug in the :VISIBILITY: handling of nested "folded" properties?
Date: Sat, 7 Aug 2010 11:34:18 +0530 [thread overview]
Message-ID: <AANLkTimaO1XipTwBWPP-uay5yLJ2CS7TAeF-dD6BUs9u@mail.gmail.com> (raw)
In-Reply-To: <i2uboe$9m2$1@dough.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1129 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 1620 bytes --]
[-- Attachment #2: org-visibility.txt --]
[-- Type: text/plain, Size: 487 bytes --]
diff --git a/lisp/org.el b/lisp/org.el
index 19b28a3..c8409b5 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5962,8 +5962,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))
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2010-08-07 6:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-30 11:08 bug in the :VISIBILITY: handling of nested "folded" properties? Rainer Stengele
2010-08-07 6:04 ` Noorul Islam [this message]
2010-08-07 7:28 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimaO1XipTwBWPP-uay5yLJ2CS7TAeF-dD6BUs9u@mail.gmail.com \
--to=noorul@noorul.com \
--cc=emacs-orgmode@gnu.org \
--cc=rainer.stengele@online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.