From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Newsgroups: gmane.emacs.devel Subject: Re: python.el, shell-send-region and exception handling Date: Sat, 17 Jan 2015 22:31:15 -0300 Message-ID: <87y4p0zxgc.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1421544689 28215 80.91.229.3 (18 Jan 2015 01:31:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Jan 2015 01:31:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Yuri D'Elia Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 18 02:31:29 2015 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 1YCei9-0001Ym-75 for ged-emacs-devel@m.gmane.org; Sun, 18 Jan 2015 02:31:29 +0100 Original-Received: from localhost ([::1]:60662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCei8-0000mc-Eg for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 20:31:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCei4-0000lP-KX for emacs-devel@gnu.org; Sat, 17 Jan 2015 20:31:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCehz-0007tK-MC for emacs-devel@gnu.org; Sat, 17 Jan 2015 20:31:24 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCehz-0007tE-J1 for emacs-devel@gnu.org; Sat, 17 Jan 2015 20:31:19 -0500 Original-Received: from [190.246.172.180] (port=58723 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YCehy-0001sc-NH; Sat, 17 Jan 2015 20:31:19 -0500 In-Reply-To: (Yuri D'Elia's message of "Fri, 09 Jan 2015 21:29:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:181393 Archived-At: Yuri D'Elia writes: > Is there a way to have python-shell-send-region (and friends) to detect > uncaught exceptions at the python prompt? > > I would like to be notified somehow of python exceptions either in the > minibuffer or by splitting the window and showing python's output. > Currently, uncaught exceptions simply go unnoticed if you don't have the > output buffer visible. > > This is done currently in python-mode.el, but I couldn't find an > alternative in python.el. > > If I wanted to implement such a feature, how would you suggest to > implement it? > > Thanks. > Hi Yuri, A simple way to achieve this would be to create a comint output filter function. The `python-pdbtrack-comint-output-filter-function` is a nice guide to start. You would check with a regexp for the occurrence of an exception and act accordingly. I plan to add this to python.el. If you'd like your implementation to be considered feel free to propose it, otherwise expect my approach to land in the next few weeks. Regards, Fabi=C3=A1n