* [PATCH] Fix agenda follow mode to work with included diary
@ 2015-08-24 15:20 Matt Lundin
0 siblings, 0 replies; 3+ messages in thread
From: Matt Lundin @ 2015-08-24 15:20 UTC (permalink / raw)
To: Org Mode
* lisp/org-agenda.el (org-agenda-goto): Fix org-agenda-goto 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).
---
lisp/org-agenda.el | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 5fd1cd4..0698ddf 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)))))
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Fix agenda follow mode to work with included diary
@ 2015-08-24 15:31 Matt Lundin
2015-08-24 20:51 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: Matt Lundin @ 2015-08-24 15:31 UTC (permalink / raw)
To: Org Mode
[-- Attachment #1: Type: text/plain, Size: 316 bytes --]
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.
This patch should fix the issue.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-follow-mode.patch --]
[-- Type: text/x-diff, Size: 1600 bytes --]
From: Matt Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Fix agenda follow mode to work with included diary
Date: Mon, 24 Aug 2015 10:20:35 -0500
Gcc: nnml:list.orgmode
* lisp/org-agenda.el (org-agenda-goto): Fix org-agenda-goto 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).
---
lisp/org-agenda.el | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 5fd1cd4..0698ddf 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)))))
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix agenda follow mode to work with included diary
2015-08-24 15:31 Matt Lundin
@ 2015-08-24 20:51 ` Nicolas Goaziou
0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2015-08-24 20:51 UTC (permalink / raw)
To: Matt Lundin; +Cc: Org Mode
Hello,
Matt Lundin <mdl@imapmail.org> writes:
> 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.
> This patch should fix the issue.
Applied. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-24 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 15:20 [PATCH] Fix agenda follow mode to work with included diary Matt Lundin
-- strict thread matches above, loose matches on Subject: below --
2015-08-24 15:31 Matt Lundin
2015-08-24 20:51 ` Nicolas Goaziou
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).