diff options
author | Bernt Hansen <bernt@norang.ca> | 2011-12-30 15:49:09 +0000 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2011-12-31 09:10:36 +0100 |
commit | 31d003ad28a747e63935b45396d2995933514c5b (patch) | |
tree | c59c564a1794ea32d558508ea34ec15e8c7e67ab | |
parent | fc1f01c54e5f9018374c15f11cf7b25c37996dd6 (diff) | |
download | org-mode-31d003ad28a747e63935b45396d2995933514c5b.tar.gz |
Honour existing restrictions when visiting tasks from the agenda
* lisp/org-agenda.el (org-agenda-switch-to): Widen org buffer only if point is
outside the current restriction
Widen org buffer when visiting from agenda only if point is outside
current restriction.
Visiting a task with RET or TAB in the agenda should not affect the
org-mode buffer restriction unless the target task is not currently
visible due to the restriction.
-rw-r--r-- | lisp/org-agenda.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index f240f5e..b009faf 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7033,7 +7033,9 @@ at the text of the entry itself." (pos (marker-position marker))) (org-pop-to-buffer-same-window buffer) (and delete-other-windows (delete-other-windows)) - (widen) + (when (or (< pos (point-min)) + (> pos (point-max))) + (widen)) (goto-char pos) (when (eq major-mode 'org-mode) (org-show-context 'agenda) |