From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: Patch to optionally show Python process buffer after C-c C-c Date: Mon, 18 Jun 2012 20:03:33 +0200 Message-ID: <4FDF6D75.8010905@dogan.se> References: <4FDDD5BB.9070909@dogan.se> <4FDE3EA3.50304@dogan.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040508090102010109000704" X-Trace: dough.gmane.org 1340042659 18265 80.91.229.3 (18 Jun 2012 18:04:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jun 2012 18:04:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 18 20:04:18 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SggJE-0008CK-Bj for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2012 20:04:16 +0200 Original-Received: from localhost ([::1]:34991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SggJE-0005vh-AS for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2012 14:04:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SggJ7-0005uG-NI for emacs-devel@gnu.org; Mon, 18 Jun 2012 14:04:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SggJ1-0003Th-0m for emacs-devel@gnu.org; Mon, 18 Jun 2012 14:04:09 -0400 Original-Received: from mxf4.bahnhof.se ([213.80.101.28]:63728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SggJ0-0003QW-Q5; Mon, 18 Jun 2012 14:04:02 -0400 Original-Received: from localhost (mxf4.local [127.0.0.1]) by mxf4-reinject (Postfix) with ESMTP id D4E725F9883; Mon, 18 Jun 2012 20:03:58 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) Original-Received: from mxf4.bahnhof.se ([127.0.0.1]) by localhost (mxf4.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OhablcNNgx3Y; Mon, 18 Jun 2012 20:03:55 +0200 (CEST) Original-Received: from [192.168.1.4] (h-149-227.a336.priv.bahnhof.se [37.123.149.227]) by mxf4.bahnhof.se (Postfix) with ESMTP id C8AA95F98A9; Mon, 18 Jun 2012 20:03:55 +0200 (CEST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.80.101.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150991 Archived-At: This is a multi-part message in MIME format. --------------040508090102010109000704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------040508090102010109000704 Content-Type: text/plain; charset=windows-1252; name="new-python-patch-2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="new-python-patch-2.diff" === 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. --------------040508090102010109000704--