emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Muchenxuan Tong <demon386@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Bug fix: delete indirect buffer's window only when it exists.
Date: Tue, 22 Jan 2013 01:21:44 +0800	[thread overview]
Message-ID: <CANvjMg=EBtgUb8XLJLs3ePN7K3nmNcKeypz2VgSA4bo3kaWeFQ@mail.gmail.com> (raw)

Bug fix: delete indirect buffer's window only when it exists.
* org-agenda.el (org-agenda-quit): Delete indirect buffer's window
only when it exists.

When indirect buffer's window doesn't exist, the original logic will
delete the current window.


diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f48ff6f..530e79a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6989,7 +6989,9 @@ When `org-agenda-sticky' is non-nil, only bury
the agenda."
   (if (and (eq org-indirect-buffer-display 'other-window)
-      (delete-window (get-buffer-window org-last-indirect-buffer)))
+      (when-let (org-last-indirect-window
+ (get-buffer-window org-last-indirect-buffer))
+ (delete-window org-last-indirect-window)))
   (if org-agenda-columns-active
     (if org-agenda-sticky

             reply	other threads:[~2013-01-21 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 17:21 Muchenxuan Tong [this message]
2013-01-21 18:18 ` Achim Gratz
2013-01-22  7:42   ` Muchenxuan Tong
2013-01-22 13:25     ` Bastien
2013-01-22 13:31       ` Muchenxuan Tong

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:

  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='CANvjMg=EBtgUb8XLJLs3ePN7K3nmNcKeypz2VgSA4bo3kaWeFQ@mail.gmail.com' \
    --to=demon386@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] Bug fix: delete indirect buffer'\''s window only when it exists.' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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).