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: Sat, 24 Jul 2010 00:36:46 +0200 Message-ID: References: <84mxxbknma.fsf@cs.bham.ac.uk> <19393.48894.735000.238546@gargle.gargle.HOWL> <19449.57028.88000.501191@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 1279926474 20780 80.91.229.12 (23 Jul 2010 23:07:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Jul 2010 23:07:54 +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 Sat Jul 24 01:07:51 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 1OcRLJ-0003Fr-8B for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Jul 2010 01:07:49 +0200 Original-Received: from localhost ([127.0.0.1]:41861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcRLI-0001YX-I4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jul 2010 19:07:48 -0400 Original-Received: from [140.186.70.92] (port=55645 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcRL9-0001XU-7k for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2010 19:07:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcRL7-0007CY-P0 for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2010 19:07:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53297) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcRL7-0007CU-LX for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2010 19:07:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OcQsU-00081l-4E; Fri, 23 Jul 2010 18:38:02 -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: Fri, 23 Jul 2010 22:38: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.127992462530824 (code B ref 5924); Fri, 23 Jul 2010 22:38:02 +0000 Original-Received: (at 5924) by debbugs.gnu.org; 23 Jul 2010 22:37:05 +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 1OcQrY-000817-LG for submit@debbugs.gnu.org; Fri, 23 Jul 2010 18:37:04 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcQrW-0007zo-Hd for 5924@debbugs.gnu.org; Fri, 23 Jul 2010 18:37:03 -0400 Original-Received: from ceviche.home (vpn-132-204-232-95.acd.umontreal.ca [132.204.232.95]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o6NMalQC028140; Fri, 23 Jul 2010 18:36:48 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 80293660D2; Sat, 24 Jul 2010 00:36:46 +0200 (CEST) In-Reply-To: <19449.57028.88000.501191@gargle.gargle.HOWL> (Uday S. Reddy's message of "Mon, 24 May 2010 03:04:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3585=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 23 Jul 2010 18:38: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:38856 Archived-At: > I should take back my last couple of messages. I had a timer task > running (after 2 second delay) which was changing buffers. > Unfortunately, this was getting scheduled to run during the other > process's accept-process-output. So, I had mistakenly put the blame > on accept-process-output. Thanks for the heads up. BTW, could you try the patch below (including byte-compiling the file and re-dumping Emacs since it's a preloaded file), to see if it would have fixed your problem, even with the offending timer? Stefan PS: BTW, I recommend to stay away from set-buffer and always use with-current-buffer instead ;-) === modified file 'lisp/emacs-lisp/timer.el' --- lisp/emacs-lisp/timer.el 2010-01-13 08:35:10 +0000 +++ lisp/emacs-lisp/timer.el 2010-07-23 22:32:44 +0000 @@ -321,7 +321,11 @@ ;; We do this after rescheduling so that the handler function ;; can cancel its own timer successfully with cancel-timer. (condition-case nil - (apply (timer--function timer) (timer--args timer)) + ;; Timer functions should not change the current buffer. + ;; If they do, all kinds of nasty surprises can happen, + ;; and it can be hellish to track down their source. + (save-current-buffer + (apply (timer--function timer) (timer--args timer))) (error nil)) (if retrigger (setf (timer--triggered timer) nil)))