emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 3/3] Honour existing restrictions when visiting tasks from th


From: Bernt Hansen
Subject: [O] [PATCH 3/3] Honour existing restrictions when visiting tasks from the agenda
Date: Fri, 30 Dec 2011 05:49:09 -0500

* 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.
---
 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)
-- 
1.7.8.247.g10f4e




reply via email to

[Prev in Thread] Current Thread [Next in Thread]