From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: Patch to optionally show Python process buffer after C-c C-c Date: Mon, 18 Jun 2012 17:32:02 -0400 Message-ID: <20447.40530.865570.659293@gnu.org> References: <4FDDD5BB.9070909@dogan.se> <4FDE3EA3.50304@dogan.se> <4FDF6D75.8010905@dogan.se> <59fw9sxz0t.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1340055137 20263 80.91.229.3 (18 Jun 2012 21:32:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jun 2012 21:32:17 +0000 (UTC) Cc: Fabian Ezequiel Gallina To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 18 23:32:16 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 1SgjYQ-0003Dz-KV for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2012 23:32:10 +0200 Original-Received: from localhost ([::1]:38745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgjYQ-0001Ab-KF for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2012 17:32:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgjYN-0001AM-LM for emacs-devel@gnu.org; Mon, 18 Jun 2012 17:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgjYL-0007Te-QU for emacs-devel@gnu.org; Mon, 18 Jun 2012 17:32:07 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:44495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgjYL-0007TW-Mu for emacs-devel@gnu.org; Mon, 18 Jun 2012 17:32:05 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SgjYJ-0003Sk-4U; Mon, 18 Jun 2012 17:32:03 -0400 In-Reply-To: X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: magenta X-Ran: cwrF:+k2,/Of7XoM_sj|<*WFr[FMEMDiAVw2[=Uv:lt=?Pdfw3q&_a'_,!e<)h'rlnJ.8@ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.10 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:151003 Archived-At: Looks like the following reply was sent just to me, so I am resending this to emacs-devel: Fabian Ezequiel Gallina wrote (on Mon, 18 Jun 2012 at 16:12 -0300): > 2012/6/18 Glenn Morris : > > > > I tested it with M-x python-shell-send-string and it has no effect.= > > Use process-buffer to get the actual buffer to switch to=3F > > The command python-shell-switch-to-shell does this. > > So maybe just add an option to call that at the end of > > python-shell-send-string=3F > > > > In line with current python name space, the option should probably = be > > called python-shell-something. > > > > I don't use python much, so I'll cc the mode's author. > > > > Context is here: > > > > http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00272.html= > > > Hi all, >=20 > I just saw the patch and I have to say I don't see much of a need to > add that particular code. User is always at just one binding of havin= g > the shell shown via C-c C-z. Even if this is a customizable behavior > users will have to deal with the shell showing even if they just sent= > the current buffer for the sake of having enhanced completion with an= > updated context. >=20 > For the OP if he really wants this implemented here's a rough approac= h > you can add to your .emacs: >=20 > (defun python-shell-send-buffer-and-switch () > (interactive) > (python-shell-send-buffer) > (python-shell-switch-to-shell)) >=20 > Also if you want something more general that would work with any of > the python-shell-send-* functions, I would rather work on the > python-shell-send-string function itself and add the check for the > customization variable just there. For your use-case you might just > def-advice it and add the defcustom check at the end and the > python-shell-switch-to-shell. >=20 > Regards, > Fabi=C3=A1n E. Gallina