unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22099: Path to fix bug in function erc-kill-query-buffers
@ 2015-12-06  1:13 Francis Litterio
  2015-12-27  7:43 ` Lars Ingebrigtsen
  2016-02-04  5:55 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Francis Litterio @ 2015-12-06  1:13 UTC (permalink / raw)
  To: 22099

In the latest Emacs sources (Git branch "master"), function
erc-kill-query-buffers fails to protect against being passed nil
for argument PROCESS, which causes all channel buffers on all
servers to be deleted!  This can happen if command /QUIT is issued
in a disconnected server buffer and variable erc-kill-queries-on-quit
is non-nil.

This patch fixes this problem.
--
Fran
flitterio <at> gmail.com


--- erc.el~	2015-08-09 16:04:46.097043200 -0400
+++ erc.el	2015-08-09 16:07:19.082925200 -0400
@@ -6071,13 +6071,14 @@
   (or (file-accessible-directory-p dir) (error "Cannot access %s" dir)))
 
 (defun erc-kill-query-buffers (process)
-  "Kill all buffers of PROCESS."
+  "Kill all buffers of PROCESS.  Does nothing if PROCESS is not a process
object."
   ;; here, we only want to match the channel buffers, to avoid
   ;; "selecting killed buffers" b0rkage.
-  (erc-with-all-buffers-of-server process
-    (lambda ()
-      (not (erc-server-buffer-p)))
-    (kill-buffer (current-buffer))))
+  (if (processp process)
+      (erc-with-all-buffers-of-server process
+        (lambda ()
+          (not (erc-server-buffer-p)))
+        (kill-buffer (current-buffer))))
 
 (defun erc-nick-at-point ()
   "Give information about the nickname at `point'.







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

* bug#22099: Path to fix bug in function erc-kill-query-buffers
  2015-12-06  1:13 bug#22099: Path to fix bug in function erc-kill-query-buffers Francis Litterio
@ 2015-12-27  7:43 ` Lars Ingebrigtsen
  2016-02-04  5:55 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-27  7:43 UTC (permalink / raw)
  To: Francis Litterio; +Cc: 22099

Francis Litterio <flitterio@gmail.com> writes:

> In the latest Emacs sources (Git branch "master"), function
> erc-kill-query-buffers fails to protect against being passed nil
> for argument PROCESS, which causes all channel buffers on all
> servers to be deleted!  This can happen if command /QUIT is issued
> in a disconnected server buffer and variable erc-kill-queries-on-quit
> is non-nil.
>
> This patch fixes this problem.

Thanks; but the patch seems malformed (probably during transmission).
Can you attach it instead?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#22099: Path to fix bug in function erc-kill-query-buffers
  2015-12-06  1:13 bug#22099: Path to fix bug in function erc-kill-query-buffers Francis Litterio
  2015-12-27  7:43 ` Lars Ingebrigtsen
@ 2016-02-04  5:55 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-04  5:55 UTC (permalink / raw)
  To: Francis Litterio; +Cc: 22099

Francis Litterio <flitterio@gmail.com> writes:

> In the latest Emacs sources (Git branch "master"), function
> erc-kill-query-buffers fails to protect against being passed nil
> for argument PROCESS, which causes all channel buffers on all
> servers to be deleted!  This can happen if command /QUIT is issued
> in a disconnected server buffer and variable erc-kill-queries-on-quit
> is non-nil.
>
> This patch fixes this problem.

Thanks; applied to emacs-25.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2016-02-04  5:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-06  1:13 bug#22099: Path to fix bug in function erc-kill-query-buffers Francis Litterio
2015-12-27  7:43 ` Lars Ingebrigtsen
2016-02-04  5:55 ` Lars Ingebrigtsen

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

	https://git.savannah.gnu.org/cgit/emacs.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).