emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Bug fix: delete indirect buffer's window only when it exists.
@ 2013-01-21 17:21 Muchenxuan Tong
  2013-01-21 18:18 ` Achim Gratz
  0 siblings, 1 reply; 5+ messages in thread
From: Muchenxuan Tong @ 2013-01-21 17:21 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bug fix: delete indirect buffer's window only when it exists.
  2013-01-21 17:21 [PATCH] Bug fix: delete indirect buffer's window only when it exists Muchenxuan Tong
@ 2013-01-21 18:18 ` Achim Gratz
  2013-01-22  7:42   ` Muchenxuan Tong
  0 siblings, 1 reply; 5+ messages in thread
From: Achim Gratz @ 2013-01-21 18:18 UTC (permalink / raw)
  To: emacs-orgmode

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.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bug fix: delete indirect buffer's window only when it exists.
  2013-01-21 18:18 ` Achim Gratz
@ 2013-01-22  7:42   ` Muchenxuan Tong
  2013-01-22 13:25     ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Muchenxuan Tong @ 2013-01-22  7:42 UTC (permalink / raw)
  To: emacs-orgmode

Achim Gratz <Stromeko <at> 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bug fix: delete indirect buffer's window only when it exists.
  2013-01-22  7:42   ` Muchenxuan Tong
@ 2013-01-22 13:25     ` Bastien
  2013-01-22 13:31       ` Muchenxuan Tong
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2013-01-22 13:25 UTC (permalink / raw)
  To: Muchenxuan Tong; +Cc: emacs-orgmode

Hi Muchenxuan,

Muchenxuan Tong <demon386@gmail.com> writes:

> 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:

I've applied the patch.  Please do not insert patches in the body of
the message, attach them.  Also, you can use git format-patch to send
them, it's easier for me to apply.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Bug fix: delete indirect buffer's window only when it exists.
  2013-01-22 13:25     ` Bastien
@ 2013-01-22 13:31       ` Muchenxuan Tong
  0 siblings, 0 replies; 5+ messages in thread
From: Muchenxuan Tong @ 2013-01-22 13:31 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Ok. Thanks.

On 22 Jan 2013, at 21:25, Bastien wrote:

> Hi Muchenxuan,
>
> Muchenxuan Tong <demon386@gmail.com> writes:
>
>> 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:
>
> I've applied the patch.  Please do not insert patches in the body of
> the message, attach them.  Also, you can use git format-patch to send
> them, it's easier for me to apply.
>
> Thanks,
>
> --
> Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-22 13:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-21 17:21 [PATCH] Bug fix: delete indirect buffer's window only when it exists Muchenxuan Tong
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

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