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:20:35 -0500 Message-ID: <87fv38g127.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTtdn-0005jx-Vj for emacs-orgmode@gnu.org; Mon, 24 Aug 2015 11:26:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTtdi-0001T9-UW for emacs-orgmode@gnu.org; Mon, 24 Aug 2015 11:26:31 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTtdi-0001Sh-Oa for emacs-orgmode@gnu.org; Mon, 24 Aug 2015 11:26:26 -0400 Received: from archdesk (wcnat-96-123.wheaton.edu [209.147.96.123]) by mail.messagingengine.com (Postfix) with ESMTPA id CE810C00021 for ; Mon, 24 Aug 2015 11:26:24 -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 * 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