From: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>, 5924@debbugs.gnu.org
Subject: bug#5924: 23.1; accept-process-output switching current-buffer
Date: Sun, 11 Apr 2010 13:22:22 +0100 [thread overview]
Message-ID: <19393.48894.735000.238546@gargle.gargle.HOWL> (raw)
In-Reply-To: <jwv633y1z2b.fsf-monnier+emacs@gnu.org>
Stefan Monnier writes:
> > Reading the elisp manual doesn't indicate anywhere that a call such as
> > (accept-process-output process)
> > should change the current-buffer.
>
> That depends on the code run during the wait. I.e. it depends on the
> code run by the process filters, sentinels, timers, ...
Yes, indeed! If there is code being run during accept-process-output
then the state can be changed by that code. But in the example that I
witnessed, there was *no code* being run.
Looking at the manual again, it says in "Accepting Output from
Processes":
"There are *two ways* to receive the output that a subprocess
writes to its standard output stream. The output can be inserted
in a buffer, which is called the associated buffer of the process,
or a function called the "filter function" can be called to act on
the output."
In the second "way" that is being talked about, we can reasonably
expect that current-buffer might change during the execution of the
filter function. But in the first "way", where Emacs is doing all the
work of accepting the process output, I don't think it should change
the current-buffer.
> We've already fixed several bugs where process filters changed
> current-buffer, but I think we should fix it not in the process filters
> but in the code that run them. At least, unless someone can come up
> with a scenario where a process filter, sentinel, or timer would need
> to change current-buffer.
I don't fully understand this, but let me say that I am just talking
about problem with the Elisp semantics, not Emacs libraries. If a
filter function changed the current-buffer, one would regard it as
buggy. But if Elisp itself changes the current-buffer...?
The other thing that concerns me is that the same behaviour persisted
even if I set the JUST-THIS-ONE flag to t. In that case, one would
expect that Elisp would ignore the output from all other processes.
So, it should have no reason to change the current-buffer to the other
process. But it did. I am not sure if the JUST-THIS-ONE flag is
doing anything at all.
Cheers,
Uday
PS I have been looking at the emacs-developers list lately. It is
quite amazing how much the guys talk, RMS included!
next prev parent reply other threads:[~2010-04-11 12:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 21:23 bug#5924: 23.1; accept-process-output switching current-buffer Uday S Reddy
2010-04-11 2:54 ` Stefan Monnier
2010-04-11 12:22 ` Uday S Reddy [this message]
2010-04-11 16:30 ` Stefan Monnier
2010-04-12 19:13 ` Uday S Reddy
2010-04-12 20:58 ` Stefan Monnier
2010-04-12 19:39 ` Uday S Reddy
2010-05-20 9:50 ` Uday S Reddy
2010-05-24 0:07 ` Uday S Reddy
2010-05-24 2:04 ` Uday S Reddy
2010-07-23 22:36 ` Stefan Monnier
2011-09-18 20:16 ` Lars Magne Ingebrigtsen
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=19393.48894.735000.238546@gargle.gargle.HOWL \
--to=u.s.reddy@cs.bham.ac.uk \
--cc=5924@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.