summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Abrahams <dave@boostpro.com>2011-09-24 15:21:53 -0400
committerCarsten Dominik <carsten.dominik@gmail.com>2011-10-08 09:01:50 +0200
commite53f62eba9569b78540481bda4b5e7a6b4016983 (patch)
treea15f7abbc7eacbbbc19a4548777802344769e84a
parent1790d6c07378f4e2c900dd1cfe70c09d51ba2b6c (diff)
downloadorg-mode-e53f62eba9569b78540481bda4b5e7a6b4016983.tar.gz
Add indirect agenda follow mode
* lisp/org-agenda.el (org-agenda-follow-indirect): New option. (org-agenda-follow-mode): Call `org-agenda-do-context-action' fro follow mode. (org-agenda-do-context-action): Also do indirect follow mode action. By setting `org-agenda-follow-indirect' to a non-nil value, `org-agenda-follow-mode' will use an indirect buffer to display only the current item, rather than the whole agenda file in which it lives
-rw-r--r--lisp/org-agenda.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 8186ff4..e4b1ba5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -872,6 +872,12 @@ Needs to be set before org.el is loaded."
:group 'org-agenda-startup
:type 'boolean)
+(defcustom org-agenda-follow-indirect nil
+ "Non-nil means `org-agenda-follow-mode' displays only the
+current item's tree, in an indirect buffer."
+ :group 'org-agenda
+ :type 'boolean)
+
(defcustom org-agenda-show-outline-path t
"Non-nil means show outline path in echo area after line motion."
:group 'org-agenda-startup
@@ -6615,8 +6621,7 @@ so that the date SD will be in that range."
(interactive)
(setq org-agenda-follow-mode (not org-agenda-follow-mode))
(org-agenda-set-mode-name)
- (if (and org-agenda-follow-mode (org-get-at-bol 'org-marker))
- (org-agenda-show))
+ (org-agenda-do-context-action)
(message "Follow mode is %s"
(if org-agenda-follow-mode "on" "off")))
@@ -6778,7 +6783,9 @@ When called with a prefix argument, include all archive files as well."
"Show outline path and, maybe, follow mode window."
(let ((m (org-get-at-bol 'org-marker)))
(if (and org-agenda-follow-mode m)
- (org-agenda-show))
+ (if org-agenda-follow-indirect
+ (org-agenda-tree-to-indirect-buffer)
+ (org-agenda-show)))
(if (and m org-agenda-show-outline-path)
(org-with-point-at m
(org-display-outline-path t)))))