From: Lars Ingebrigtsen <larsi@gnus.org>
To: Harald Hanche-Olsen <harald.hanche-olsen@ntnu.no>
Cc: "11358@debbugs.gnu.org" <11358@debbugs.gnu.org>,
"npostavs@users.sourceforge.net" <npostavs@users.sourceforge.net>
Subject: bug#11358: 24.1.50; Feature request: A way to abort emacs-client
Date: Fri, 04 Jun 2021 11:13:24 +0200 [thread overview]
Message-ID: <87mts60z7v.fsf@gnus.org> (raw)
In-Reply-To: <1AC8AF23-F1EB-4A0D-B702-8931B318B36D@ntnu.no> (Harald Hanche-Olsen's message of "Thu, 3 Jun 2021 14:46:33 +0000")
Harald Hanche-Olsen <harald.hanche-olsen@ntnu.no> writes:
> Here is a very naive first stab:
>
> (defun server-abort ()
> (interactive)
> (if server-clients
> (mapc (lambda (proc)
> (server-send-string
> proc (concat "-error "
> (server-quote-arg "Aborted by the user"))))
> server-clients)
> (message "This buffer has no clients")))
>
> That is good enough for me, but ‘server-edit’ (or ‘server-done’, really)
> does a bit of housekeeping that this one does not.
Thanks, I installed this in Emacs 28 (under the name
server-edit-abort). This, along with your previous patch, reaches the
limit of the number of lines we can accept into Emacs without a
copyright assignment. Would you be willing to sign such paperwork?
> Most importantly, what this code does not is decide what to do
> with the buffer. It appears that, if it is unmodified, a process sentinel
> will delete it, but if it is modified, it remains. Perhaps that is okay.
> Perhaps aborting a server is such an exceptional event, one should
> leave the cleanup to the user anyhow.
Yes, I think that makes sense. If somebody wants to add more logic
here (to query the user for something), that might also be nice. But it
may not be necessary.
> Further ‘server-edit’ will try to switch to a different server buffer,
> if one exists. This code does not. Again, perhaps that is as it should be.
Yeah, I think aborting just the current buffer makes sense, but I can
see somebody wanting this to behave more like `server-edit' -- I guess
we'll see. But I think this is fine for now, at least, so I'm closing
this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2021-06-04 9:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 7:44 bug#11358: 24.1.50; Feature request: A way to abort emacs-client Harald Hanche-Olsen
2016-07-07 1:07 ` npostavs
2021-06-02 6:38 ` Lars Ingebrigtsen
2021-06-02 7:05 ` Harald Hanche-Olsen
2021-06-03 7:07 ` Lars Ingebrigtsen
2021-06-03 7:54 ` Eli Zaretskii
2021-06-03 14:46 ` Harald Hanche-Olsen
2021-06-04 9:13 ` Lars Ingebrigtsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mts60z7v.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=11358@debbugs.gnu.org \
--cc=harald.hanche-olsen@ntnu.no \
--cc=npostavs@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).