Browse Source

org-agenda.el: Allow `C-u' to display the item without unfolding drawers and logbooks.

* org-agenda.el (org-agenda-show-and-scroll-up): Allow `C-u'
to display the item without unfolding drawers and logbooks.
Bastien Guerry 8 years ago
parent
commit
c74fe88c01
1 changed files with 7 additions and 4 deletions
  1. 7 4
      lisp/org-agenda.el

+ 7 - 4
lisp/org-agenda.el

@@ -7142,10 +7142,13 @@ if it was hidden in the outline."
     (select-window win)))
 
 (defvar org-agenda-show-window nil)
-(defun org-agenda-show-and-scroll-up ()
+(defun org-agenda-show-and-scroll-up (&optional arg)
   "Display the Org-mode file which contains the item at point.
-When called repeatedly, scroll the window that is displaying the buffer."
-  (interactive)
+When called repeatedly, scroll the window that is displaying the buffer.
+With a \\[universal-argument] prefix, use `org-show-entry' instead of
+`show-subtree' to display the item, so that drawers and logbooks stay
+folded."
+  (interactive "P")
   (let ((win (selected-window)))
     (if (and (window-live-p org-agenda-show-window)
 	     (eq this-command last-command))
@@ -7153,7 +7156,7 @@ When called repeatedly, scroll the window that is displaying the buffer."
 	  (select-window org-agenda-show-window)
 	  (ignore-errors (scroll-up)))
       (org-agenda-goto t)
-      (show-subtree)
+      (if arg (org-show-entry) (show-subtree))
       (setq org-agenda-show-window (selected-window)))
     (select-window win)))