all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "João Távora" <joaotavora@gmail.com>,
	"Michael Albinus" <michael.albinus@gmx.de>
Cc: 62194@debbugs.gnu.org
Subject: bug#62194: 30.0.50; Two Eglot-over-Tramp tests are failing on master, passing on emacs-29
Date: Thu, 16 Mar 2023 22:18:59 +0100	[thread overview]
Message-ID: <87zg8co0n0.fsf@miha-pc> (raw)
In-Reply-To: <87wn3g1ssd.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3178 bytes --]

João Távora <joaotavora@gmail.com> writes:

> From ac334523b4a7ba23a5198ad60a97456055ffbfbd Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= <joaotavora@gmail.com>
> Date: Wed, 15 Mar 2023 20:02:43 +0000
> Subject: [PATCH 3/4] A simpler fix for bug#61350, a small tweak Michael's
>  original idea.
>
> * lisp/net/tramp.el (tramp-accept-process-output): Accept process
> from related processes.
> ---
>  lisp/net/tramp.el | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
> index 47173b95bea..a7406a9d80e 100644
> --- a/lisp/net/tramp.el
> +++ b/lisp/net/tramp.el
> @@ -5800,6 +5800,11 @@ tramp-accept-process-output
>  This is needed in order to hide `last-coding-system-used', which is set
>  for process communication also.
>  If the user quits via `C-g', it is propagated up to `tramp-file-name-handler'."
> +  (when-let (((process-get proc 'shared-socket))
> +	     (v (process-get proc 'vector)))
> +    (dolist (p (delq proc (process-list)))
> +      (when (tramp-file-name-equal-p v (process-get p 'vector))
> +	(while (accept-process-output p 0)))))

I think that accept-process-output with JUST-THIS-ONE=nil is dangerous
here. We are now allowing 'file-exists-p', 'expand-file-name' and all
other functions listed in 'tramp-sh-file-name-handler-alist' to call any
timer or process filter, without even documenting this.

And even if this behaviour was documented, I don't think it is what
Elisp programmers want. It's hard to be 100% sure that calling a simple
functions such as 'expand-file-name' will work as expected in presence
of arbitrary timers or process filters. Remember that Emacs can have
pretty hardcore timers or process filters: In M-x shell, the process
filter may call 'read-passwd', entering a recursive edit, in which the
user can kill any buffer or even a process. Or with midnight-mode
enabled, a timer kills buffers older than 3 days. I consider these "the
problem of timing errors that usually plague parallel programming", to
quote '(elisp) Output from Processes'.

I'm not saying that my proposal with SIGWINCH is flawless and I agree
that its unacceptable. I'm just saying that we shouldn't be quite
satisfied with this solution yet, though it should be fine for some
time.

What I was thinking was perhaps to introduce a function called
'accumulate-process-output' which would be similar to
'accept-process-output', except that it would only save process output
on the heap without calling any process filters or timers. Subsequent
calls to 'accept-process-output', or more accurately,
wait_reading_process_output, would then first call the process filters
on the previously saved output from the heap.

This solution would probably be quite complex to implement, but having
thought about this problem for two days, I haven't come to any other
idea. If there aren't any objections or better ideas, I could start
working on it after I finally receive copyright paperwork.

>    (with-current-buffer (process-buffer proc)
>      (let ((inhibit-read-only t)
>  	  last-coding-system-used
> -- 
> 2.39.2
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2023-03-16 21:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 23:08 bug#62194: 30.0.50; Two Eglot-over-Tramp tests are failing on master, passing on emacs-29 João Távora
2023-03-15  9:40 ` Michael Albinus
2023-03-15 11:45   ` Michael Albinus
2023-03-15 20:24     ` João Távora
2023-03-15 20:36     ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-15 20:45       ` João Távora
2023-03-16 12:02         ` Michael Albinus
2023-03-16 12:20           ` João Távora
2023-03-16 14:57             ` Michael Albinus
2023-03-16 15:12               ` João Távora
2023-03-16 17:35                 ` Michael Albinus
2023-03-16 17:59                   ` João Távora
2023-03-16 21:18                     ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-03-16 21:57                       ` João Távora
2023-03-16 23:38                         ` João Távora
2023-03-17 16:45                         ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-17 16:47                           ` Eli Zaretskii
2023-03-17 17:22                             ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-17 17:22                               ` Eli Zaretskii
2023-03-17 10:44                     ` Michael Albinus
2023-03-17 11:19                       ` João Távora
2023-03-18  9:38                         ` Michael Albinus
2023-03-18 11:29                           ` João Távora
2023-03-18 12:23                             ` Michael Albinus
2023-03-18 12:33                               ` João Távora
2023-03-19 12:19                           ` Michael Albinus
2023-03-15 20:16   ` João Távora
2023-03-16 15:02     ` Michael Albinus
2023-03-28 10:51       ` Michael Albinus

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=87zg8co0n0.fsf@miha-pc \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62194@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=michael.albinus@gmx.de \
    --cc=miha@kamnitnik.top \
    /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.