From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Fix agenda follow mode to work with included diary Date: Mon, 24 Aug 2015 10:31:49 -0500 Message-ID: <87oahwg0t6.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTtj1-0005sy-Im for emacs-orgmode@gnu.org; Mon, 24 Aug 2015 11:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTtiw-0003f4-GM for emacs-orgmode@gnu.org; Mon, 24 Aug 2015 11:31:55 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTtiw-0003et-87 for emacs-orgmode@gnu.org; Mon, 24 Aug 2015 11:31:50 -0400 Received: from archdesk (wcnat-96-123.wheaton.edu [209.147.96.123]) by mail.messagingengine.com (Postfix) with ESMTPA id 77D296800FD for ; Mon, 24 Aug 2015 11:31:49 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=fix-follow-mode.patch From: Matt Lundin To: Org Mode 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 --=-=-=--