diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-08-07 02:07:43 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-08-07 02:13:06 +0200 |
commit | 134d5983ecffc968820336a758b20dee96980b72 (patch) | |
tree | 235d594e794ec8a63179b9501c00e02527ba7bcc | |
parent | 570b1935e7db9913a2eb9084b6f1adc0d07a36cc (diff) | |
download | org-mode-134d5983ecffc968820336a758b20dee96980b72.tar.gz |
Fix visibility when switching from agenda to item
* lisp/org-agenda.el (org-agenda-switch-to): Do not hardcode visibility
set-up when switching to item relative to current agenda line.
Instead let `org-show-context' handle it. Improve docstring.
Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99616>
-rw-r--r-- | lisp/org-agenda.el | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 4cd68d4..7b48838 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8593,7 +8593,9 @@ It also looks at the text of the entry itself." (symbol-value var)))))) (defun org-agenda-switch-to (&optional delete-other-windows) - "Go to the Org-mode file which contains the item at point." + "Go to the Org mode file which contains the item at point. +When optional argument DELETE-OTHER-WINDOWS is non-nil, the +displayed Org file fills the frame." (interactive) (if (and org-return-follows-link (not (org-get-at-bol 'org-marker)) @@ -8605,17 +8607,11 @@ It also looks at the text of the entry itself." (pos (marker-position marker))) (unless buffer (user-error "Trying to switch to non-existent buffer")) (org-pop-to-buffer-same-window buffer) - (and delete-other-windows (delete-other-windows)) + (when delete-other-windows (delete-other-windows)) (widen) (goto-char pos) - (org-back-to-heading t) (when (derived-mode-p 'org-mode) (org-show-context 'agenda) - (save-excursion - (and (outline-next-heading) - (org-flag-heading nil))) ; show the next heading - (when (outline-invisible-p) - (show-entry)) ; display invisible text (run-hooks 'org-agenda-after-show-hook))))) (defun org-agenda-goto-mouse (ev) |