unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72312: server--process-filter-1 returns from the wrong block
@ 2024-07-26 20:27 Thuna
  2024-07-26 21:32 ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thuna @ 2024-07-26 20:27 UTC (permalink / raw)
  To: 72312

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'.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#72312: server--process-filter-1 returns from the wrong block
  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
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-26 21:32 UTC (permalink / raw)
  To: Thuna; +Cc: 72312, Stefan Monnier

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)))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#72312: server--process-filter-1 returns from the wrong block
  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
@ 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
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-07-27  5:58 UTC (permalink / raw)
  To: Thuna; +Cc: 72312-done

> From: Thuna <thuna.cing@gmail.com>
> Date: Fri, 26 Jul 2024 22:27:14 +0200
> 
> 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'.

This was already fixed yesterday by Andrea, see commit fdc133e97f65.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#72312: server--process-filter-1 returns from the wrong block
  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
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-27  7:12 UTC (permalink / raw)
  To: Thuna; +Cc: 72312

> 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'.

Indeed, thanks!


        Stefan






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-27  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).