From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday S Reddy Newsgroups: gmane.emacs.bugs Subject: bug#5924: 23.1; accept-process-output switching current-buffer Date: Sun, 11 Apr 2010 13:22:22 +0100 Message-ID: <19393.48894.735000.238546@gargle.gargle.HOWL> References: <84mxxbknma.fsf@cs.bham.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1270988935 26889 80.91.229.12 (11 Apr 2010 12:28:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2010 12:28:55 +0000 (UTC) Cc: Uday S Reddy , 5924@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 11 14:28:54 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O0wHV-0002gZ-Mg for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 14:28:54 +0200 Original-Received: from localhost ([127.0.0.1]:60188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0wHV-0003UD-08 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 08:28:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0wHP-0003U0-IC for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 08:28:47 -0400 Original-Received: from [140.186.70.92] (port=58403 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0wHO-0003Tl-9j for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 08:28:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0wHM-00084I-O3 for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 08:28:46 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58965) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0wHM-000848-MQ for bug-gnu-emacs@gnu.org; Sun, 11 Apr 2010 08:28:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O0wBp-00032S-Sw; Sun, 11 Apr 2010 08:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Uday S Reddy Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Apr 2010 12:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5924-submit@debbugs.gnu.org id=B5924.127098856211672 (code B ref 5924); Sun, 11 Apr 2010 12:23:01 +0000 Original-Received: (at 5924) by debbugs.gnu.org; 11 Apr 2010 12:22:42 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0wBW-00032D-05 for submit@debbugs.gnu.org; Sun, 11 Apr 2010 08:22:42 -0400 Original-Received: from sun60.bham.ac.uk ([147.188.128.137]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0wBU-000328-1t for 5924@debbugs.gnu.org; Sun, 11 Apr 2010 08:22:40 -0400 Original-Received: from [147.188.128.127] (helo=bham.ac.uk) by sun60.bham.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1O0wBN-0003K0-PI; Sun, 11 Apr 2010 13:22:33 +0100 Original-Received: from mx1.cs.bham.ac.uk ([147.188.192.53]) by bham.ac.uk with esmtp (Exim 4.43) id 1O0wBN-0002Ow-FP; Sun, 11 Apr 2010 13:22:33 +0100 Original-Received: from gromit.cs.bham.ac.uk ([147.188.193.16] helo=MARUTI.cs.bham.ac.uk) by mx1.cs.bham.ac.uk with esmtp (Exim 4.51) id 1O0wBN-00008p-Ga; Sun, 11 Apr 2010 13:22:33 +0100 In-Reply-To: X-Mailer: VM 8.2.0-devo under 23.1.1 (i386-mingw-nt5.1.2600) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 11 Apr 2010 08:23:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36185 Archived-At: 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!