* bug#30244: 25.2.50; Killing sql mode buffer results in error
@ 2018-01-25 0:28 Allen Li
2018-04-17 20:08 ` Lars Ingebrigtsen
0 siblings, 1 reply; 4+ messages in thread
From: Allen Li @ 2018-01-25 0:28 UTC (permalink / raw)
To: 30244
To reproduce (need a mysql server handy):
M-x toggle-debug-on-error RET
M-x sql-mysql RET <fill in information>
C-x k RET yes RET
Yields error:
Debugger entered--Lisp error: (error "Selecting deleted buffer")
sql-stop(#<process SQL> "hangup\n")
In GNU Emacs 25.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11),
modified by Debian
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#30244: 25.2.50; Killing sql mode buffer results in error
2018-01-25 0:28 bug#30244: 25.2.50; Killing sql mode buffer results in error Allen Li
@ 2018-04-17 20:08 ` Lars Ingebrigtsen
2018-04-17 23:12 ` Phil Sainty
0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-17 20:08 UTC (permalink / raw)
To: Allen Li; +Cc: 30244
Allen Li <vianchielfaura@gmail.com> writes:
> To reproduce (need a mysql server handy):
>
> M-x toggle-debug-on-error RET
> M-x sql-mysql RET <fill in information>
> C-x k RET yes RET
>
> Yields error:
>
> Debugger entered--Lisp error: (error "Selecting deleted buffer")
> sql-stop(#<process SQL> "hangup\n")
I don't use sql-mode, so I can't test this. Does the following trivial
patch work fix the bug for you?
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index f907a01d8c..ebbef8d89e 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4031,15 +4031,16 @@ sql-stop
This function is a sentinel watching the SQL interpreter process.
Sentinels will always get the two parameters PROCESS and EVENT."
- (with-current-buffer (process-buffer process)
- (let
- ((comint-input-ring-separator sql-input-ring-separator)
- (comint-input-ring-file-name sql-input-ring-file-name))
- (comint-write-input-ring))
-
- (if (not buffer-read-only)
- (insert (format "\nProcess %s %s\n" process event))
- (message "Process %s %s" process event))))
+ (when (buffer-live-p (process-buffer process))
+ (with-current-buffer (process-buffer process)
+ (let
+ ((comint-input-ring-separator sql-input-ring-separator)
+ (comint-input-ring-file-name sql-input-ring-file-name))
+ (comint-write-input-ring))
+
+ (if (not buffer-read-only)
+ (insert (format "\nProcess %s %s\n" process event))
+ (message "Process %s %s" process event)))))
\f
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-17 23:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25 0:28 bug#30244: 25.2.50; Killing sql mode buffer results in error Allen Li
2018-04-17 20:08 ` Lars Ingebrigtsen
2018-04-17 23:12 ` Phil Sainty
2018-04-17 23:23 ` 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).