From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muchenxuan Tong Subject: Re: [PATCH] Bug fix: delete indirect buffer's window only when it exists. Date: Tue, 22 Jan 2013 07:42:26 +0000 (UTC) Message-ID: References: <87a9s2l7r3.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxYXK-0001mq-MM for emacs-orgmode@gnu.org; Tue, 22 Jan 2013 02:44:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxYXJ-00030i-I3 for emacs-orgmode@gnu.org; Tue, 22 Jan 2013 02:44:50 -0500 Received: from plane.gmane.org ([80.91.229.3]:46050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxYXJ-00030d-BD for emacs-orgmode@gnu.org; Tue, 22 Jan 2013 02:44:49 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TxYXY-0001DE-0b for emacs-orgmode@gnu.org; Tue, 22 Jan 2013 08:45:04 +0100 Received: from 59.77.17.39 ([59.77.17.39]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Jan 2013 08:45:04 +0100 Received: from demon386 by 59.77.17.39 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Jan 2013 08:45:04 +0100 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: emacs-orgmode@gnu.org Achim Gratz nexgo.de> writes: > > Muchenxuan Tong writes: > > 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. > > Introduces a new bug: when-let is not defined in GNU Emacs. > > Regards, > Achim. Thanks for pointing out. It's my fault, when-let is defined in slime.el and not the Emacs core library. The following patch should be OK: ---- 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. TINYCHANGE diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index f48ff6f..8b9ae81 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6989,7 +6989,10 @@ When `org-agenda-sticky' is non-nil, only bury the agenda." (interactive) (if (and (eq org-indirect-buffer-display 'other-window) org-last-indirect-buffer) - (delete-window (get-buffer-window org-last-indirect-buffer))) + (let ((org-last-indirect-window + (get-buffer-window org-last-indirect-buffer))) + (if org-last-indirect-window + (delete-window org-last-indirect-window)))) (if org-agenda-columns-active (org-columns-quit) (if org-agenda-sticky