* bug#16548: 24.3; remove "buffer has clients" prompt
2014-01-25 12:34 bug#16548: 24.3; remove "buffer has clients" prompt Jarek Czekalski
@ 2014-01-25 20:34 ` Glenn Morris
2014-04-18 19:21 ` bug#16548: [PATCH] " Jarek Czekalski
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Glenn Morris @ 2014-01-25 20:34 UTC (permalink / raw)
To: Jarek Czekalski; +Cc: 16548
Jarek Czekalski wrote:
> I suggest to remove the "buffer has clients" prompt completely.
> If the buffer was not modified, it would close at once.
>
> I want to prepare a patch, but may it be applied for 24.4,
> despite feature freeze?
IMO such a change is not appropriate at this time.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16548: [PATCH] 24.3; remove "buffer has clients" prompt
2014-01-25 12:34 bug#16548: 24.3; remove "buffer has clients" prompt Jarek Czekalski
2014-01-25 20:34 ` Glenn Morris
@ 2014-04-18 19:21 ` Jarek Czekalski
2014-04-27 13:31 ` bug#16548: [PATCH} " Jarek Czekalski
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Jarek Czekalski @ 2014-04-18 19:21 UTC (permalink / raw)
To: 16548
[-- Attachment #1: Type: text/plain, Size: 178 bytes --]
This patch simply removes the code for "buffer still has clients" query.
Tested on trunk from today.
The ChangeLog entry must be moved to the right place before commit.
Jarek
[-- Attachment #2: hasclients_1_0.patch --]
[-- Type: text/x-diff, Size: 2185 bytes --]
# HG changeset patch
# Parent 1cc4f193d0c14f255fb79a3a360d364f962d1514
diff -r 1cc4f193d0c1 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Apr 05 08:48:37 2014 +0200
+++ b/lisp/ChangeLog Fri Apr 18 21:19:14 2014 +0200
@@ -16,6 +16,12 @@
* files.el (lock-buffer, unlock-buffer, file-locked-p):
Remove fallback aliases, since they are always defined now.
+2014-04-18 Jarek Czekalski <jarekczek@poczta.onet.pl>
+
+ Remove unneeded prompt when closing a buffer with active emacsclient.
+ * server.el (server-start): Remove the only call to:
+ * server.el (server-kill-buffer-query-function): Remove.
+
2014-03-24 Daniel Colascione <dancol@dancol.org>
* emacs-lisp/cl-macs.el (cl--do-arglist): Use `plist-member'
diff -r 1cc4f193d0c1 lisp/server.el
--- a/lisp/server.el Sat Apr 05 08:48:37 2014 +0200
+++ b/lisp/server.el Fri Apr 18 21:19:14 2014 +0200
@@ -642,8 +642,6 @@
(cl-letf (((default-file-modes) ?\700))
(add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
(add-hook 'delete-frame-functions 'server-handle-delete-frame)
- (add-hook 'kill-buffer-query-functions
- 'server-kill-buffer-query-function)
(add-hook 'kill-emacs-query-functions
'server-kill-emacs-query-function)
(add-hook 'kill-emacs-hook 'server-force-stop) ;Cleanup upon exit.
@@ -1472,22 +1470,6 @@
(save-buffer)))
(server-buffer-done (current-buffer))))
-;; Ask before killing a server buffer.
-;; It was suggested to release its client instead,
-;; but I think that is dangerous--the client would proceed
-;; using whatever is on disk in that file. -- rms.
-(defun server-kill-buffer-query-function ()
- "Ask before killing a server buffer."
- (or (not server-buffer-clients)
- (let ((res t))
- (dolist (proc server-buffer-clients)
- (when (and (memq proc server-clients)
- (eq (process-status proc) 'open))
- (setq res nil)))
- res)
- (yes-or-no-p (format "Buffer `%s' still has clients; kill it? "
- (buffer-name (current-buffer))))))
-
(defun server-kill-emacs-query-function ()
"Ask before exiting Emacs if it has live clients."
(or (not server-clients)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16548: [PATCH} 24.3; remove "buffer has clients" prompt
2014-01-25 12:34 bug#16548: 24.3; remove "buffer has clients" prompt Jarek Czekalski
2014-01-25 20:34 ` Glenn Morris
2014-04-18 19:21 ` bug#16548: [PATCH] " Jarek Czekalski
@ 2014-04-27 13:31 ` Jarek Czekalski
2014-05-05 7:43 ` bug#16548: " Jarek Czekalski
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Jarek Czekalski @ 2014-04-27 13:31 UTC (permalink / raw)
To: 16548
If no one objects, I'll commit this in a week.
Best
Jarek
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16548: 24.3; remove "buffer has clients" prompt
2014-01-25 12:34 bug#16548: 24.3; remove "buffer has clients" prompt Jarek Czekalski
` (2 preceding siblings ...)
2014-04-27 13:31 ` bug#16548: [PATCH} " Jarek Czekalski
@ 2014-05-05 7:43 ` Jarek Czekalski
2015-04-30 6:53 ` Tim Howes
2015-05-11 9:39 ` Andreas Amann
5 siblings, 0 replies; 8+ messages in thread
From: Jarek Czekalski @ 2014-05-05 7:43 UTC (permalink / raw)
To: 16548-done
Applied as r117062 [1]. Will be included in the next version after 24.4.
http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/117062
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16548: 24.3; remove "buffer has clients" prompt
2014-01-25 12:34 bug#16548: 24.3; remove "buffer has clients" prompt Jarek Czekalski
` (3 preceding siblings ...)
2014-05-05 7:43 ` bug#16548: " Jarek Czekalski
@ 2015-04-30 6:53 ` Tim Howes
2015-05-11 9:39 ` Andreas Amann
5 siblings, 0 replies; 8+ messages in thread
From: Tim Howes @ 2015-04-30 6:53 UTC (permalink / raw)
To: 16548
I think this prompt should be kept. If I'm interpreting RMS's comment
correctly, he's worried about what happens when emacsclient is started from
some script or program, where the program is opening an editor window (most
likely using the EDITOR shell variable) and then waiting for the editor to
be done so that it can proceed and make use of the contents of the file.
If a user has, say, forgotten why that particular buffer was opened, the
prompt reminds them that there is a client waiting on it, and the program
that started that client is possibly going to take some action using the
file contents. Killing the buffer will not cancel that action. Instead, the
program will proceed using whatever is currently saved in the file.
This could lead to a mistake. Here's a scenario: I'm testing some
experimental program that runs into an error. The program wants me to send a
bug report to the developers, so it opens up an editor with a template email
(emacsclient -c template.txt), which I'm supposed to fill out, and it will
then send the email for me. I start writing a message, but don't save it. I
get distracted or start working on other things. I open another emacs client
frame and work on some other files. I finish with those other files, and
kill the buffers. Then I'm presented with the unsaved email from earlier. I
decide I don't care about sending the bug report, so I kill the buffer. I
expect that the email will not be sent, but the program is actually going to
proceed and send the uncompleted template.
The prompt reminds me that the buffer is being used as an "editor" by some
other process. If I kill it carelessly, that process may end up doing
something unwanted. If I'm well aware of the circumstances and want to skip
the prompt, I should use C-x # ("done editing"). If I'm not worried about
such mistakes ever occurring, then I can remove the hook or change key
bindings in my emacs config. But it's probably best to have the prompt
appear by default, to help unaware users avoid mistakes.
--
View this message in context: http://emacs.1067599.n5.nabble.com/bug-16548-24-3-remove-buffer-has-clients-prompt-tp311633p357150.html
Sent from the Emacs - Bugs mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#16548: 24.3; remove "buffer has clients" prompt
2014-01-25 12:34 bug#16548: 24.3; remove "buffer has clients" prompt Jarek Czekalski
` (4 preceding siblings ...)
2015-04-30 6:53 ` Tim Howes
@ 2015-05-11 9:39 ` Andreas Amann
2015-05-17 4:07 ` Tim Howes
5 siblings, 1 reply; 8+ messages in thread
From: Andreas Amann @ 2015-05-11 9:39 UTC (permalink / raw)
To: 16548; +Cc: howestim
Maybe the right thing to do is to exit emacsclient with an error code if
the buffer is killed through another client? This should then be caught
by the script, which in the above example should not send an email if
emacsclient returns with error exit status.
^ permalink raw reply [flat|nested] 8+ messages in thread