summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Lundin <mdl@imapmail.org>2015-08-24 10:31:49 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-24 22:49:11 +0200
commit06966b940377943d85dff55a602adce2909bd02b (patch)
treea94ed2974662ff1afb697f94af5e25725a6b9798
parent0b524dd82c845ef64045529570926eb73b72145a (diff)
downloadorg-mode-06966b940377943d85dff55a602adce2909bd02b.tar.gz
Fix agenda follow mode to work with included diary
* lisp/org-agenda.el (org-agenda-goto): Fix function to work with non-Org buffers. Otherwise `org-agenda-follow-mode' does not work correctly with included diary entries (e.g., it errors out while the cursor is still in the diary buffer). Follow mode does not work with diary entries in the agenda. It calls `org-agenda-goto', which expects to be in an Org mode buffer but does not test to make sure that it is in an Org buffer. As a result, it errors out midway through and leaves the cursor stranded in the diary buffer.
-rw-r--r--lisp/org-agenda.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 061ea36..0d56235 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8391,13 +8391,13 @@ When called with a prefix argument, include all archive files as well."
(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
- (recenter (/ (window-height) 2))
- (org-back-to-heading t)
- (if (re-search-forward org-complex-heading-regexp nil t)
- (goto-char (match-beginning 4)))
+ (org-flag-heading nil))) ; show the next heading
+ (when (outline-invisible-p)
+ (show-entry)) ; display invisible text
+ (recenter (/ (window-height) 2))
+ (org-back-to-heading t)
+ (if (re-search-forward org-complex-heading-regexp nil t)
+ (goto-char (match-beginning 4))))
(run-hooks 'org-agenda-after-show-hook)
(and highlight (org-highlight (point-at-bol) (point-at-eol)))))