summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-02-19 09:42:09 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2010-02-19 09:43:53 +0100
commit829ed41161ed3e2f04915dd32a4beb88f1f9cfb9 (patch)
treea76832aff29f8d354436a10e6eef6f63aae5609b
parent8d6aa8f3df39ed15a0c825f4a20a3bc1250bed4d (diff)
downloadorg-mode-829ed41161ed3e2f04915dd32a4beb88f1f9cfb9.tar.gz
Org-reveal: Double prefix arg show the entire subtree of the parent
This can help to get out of an inconsistent state produce for example by viewing from the agenda. Reported by Matt Lundin: > I'd like to report a minor issue with org-agenda-goto and inline tasks. > Let's say one has the following file: > > --8<---------------cut here---------------start------------->8--- > * Here is an entry. > Blah blah blah blah. > *************** Here is an inline task. > *************** END > Blah blah blah blah blah. > *************** TODO Here is a second inline task. > *************** END > Blah blah blah blah blah. > *************** Here is a third inline task > *************** END > Blah blah blah blah blah. > --8<---------------cut here---------------end--------------->8--- > > Let's say one also has the following settings: > > --8<---------------cut here---------------start------------->8--- > (setq org-show-hierarchy-above t) > (setq org-show-siblings '((default . nil) (isearch . t) (agenda . t))) > (setq org-show-entry-below '((default . nil) (isearch . t) (agenda . t))) > --8<---------------cut here---------------end--------------->8--- > > If 1) one tries to jump to the TODO from the agenda and 2) the entry is > currently folded, org-show-context reveals only the headlines. E.g., > > --8<---------------cut here---------------start------------->8--- > * Here is an entry. > *************** Here is an inline task. > *************** END... > *************** TODO Here is a second inline task. > *************** END... > *************** Here is a third inline task > *************** END... > --8<---------------cut here---------------end--------------->8--- > > Invoking org-cycle on the END headline does nothing, since all headlines > deeper than org-inlinetask-min-level are exempted from cycling. As a > result, the only way to reveal the text in the entry is to cycle the > parent twice (first to close, then to reveal).
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/org.texi3
-rwxr-xr-xlisp/ChangeLog5
-rw-r--r--lisp/org.el11
4 files changed, 21 insertions, 3 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 9c96e20..a4938fe 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-19 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.texi (Visibility cycling): Document the new double prefix
+ arg for `org-reveal'.
+
2010-02-04 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Cooperation): Remember.el is part of Emacs.
diff --git a/doc/org.texi b/doc/org.texi
index ec9be91..dd7dfdd 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -877,7 +877,8 @@ Reveal context around point, showing the current entry, the following heading
and the hierarchy above. Useful for working near a location that has been
exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
(@pxref{Agenda commands}). With a prefix argument show, on each
-level, all sibling headings.
+level, all sibling headings. With double prefix arg, also show the entire
+subtree of the parent.
@kindex C-c C-x b
@item C-c C-x b
Show the current subtree in an indirect buffer@footnote{The indirect
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4d4dfcc..4fa57b3 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-19 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-reveal): Double prefix arg shows the subtree of the
+ parent.
+
2010-02-17 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-search-view): Fix bug with searching full
diff --git a/lisp/org.el b/lisp/org.el
index b888833..e5b2f56 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11209,12 +11209,19 @@ not t for the search context.
With optional argument SIBLINGS, on each level of the hierarchy all
siblings are shown. This repairs the tree structure to what it would
-look like when opened with hierarchical calls to `org-cycle'."
+look like when opened with hierarchical calls to `org-cycle'.
+With double optional argument `C-u C-u', go to the parent and show the
+entire tree."
(interactive "P")
(let ((org-show-hierarchy-above t)
(org-show-following-heading t)
(org-show-siblings (if siblings t org-show-siblings)))
- (org-show-context nil)))
+ (org-show-context nil))
+ (when (equal siblings '(16))
+ (save-excursion
+ (when (org-up-heading-safe)
+ (org-show-subtree)
+ (run-hook-with-args 'org-cycle-hook 'subtree)))))
(defun org-highlight-new-match (beg end)
"Highlight from BEG to END and mark the highlight is an occur headline."