GNU bug report logs - #5391
python.el: reuse (sometimes) Python comint buffer

Previous Next

Package: emacs;

Reported by: Bojan Nikolic <bojan <at> bnikolic.co.uk>

Date: Fri, 15 Jan 2010 18:03:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 24.2

Done: Fabián Ezequiel Gallina <fabian <at> anue.biz>

Bug is archived. No further changes may be made.

Full log


Message #1 received at quiet <at> debbugs.gnu.org (full text, mbox):

From: Bojan Nikolic <bojan <at> bnikolic.co.uk>
To: quiet <at> debbugs.gnu.org
Subject: python.el: reuse (sometimes) Python comint buffer
Date: Thu, 03 Dec 2009 22:43:41 +0000
[Message part 1 (text/plain, inline)]
Package: emacs,python
Severity: wishlist
Tags: patch

[ resent from
  http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00188.html ]

Hello,

The run-python function in Emacs 22 python.el used to reuse comint
buffers, which I found very useful. The attached patch I think gets
back close to this behaviour, i.e.:

  If buffer python-buffer is live and "new" hasn't been specified that
  buffer is reused and the new comint process is started
  there. Otherwise it is started in a newly created buffer.

Hope it is useful for others and/or suitable for applying to trunk.

Best,
Bojan

[python-el-1.patch (text/x-diff, inline)]
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1562,7 +1562,10 @@
 	       ;; Suppress use of pager for help output:
 	       (process-connection-type nil))
 	  (apply 'make-comint-in-buffer "Python"
-		 (generate-new-buffer "*Python*")
+		 (if (and (buffer-live-p python-buffer)
+			  (not new))
+		     python-buffer
+		   (generate-new-buffer "*Python*"))
 		 (car cmdlist) nil (cdr cmdlist)))
       (setq-default python-buffer (current-buffer))
       (setq python-buffer (current-buffer))
[Message part 3 (text/plain, inline)]

-- 
Bojan Nikolic          ||          http://www.bnikolic.co.uk

This bug report was last modified 12 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.