summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-06-21 20:13:11 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-06-21 20:25:03 +0200
commitfbd138f5270022c42c4e165ed42674b2decf2acc (patch)
tree3b70c8efa5d6c6cf513f3b3626dfe7478466971e
parent9b7191001cfa6feca6d1325fd2f3844218dc9226 (diff)
downloadorg-mode-fbd138f5270022c42c4e165ed42674b2decf2acc.tar.gz
org-agenda: Fix SPC in agenda
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Properly display drawers when SPC is pressed. Hide them again with a universal prefix argument. Reported-by: Bernt Hansen <bernt@norang.ca> <http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00254.html>
-rw-r--r--lisp/org-agenda.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 24b7524..6636a2a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8669,9 +8669,8 @@ if it was hidden in the outline."
When called repeatedly, scroll the window that is displaying the buffer.
-With a `\\[universal-argument]' prefix, use `org-show-entry' instead of \
-`outline-show-subtree'
-to display the item, so that drawers and logbooks stay folded."
+With a `\\[universal-argument]' prefix argument, display the item, but \
+fold drawers."
(interactive "P")
(let ((win (selected-window)))
(if (and (window-live-p org-agenda-show-window)
@@ -8680,7 +8679,13 @@ to display the item, so that drawers and logbooks stay folded."
(select-window org-agenda-show-window)
(ignore-errors (scroll-up)))
(org-agenda-goto t)
- (if arg (org-show-entry) (outline-show-subtree))
+ (org-show-entry)
+ (if arg (org-cycle-hide-drawers 'children)
+ (org-with-wide-buffer
+ (narrow-to-region (org-entry-beginning-position)
+ (org-entry-end-position))
+ (org-show-all '(drawers))))
+ (when arg )
(setq org-agenda-show-window (selected-window)))
(select-window win)))