From 38703eace6062ec4e4ccdf1912a641b266efbf61 Mon Sep 17 00:00:00 2001 From: Cheong Yiu Fung Date: Fri, 16 Apr 2021 18:35:17 +0800 Subject: [PATCH] org.el (org-show-context-detail): add option 'ancestors-with-entry * lisp/org.el: Add option 'ancestors-with-entry to `org-show-context-detail', which shows current headline, entry, and its direct ancestors. --- lisp/org.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 675a614e2..0e625d9ed 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1240,6 +1240,7 @@ more context." (const minimal) (const local) (const ancestors) + (const ancestors-with-entry) (const lineage) (const tree) (const canonical)))))) @@ -6763,7 +6764,7 @@ DETAIL is either nil, `minimal', `local', `ancestors', `lineage', information." ;; Show current heading and possibly its entry, following headline ;; or all children. - (if (and (org-at-heading-p) (not (eq detail 'local))) + (if (and (org-at-heading-p) (not (memq detail '(local ancestors-with-entry)))) (org-flag-heading nil) (org-show-entry) ;; If point is hidden within a drawer or a block, make sure to @@ -6775,14 +6776,14 @@ information." (org-with-limited-levels (cl-case detail ((tree canonical t) (org-show-children)) - ((nil minimal ancestors)) + ((nil minimal ancestors ancestors-with-entry)) (t (save-excursion (outline-next-heading) (org-flag-heading nil))))))) ;; Show all siblings. (when (eq detail 'lineage) (org-show-siblings)) ;; Show ancestors, possibly with their children. - (when (memq detail '(ancestors lineage tree canonical t)) + (when (memq detail '(ancestors ancestors-with-entry lineage tree canonical t)) (save-excursion (while (org-up-heading-safe) (org-flag-heading nil) -- 2.31.0