* bug#21187: erc-kill-channel-hook sometimes is not run during /QUIT
@ 2015-08-04 17:56 Fran Litterio
2015-12-27 7:57 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Fran Litterio @ 2015-08-04 17:56 UTC (permalink / raw)
To: 21187
Using Emacs built from the latest sources, when variable
erc-kill-queries-on-quit is t (which causes ERC to kill channel
buffers when quitting -- yes, the name is misleading), a /QUIT
does not run the hooks on erc-kill-channel-hook, because
erc-default-target returns nil due to the server being
disconnected.
This patch fixes that by falling back to examining the buffer
name, which should be safe to do since we know the major mode is
erc-mode.
--
Fran
flitterio <at> gmail.com
--- erc.el.orig 2015-08-04 13:38:04.602900800 -0400
+++ erc.el 2015-08-04 13:38:56.538768600 -0400
@@ -6698,7 +6698,7 @@
(cond
((eq (erc-server-buffer) (current-buffer))
(run-hooks 'erc-kill-server-hook))
- ((erc-channel-p (erc-default-target))
+ ((erc-channel-p (or (erc-default-target) (buffer-name)))
(run-hooks 'erc-kill-channel-hook))
(t
(run-hooks 'erc-kill-buffer-hook)))))
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#21187: erc-kill-channel-hook sometimes is not run during /QUIT
2015-08-04 17:56 bug#21187: erc-kill-channel-hook sometimes is not run during /QUIT Fran Litterio
@ 2015-12-27 7:57 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-27 7:57 UTC (permalink / raw)
To: Fran Litterio; +Cc: 21187
Fran Litterio <flitterio@gmail.com> writes:
> Using Emacs built from the latest sources, when variable
> erc-kill-queries-on-quit is t (which causes ERC to kill channel
> buffers when quitting -- yes, the name is misleading), a /QUIT
> does not run the hooks on erc-kill-channel-hook, because
> erc-default-target returns nil due to the server being
> disconnected.
>
> This patch fixes that by falling back to examining the buffer
> name, which should be safe to do since we know the major mode is
> erc-mode.
> --
> Fran
> flitterio <at> gmail.com
>
> --- erc.el.orig 2015-08-04 13:38:04.602900800 -0400
> +++ erc.el 2015-08-04 13:38:56.538768600 -0400
> @@ -6698,7 +6698,7 @@
> (cond
> ((eq (erc-server-buffer) (current-buffer))
> (run-hooks 'erc-kill-server-hook))
> - ((erc-channel-p (erc-default-target))
> + ((erc-channel-p (or (erc-default-target) (buffer-name)))
Thanks; applied to Emacs 25.1.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-27 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-04 17:56 bug#21187: erc-kill-channel-hook sometimes is not run during /QUIT Fran Litterio
2015-12-27 7:57 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.