From: Matthew Lundin <mdl@imapmail.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Fix bug that erases org buffer when calling agenda via org-agenda-open-link.
Date: Thu, 16 Sep 2010 01:29:20 -0400 [thread overview]
Message-ID: <87wrqm2r4f.fsf@archdesk.localdomain> (raw)
In-Reply-To: <87d3se9v6m.fsf@archdesk.localdomain> (Matt Lundin's message of "Thu, 16 Sep 2010 00:15:49 -0400")
[My apologies, but I'm afraid my first attempt at this patch mistook a
necessary second check for redundancy. Here is an improved version.]
* lisp/org-agenda.el (org-prepare-agenda): If the agenda is called
from within the agenda via an elisp link, such as
[[elisp:(org-agenda-list)]], org-prepare-agenda erases the buffer of
the file containing the link, since that buffer is current during
org-prepare agenda (due to a with-current-buffer in
org-agenda-open-link). An additional test now ensures that the
agenda buffer is in fact current when the buffer is erased and local
variables for the agenda are set.
---
lisp/org-agenda.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9f94fa6..7458076 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2829,7 +2829,11 @@ the global options and expect it to be applied to the entire view.")
(switch-to-buffer-other-frame abuf))
((equal org-agenda-window-setup 'reorganize-frame)
(delete-other-windows)
- (org-switch-to-buffer-other-window abuf))))
+ (org-switch-to-buffer-other-window abuf)))
+ ;; additional test in case agenda is invoked from within agenda
+ ;; buffer via elisp link
+ (unless (equal (current-buffer) abuf)
+ (switch-to-buffer abuf)))
(setq buffer-read-only nil)
(let ((inhibit-read-only t)) (erase-buffer))
(org-agenda-mode)
--
1.7.2.3
prev parent reply other threads:[~2010-09-16 5:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-16 4:15 [PATCH] Fix bug that erases org buffer when calling agenda via org-agenda-open-link Matt Lundin
2010-09-16 5:29 ` Matthew Lundin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wrqm2r4f.fsf@archdesk.localdomain \
--to=mdl@imapmail.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).