unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* python-mode: Selecting deleted buffer error
@ 2007-03-05 12:52 Slawomir Nowaczyk
  2007-03-05 19:57 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Slawomir Nowaczyk @ 2007-03-05 12:52 UTC (permalink / raw)
  To: emacs-devel

Hello,

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

********************************************************************************

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

The early bird may get the worm, but the second mouse gets the cheese.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-05 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05 12:52 python-mode: Selecting deleted buffer error Slawomir Nowaczyk
2007-03-05 19:57 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).