From: Deniz Dogan <deniz@dogan.se>
To: Glenn Morris <rgm@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Patch to optionally show Python process buffer after C-c C-c
Date: Mon, 18 Jun 2012 20:03:33 +0200 [thread overview]
Message-ID: <4FDF6D75.8010905@dogan.se> (raw)
In-Reply-To: <ga7gv4pkpm.fsf@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
On 2012-06-18 19:56,, Glenn Morris wrote:
> Deniz Dogan wrote:
>
>> +(defcustom python-show-process-buffer-on-send nil
>> + "Whether or not to show the Python process buffer after sending
>> +a region to the Python process."
>
> The first line of a doc string should be a complete sentence.
>
>> + :version "24.1")
>
> 24.2
>
Attached the changes you requested.
[-- Attachment #2: new-python-patch-2.diff --]
[-- Type: text/plain, Size: 1454 bytes --]
=== modified file 'lisp/progmodes/python.el'
--- lisp/progmodes/python.el 2012-06-17 08:53:31 +0000
+++ lisp/progmodes/python.el 2012-06-18 18:03:07 +0000
@@ -1328,6 +1328,16 @@
:type '(alist string)
:group 'python)
+(defcustom python-show-process-buffer-on-send nil
+ "If non-nil, show the process buffer after sending.
+If the value is `current', show the process buffer in the current
+window. If the value is `other', display it in another window."
+ :type '(choice (const :tag "No" nil)
+ (const :tag "In current window" current)
+ (const :tag "In another window" other))
+ :group 'python
+ :version "24.2")
+
(defun python-shell-get-process-name (dedicated)
"Calculate the appropriate process name for inferior Python process.
If DEDICATED is t and the variable `buffer-file-name' is non-nil
@@ -1592,7 +1602,11 @@
(comint-send-string process string)
(when (or (not (string-match "\n$" string))
(string-match "\n[ \t].*\n?$" string))
- (comint-send-string process "\n")))))
+ (comint-send-string process "\n")))
+ (cond ((eq python-show-process-buffer-on-send 'other)
+ (switch-to-buffer-other-window (current-buffer)))
+ ((eq python-show-process-buffer-on-send 'current)
+ (switch-to-buffer (current-buffer))))))
(defun python-shell-send-string-no-output (string &optional process msg)
"Send STRING to PROCESS and inhibit output.
next prev parent reply other threads:[~2012-06-18 18:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-17 13:03 Patch to optionally show Python process buffer after C-c C-c Deniz Dogan
2012-06-17 19:13 ` Glenn Morris
2012-06-17 20:31 ` Deniz Dogan
2012-06-18 17:56 ` Glenn Morris
2012-06-18 18:03 ` Deniz Dogan [this message]
2012-06-18 18:20 ` Glenn Morris
[not found] ` <CABq4mQtPF8Sns2Pf0U8pw+oaJ9pnxser7-oiaCng8J3kTxHyiA@mail.gmail.com>
2012-06-18 21:32 ` Glenn Morris
2012-06-18 23:41 ` Glenn Morris
2012-06-19 2:13 ` Glenn Morris
2012-06-19 7:44 ` Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FDF6D75.8010905@dogan.se \
--to=deniz@dogan.se \
--cc=emacs-devel@gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.