From: Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Thuna <thuna.cing@gmail.com>
Cc: 72312@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#72312: server--process-filter-1 returns from the wrong block
Date: Fri, 26 Jul 2024 22:32:53 +0100 [thread overview]
Message-ID: <87o76jalfe.fsf@jeremybryant.net> (raw)
In-Reply-To: <87y15n3nml.fsf@gmail.com> (Thuna's message of "Fri, 26 Jul 2024 22:27:14 +0200")
Thuna <thuna.cing@gmail.com> writes:
> In `server--process-filter-1' in lisp/server.el I assume the
> `return-from' on line 28 was meant to be from `server--process-filter-1'
> and not `server--process-filter'.
Assuming you mean this last line,
;; We return immediately.
(cl-return-from server--process-filter)))
adding Stefan M, who made a commit in
May and may know more.
commit 0d7d835902dfaeaae03850fb37e369833bb5664d
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Thu May 30 18:28:02 2024 -0400
server.el: Avoid nested runs of process filters (bug#71223)
(cl-defun server--process-filter-1 (proc string)
(server-log (concat "Received " string) proc)
;; First things first: let's check the authentication
(unless (process-get proc :authenticated)
(if (and (string-match "-auth \\([!-~]+\\)\n?" string)
(equal (match-string 1 string) (process-get proc :auth-key)))
(progn
(setq string (substring string (match-end 0)))
(process-put proc :authenticated t)
(server-log "Authentication successful" proc))
(server-log "Authentication failed" proc)
;; Display the error as a message and give the user time to see
;; it, in case the error written by emacsclient to stderr is not
;; visible for some reason.
(server--message-sit-for 2 "Authentication failed")
(server-send-string
proc (concat "-error " (server-quote-arg "Authentication failed")))
(unless (eq system-type 'windows-nt)
(let ((terminal (process-get proc 'terminal)))
;; Only delete the terminal if it is non-nil.
(when (and terminal (eq (terminal-live-p terminal) t))
(delete-terminal terminal))))
;; Before calling `delete-process', give emacsclient time to
;; receive the error string and shut down on its own.
;; FIXME: Why do we wait 1s here but 5s in the other one?
(run-with-timer 1 nil #'delete-process proc)
;; We return immediately.
(cl-return-from server--process-filter)))
next prev parent reply other threads:[~2024-07-26 21:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 20:27 bug#72312: server--process-filter-1 returns from the wrong block Thuna
2024-07-26 21:32 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-07-27 5:58 ` Eli Zaretskii
2024-07-27 7:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o76jalfe.fsf@jeremybryant.net \
--to=bug-gnu-emacs@gnu.org \
--cc=72312@debbugs.gnu.org \
--cc=jb@jeremybryant.net \
--cc=monnier@iro.umontreal.ca \
--cc=thuna.cing@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.