From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muchenxuan Tong Subject: [PATCH] Bug fix: delete indirect buffer's window only when it exists. Date: Tue, 22 Jan 2013 01:21:44 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxL49-0004v9-Fv for emacs-orgmode@gnu.org; Mon, 21 Jan 2013 12:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxL46-0003ZK-RI for emacs-orgmode@gnu.org; Mon, 21 Jan 2013 12:21:49 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:36326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxL46-0003ZC-Jd for emacs-orgmode@gnu.org; Mon, 21 Jan 2013 12:21:46 -0500 Received: by mail-lb0-f174.google.com with SMTP id l12so80161lbo.5 for ; Mon, 21 Jan 2013 09:21:45 -0800 (PST) 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 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..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." (interactive) (if (and (eq org-indirect-buffer-display 'other-window) org-last-indirect-buffer) - (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 (org-columns-quit) (if org-agenda-sticky