[Python-mode] [ python-mode-Bugs-1079878 ] C-c C-c moves cursor into Python Output buffer

SourceForge.net noreply at sourceforge.net
Wed Dec 8 09:29:17 CET 2004


Bugs item #1079878, was opened at 2004-12-06 11:07
Message generated for change (Comment added) made by theller
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1079878&group_id=86916

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: C-c C-c moves cursor into Python Output buffer

Initial Comment:
When I edit a Python script with XEmacs, then hit C-c
C-c, the script is executed, the output is shown in a
*Python Output* buffer, and the cursor is moved into 
this buffer.

I want the cursor to stay in the buffer displaying the
Python script.  According to Skip this is a bug.

----------------------------------------------------------------------

>Comment By: Thomas Heller (theller)
Date: 2004-12-08 09:29

Message:
Logged In: YES 
user_id=11105

Yep - this one works much better ;-).  Thanks.

----------------------------------------------------------------------

Comment By: Thomas Guettler (guettli)
Date: 2004-12-07 21:21

Message:
Logged In: YES 
user_id=22123

Unfortunately it is not possible to upload a file. Here is
my patch.
It calls pop-to-buffer after py-execute-region. I am not a
(e)lisp expert, too.

@@ -1747,12 +1747,15 @@
 See the `\[py-execute-region]' docs for an account of some
 subtleties, including the use of the optional ASYNC argument."
   (interactive "P")
-  (if py-master-file
-      (let* ((filename (expand-file-name py-master-file))
-            (buffer (or (get-file-buffer filename)
-                        (find-file-noselect filename))))
-       (set-buffer buffer)))
-  (py-execute-region (point-min) (point-max) async))
+  (let ((old-buffer (current-buffer)))
+    (if py-master-file
+        (let* ((filename (expand-file-name py-master-file))
+               (buffer (or (get-file-buffer filename)
+                           (find-file-noselect filename))))
+          (set-buffer buffer)))
+    (py-execute-region (point-min) (point-max) async)
+       (pop-to-buffer old-buffer)
+    ))
 
 (defun py-execute-import-or-reload (&optional async)
   "Import the current buffer's file in a Python interpreter.


----------------------------------------------------------------------

Comment By: Thomas Guettler (guettli)
Date: 2004-12-07 21:15

Message:
Logged In: YES 
user_id=22123

Hi Thomas Heller,

the drawback of your patch is, that the output buffer is not
visible
after py-execute-buffer. It is only visible if it was before.



----------------------------------------------------------------------

Comment By: Thomas Heller (theller)
Date: 2004-12-07 16:22

Message:
Logged In: YES 
user_id=11105

The attached patch works for me.  But - I'm not an elisp
hacker, so I have no idea if that's correct.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1079878&group_id=86916


More information about the Python-mode mailing list