GNU bug report logs - #16548
24.3; remove "buffer has clients" prompt

Previous Next

Package: emacs;

Reported by: Jarek Czekalski <jarekczek <at> poczta.onet.pl>

Date: Sat, 25 Jan 2014 12:36:01 UTC

Severity: wishlist

Found in version 24.3

Done: Jarek Czekalski <jarekczek <at> poczta.onet.pl>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16548 in the body.
You can then email your comments to 16548 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Sat, 25 Jan 2014 12:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jarek Czekalski <jarekczek <at> poczta.onet.pl>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 25 Jan 2014 12:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; remove "buffer has clients" prompt
Date: Sat, 25 Jan 2014 13:34:42 +0100
When we try to kill a buffer, that was opened through
emacsclient, Emacs warns us: "buffer still has clients".
If we want to really kill it, we must answer "yes" (3 letters plus return).
If we modified the buffer, then in total we have 2 prompts to answer.
That seems too much and in help-gnu-emacs [1] no one could
provide a justification for that, other users seemed to
agree is is redundant. Eli had had some doubts, but
probably he got rid of them.

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?

Jarek

[1] http://lists.gnu.org/archive/html/help-gnu-emacs/2013-11/msg00382.html





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Sat, 25 Jan 2014 20:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 16548 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
Cc: 16548 <at> debbugs.gnu.org
Subject: Re: bug#16548: 24.3; remove "buffer has clients" prompt
Date: Sat, 25 Jan 2014 15:34:55 -0500
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Fri, 18 Apr 2014 19:22:01 GMT) Full text and rfc822 format available.

Message #11 received at 16548 <at> debbugs.gnu.org (full text, mbox):

From: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
To: 16548 <at> debbugs.gnu.org
Subject: [PATCH] 24.3; remove "buffer has clients" prompt
Date: Fri, 18 Apr 2014 21:21:18 +0200
[Message part 1 (text/plain, inline)]
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

[hasclients_1_0.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Sun, 27 Apr 2014 13:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 16548 <at> debbugs.gnu.org (full text, mbox):

From: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
To: 16548 <at> debbugs.gnu.org
Subject: [PATCH} 24.3; remove "buffer has clients" prompt
Date: Sun, 27 Apr 2014 15:31:59 +0200
If no one objects, I'll commit this in a week.

Best
Jarek





Reply sent to Jarek Czekalski <jarekczek <at> poczta.onet.pl>:
You have taken responsibility. (Mon, 05 May 2014 07:44:02 GMT) Full text and rfc822 format available.

Notification sent to Jarek Czekalski <jarekczek <at> poczta.onet.pl>:
bug acknowledged by developer. (Mon, 05 May 2014 07:44:03 GMT) Full text and rfc822 format available.

Message #19 received at 16548-done <at> debbugs.gnu.org (full text, mbox):

From: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
To: 16548-done <at> debbugs.gnu.org
Subject: bug#16548: 24.3; remove "buffer has clients" prompt
Date: Mon, 05 May 2014 09:43:42 +0200
Applied as r117062 [1]. Will be included in the next version after 24.4.

http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/117062





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 02 Jun 2014 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Tim Howes <howestim <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 30 Apr 2015 06:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Thu, 30 Apr 2015 06:55:01 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tim Howes <howestim <at> gmail.com>
To: Bug-gnu-emacs <at> gnu.org
Subject: Re: bug#16548: 24.3; remove "buffer has clients" prompt
Date: Wed, 29 Apr 2015 23:53:53 -0700 (MST)
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Mon, 11 May 2015 09:40:04 GMT) Full text and rfc822 format available.

Message #29 received at 16548 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Amann <a.amann <at> ucc.ie>
To: <16548 <at> debbugs.gnu.org>
Cc: howestim <at> gmail.com
Subject: Re: bug#16548: 24.3; remove "buffer has clients" prompt
Date: Mon, 11 May 2015 10:39:43 +0100
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. 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16548; Package emacs. (Sun, 17 May 2015 04:08:01 GMT) Full text and rfc822 format available.

Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tim Howes <howestim <at> gmail.com>
To: Bug-gnu-emacs <at> gnu.org
Subject: Re: bug#16548: 24.3; remove "buffer has clients" prompt
Date: Sat, 16 May 2015 21:07:41 -0700 (MST)
Well, I think the same concern still applies even if only one client frame is
open. Some users might have all their "editor" buffers started by other
applications opening in the same existing frame. And the script or
application that opens the editor may not be set up to handle the error
codes correctly.

I was going to say, if the prompt bothers you, why not just add (remove-hook
'kill-buffer-query-functions 'server-kill-buffer-query-function) to your
emacs config. But it appears that doesn't work. I guess the server-specific
hooks get loaded after the init files.

Someone on StackOverflow suggested the following:
  (defun server-remove-kill-buffer-hook () 
      (remove-hook 'kill-buffer-query-functions
'server-kill-buffer-query-function))
  (add-hook 'server-visit-hook 'server-remove-kill-buffer-hook)

http://stackoverflow.com/questions/268088/how-to-remove-the-prompt-for-killing-emacsclient-buffers

I guess it would be easier if there was simply a variable, with a name such
as server-query-before-kill-buffer, that could be set to t or nil.



--
View this message in context: http://emacs.1067599.n5.nabble.com/bug-16548-24-3-remove-buffer-has-clients-prompt-tp311633p358682.html
Sent from the Emacs - Bugs mailing list archive at Nabble.com.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.