From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5924: 23.1; accept-process-output switching current-buffer Date: Mon, 12 Apr 2010 16:58:13 -0400 Message-ID: References: <84mxxbknma.fsf@cs.bham.ac.uk> <19393.48894.735000.238546@gargle.gargle.HOWL> <19395.28879.546000.627509@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271107740 20939 80.91.229.12 (12 Apr 2010 21:29:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Apr 2010 21:29:00 +0000 (UTC) Cc: 5924@debbugs.gnu.org To: Uday S Reddy Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 12 23:28:58 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 1O1RBh-00022s-L5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Apr 2010 23:28:57 +0200 Original-Received: from localhost ([127.0.0.1]:49100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1RBh-0000Gq-2b for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Apr 2010 17:28:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1RBc-0000Fj-Fv for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:28:52 -0400 Original-Received: from [140.186.70.92] (port=48845 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1RBa-0000E8-Sj for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:28:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1RBZ-0002Ff-1r for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:28:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55736) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1RBZ-0002FP-0B for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:28:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O1Qij-0002Gr-QP; Mon, 12 Apr 2010 16:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier 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 20:59: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.12711059008714 (code B ref 5924); Mon, 12 Apr 2010 20:59:01 +0000 Original-Received: (at 5924) by debbugs.gnu.org; 12 Apr 2010 20:58:20 +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 1O1Qi4-0002GV-EK for submit@debbugs.gnu.org; Mon, 12 Apr 2010 16:58:20 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Qi2-0002GQ-AO for 5924@debbugs.gnu.org; Mon, 12 Apr 2010 16:58:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAPolw0tMCqWu/2dsb2JhbACbOnK9LYUMBItGgwI X-IronPort-AV: E=Sophos;i="4.52,192,1270440000"; d="scan'208";a="60707205" Original-Received: from 76-10-165-174.dsl.teksavvy.com (HELO pastel.home) ([76.10.165.174]) by ironport2-out.pppoe.ca with ESMTP; 12 Apr 2010 16:58:13 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 710B37F1B; Mon, 12 Apr 2010 16:58:13 -0400 (EDT) In-Reply-To: <19395.28879.546000.627509@gargle.gargle.HOWL> (Uday S. Reddy's message of "Mon, 12 Apr 2010 20:13:19 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 12 Apr 2010 16:59: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:36224 Archived-At: >> 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. No problem, of course. > (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)))))) [ Side note: please, please, pretty please, don't use switch-to-buffer: the above code is not supposed to mess with windows, so you want to use `set-buffer' instead, and actually in this case (with-current-buffer candidate-buf (point-max)) is really the right way to write it since you do not need to save any point&mark but only the 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. Hmm... will have to dig into this one as well. Stefan