瀏覽代碼

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.
Bernt Hansen 13 年之前
父節點
當前提交
8f93a75cac
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lisp/org-agenda.el

+ 3 - 1
lisp/org-agenda.el

@@ -7113,7 +7113,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)