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: Mon, 12 Apr 2010 20:13:19 +0100 Message-ID: <19395.28879.546000.627509@gargle.gargle.HOWL> References: <84mxxbknma.fsf@cs.bham.ac.uk> <19393.48894.735000.238546@gargle.gargle.HOWL> 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 1271100586 25915 80.91.229.12 (12 Apr 2010 19:29:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Apr 2010 19:29:46 +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 Mon Apr 12 21:29:44 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 1O1PKF-000573-M0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Apr 2010 21:29:40 +0200 Original-Received: from localhost ([127.0.0.1]:39315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1PKF-0003hu-3A for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Apr 2010 15:29:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1PJh-0003Tc-54 for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 15:29:05 -0400 Original-Received: from [140.186.70.92] (port=43662 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1PJf-0003SV-34 for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 15:29:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1PJX-0002Iu-QY for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 15:28:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42489) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1PJV-0002Ia-SQ for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 15:28:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O1P58-0001R9-4Z; Mon, 12 Apr 2010 15:14:02 -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: Mon, 12 Apr 2010 19:14:02 +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.12710996235514 (code B ref 5924); Mon, 12 Apr 2010 19:14:02 +0000 Original-Received: (at 5924) by debbugs.gnu.org; 12 Apr 2010 19:13:43 +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 1O1P4o-0001Qt-Dc for submit@debbugs.gnu.org; Mon, 12 Apr 2010 15:13:43 -0400 Original-Received: from sun61.bham.ac.uk ([147.188.128.150]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1P4m-0001Qo-H9 for 5924@debbugs.gnu.org; Mon, 12 Apr 2010 15:13:41 -0400 Original-Received: from [147.188.128.127] (helo=bham.ac.uk) by sun61.bham.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1O1P4g-0004Kn-Ni; Mon, 12 Apr 2010 20:13:34 +0100 Original-Received: from mx1.cs.bham.ac.uk ([147.188.192.53]) by bham.ac.uk with esmtp (Exim 4.43) id 1O1P4g-0006nc-Dq; Mon, 12 Apr 2010 20:13:34 +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 1O1P4g-0002y1-5x; Mon, 12 Apr 2010 20:13:34 +0100 In-Reply-To: X-Mailer: VM 8.2.0-devo under 22.2.1 (i386-mingw-nt5.1.2600) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 12 Apr 2010 15:14:02 -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:36217 Archived-At: Stefan Monnier writes: > I've just installed a change in the Emacs Bzr trunk so that the > current-buffer is preserved when running the Elisp code of process > filters and sentinels. If you can try this code (or try the patch > below) to see if it fixes your problem, it would be helpful. Hi Stephan, thanks very much for the quick action on this. I am a bit embarrassed because I have never done a build of Emacs. And, I am going to be away for a few days. So, it will take me a while to try it out. Hope you don't mind. The trick I use for these kinds of asynchronous errors is to set error traps that log entries whenever the unexpected situations occur. Of course, it is not easy to figure out what to log and several repeated trials may be necessary to get enough diagnostic information. > > 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. > > I don't know of a bug in this regard, so if you have evidence that > JUST-THIS-ONE doesn't prevent reading other process's output, please > report it. OK, I defined a wrappe around accept-process-output function as follows: (defsubst vm-accept-process-output (process) (let ((buf (current-buffer)) (old-point-max (save-excursion (switch-to-buffer candidate-buf) (point-max)))) (accept-process-output process nil nil t) (if (not (equal buf (current-buffer))) (if (and (equal (current-buffer) candidate-buf) (not (= old-point-max (point-max)))) (debug "found output sent to %s: %s to %s" (current-buffer) old-point-max (point-max)) (debug "found buffer changed to %s" (current-buffer)))))) Since the JUST-THIS-ONE flag is passed in as t, it shouldn't insert anything anything in 'candidate-buf' (which was my guess as to where it would go). But the backtrace shows that it went there. Debugger entered: ("found output sent to %s: %s to %s" # 1019 1086) vm-imap-read-object(#>) vm-imap-read-response(#>) vm-imap-read-response-and-verify(#> "size FETCH") vm-imap-get-message-size(#> 3698) byte-code(...) vm-imap-synchronize-folder(t nil t t t t) vm-get-spooled-mail(t) vm-get-new-mail(nil) call-interactively(vm-get-new-mail nil nil) Cheers, Uday