GNU bug report logs - #21242
24.5.1; python.el: should display output buffer on exceptions when using python-shell-send-region

Previous Next

Package: emacs;

Reported by: Yuri D'Elia <wavexx <at> thregr.org>

Date: Wed, 12 Aug 2015 14:06:01 UTC

Severity: wishlist

Tags: moreinfo

Found in version 24.5.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21242 in the body.
You can then email your comments to 21242 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21242; Package emacs. (Wed, 12 Aug 2015 14:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx <at> thregr.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 12 Aug 2015 14:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yuri D'Elia <wavexx <at> thregr.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5.1; python.el: should display output buffer on exceptions when
 using python-shell-send-region
Date: Wed, 12 Aug 2015 16:05:42 +0200
[Message part 1 (text/plain, inline)]
When evaluating the code interactively, there's currently no
notification about evaluation errors. Exceptions in the output buffer go
simply unnoticed, unless you watch for them closely. I like to keep the
output buffer buried, and assume that no-notification==no-error.

Exceptions caused by interactive evaluation should either:

- show a notification of sorts in the minibuffer
- display the output buffer for inspection

For inspiration about the second, see:

https://github.com/wavexx/python-x.el/blob/master/python-x.el#L424

Given previous experience with python-mode.el (which tends to break the
current window layout with his own splitting logic), I find it important
that the notification function (which displays the output buffer) should
be customizable, and this is reflected in the example code.
[python-buffer-substring.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21242; Package emacs. (Thu, 13 Aug 2015 06:50:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#21242: 24.5.1; python.el: should display output buffer on
 exceptions when using python-shell-send-region
Date: Thu, 13 Aug 2015 08:48:41 +0200
Am 12.08.2015 um 16:05 schrieb Yuri D'Elia:
> When evaluating the code interactively, there's currently no
> notification about evaluation errors. Exceptions in the output buffer go
> simply unnoticed, unless you watch for them closely. I like to keep the
> output buffer buried, and assume that no-notification==no-error.
>
> Exceptions caused by interactive evaluation should either:
>
> - show a notification of sorts in the minibuffer
> - display the output buffer for inspection
>
> For inspiration about the second, see:
>
> https://github.com/wavexx/python-x.el/blob/master/python-x.el#L424
>
> Given previous experience with python-mode.el (which tends to break the
> current window layout with his own splitting logic), I find it important
> that the notification function (which displays the output buffer) should
> be customizable, and this is reflected in the example code.

WRT python-mode.el:

Splitting-behavior _is_ customizable. It only occurs if 
py-split-window-on-execute is non-nil - default is 'just-two.
Also there is py-keep-windows-configuration, when non-nil it precedes 
other settings.




Severity set to 'wishlist' from 'normal' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 04 Jun 2017 18:33:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21242; Package emacs. (Thu, 17 Sep 2020 18:02:02 GMT) Full text and rfc822 format available.

Message #13 received at 21242 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 21242 <at> debbugs.gnu.org
Subject: Re: bug#21242: 24.5.1; python.el: should display output buffer on
 exceptions when using python-shell-send-region
Date: Thu, 17 Sep 2020 20:01:20 +0200
Yuri D'Elia <wavexx <at> thregr.org> writes:

> When evaluating the code interactively, there's currently no
> notification about evaluation errors. Exceptions in the output buffer go
> simply unnoticed, unless you watch for them closely. I like to keep the
> output buffer buried, and assume that no-notification==no-error.
>
> Exceptions caused by interactive evaluation should either:
>
> - show a notification of sorts in the minibuffer
> - display the output buffer for inspection

I don't use this stuff a lot, but I just don't understand how the patch
attached relates to the reported problem.

And there's also Andreas's comment (at the end).

Yuri, could you explain a bit more about how this patch fixes the
problem?

> -         (toplevel-block-p (save-excursion
> -                             (goto-char start)
> -                             (or (zerop (line-number-at-pos start))
> -                                 (progn
> -                                   (python-util-forward-comment 1)
> -                                   (zerop (current-indentation)))))))
> +         (block-param (save-excursion
> +                        (goto-char start)
> +                        (progn
> +                          (python-util-forward-comment 1)
> +                          (list (current-indentation)
> +                                (/= (point) start)))))
> +         (block-indentation (car block-param))
> +         (starts-with-indentation-p (cadr block-param)))
>      (with-temp-buffer
>        (python-mode)
>        (if fillstr (insert fillstr))
> +      (when (and (> block-indentation 0) (not starts-with-indentation-p))
> +        (insert (make-string block-indentation ?\s)))
>        (insert substring)
>        (goto-char (point-min))
> -      (when (not toplevel-block-p)
> +      (when (> block-indentation 0)
>          (insert "if True:")
>          (delete-region (point) (line-end-position)))

Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

>> Given previous experience with python-mode.el (which tends to break the
>> current window layout with his own splitting logic), I find it important
>> that the notification function (which displays the output buffer) should
>> be customizable, and this is reflected in the example code.
>
> WRT python-mode.el:
>
> Splitting-behavior _is_ customizable. It only occurs if
> py-split-window-on-execute is non-nil - default is 'just-two.
> Also there is py-keep-windows-configuration, when non-nil it precedes
> other settings.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 17 Sep 2020 18:02:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21242; Package emacs. (Thu, 17 Sep 2020 18:45:02 GMT) Full text and rfc822 format available.

Message #18 received at 21242 <at> debbugs.gnu.org (full text, mbox):

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 21242 <at> debbugs.gnu.org
Subject: Re: bug#21242: 24.5.1; python.el: should display output buffer on
 exceptions when using python-shell-send-region
Date: Thu, 17 Sep 2020 20:44:05 +0200
On Thu, Sep 17 2020, Lars Ingebrigtsen wrote:
> I don't use this stuff a lot, but I just don't understand how the patch
> attached relates to the reported problem.
>
> And there's also Andreas's comment (at the end).
>
> Yuri, could you explain a bit more about how this patch fixes the
> problem?

I won't lie here, I have _no_ clue anymore what I had in mind with that
code at a first glance.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21242; Package emacs. (Fri, 18 Sep 2020 11:09:02 GMT) Full text and rfc822 format available.

Message #21 received at 21242 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 21242 <at> debbugs.gnu.org
Subject: Re: bug#21242: 24.5.1; python.el: should display output buffer on
 exceptions when using python-shell-send-region
Date: Fri, 18 Sep 2020 13:07:51 +0200
Yuri D'Elia <wavexx <at> thregr.org> writes:

>> Yuri, could you explain a bit more about how this patch fixes the
>> problem?
>
> I won't lie here, I have _no_ clue anymore what I had in mind with that
> code at a first glance.

:-)

But it sounds like there probably won't be more progress here in this
bug report, then, so I'm closing it.  If further progress can be made,
please respond to the debbugs address, and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 21242 <at> debbugs.gnu.org and Yuri D'Elia <wavexx <at> thregr.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 18 Sep 2020 11:09:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Oct 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.