From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: python-mode: Selecting deleted buffer error Date: Mon, 05 Mar 2007 14:57:34 -0500 Message-ID: References: <20070305134517.A4BC.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173124696 22632 80.91.229.12 (5 Mar 2007 19:58:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Mar 2007 19:58:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Slawomir Nowaczyk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 05 20:58:08 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HOJJq-0005ZV-3Z for ged-emacs-devel@m.gmane.org; Mon, 05 Mar 2007 20:58:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOJJp-0003An-H3 for ged-emacs-devel@m.gmane.org; Mon, 05 Mar 2007 14:58:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HOJJf-00039f-09 for emacs-devel@gnu.org; Mon, 05 Mar 2007 14:57:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HOJJa-00037g-2j for emacs-devel@gnu.org; Mon, 05 Mar 2007 14:57:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOJJZ-00037d-U3 for emacs-devel@gnu.org; Mon, 05 Mar 2007 14:57:45 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HOJJZ-0005EB-Gr for emacs-devel@gnu.org; Mon, 05 Mar 2007 14:57:45 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id EDCE42CF072; Mon, 5 Mar 2007 14:57:44 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 083133FE0; Mon, 5 Mar 2007 14:57:34 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id DF9376C9DE; Mon, 5 Mar 2007 14:57:34 -0500 (EST) In-Reply-To: <20070305134517.A4BC.SLAWOMIR.NOWACZYK.847@student.lu.se> (Slawomir Nowaczyk's message of "Mon\, 05 Mar 2007 13\:52\:49 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67367 Archived-At: > Calling python-send-region (and friends) after *Python* buffer has been > deleted can cause "Selecting deleted buffer" error. Steps to reproduce: > (require 'python) > (python-switch-to-python t) > (kill-buffer "*Python*") > (python-send-region (point-min) (point-max)) > The following patch seems to fix the problem: > ******************************************************************************** > --- EmacsCVS/lisp/progmodes/python.el 2007-03-05 12:17:50.687500000 +0100 > +++ Emacs/lisp/progmodes/python.el 2007-03-05 13:24:42.625000000 +0100 > @@ -1383,7 +1383,7 @@ > COMMAND should be a single statement." > ;; (assert (not (string-match "\n" command))) > ;; (let ((end (marker-position (process-mark (python-proc))))) > - (with-current-buffer python-buffer (goto-char (point-max))) > + (with-current-buffer (process-buffer (python-proc)) (goto-char (point-max))) > (compilation-forget-errors) > (python-send-string command) > (with-current-buffer python-buffer > ******************************************************************************** I've installed a similar patch. Stefan