GNU bug report logs - #22934
24.5; python-mode: evaluating whole buffer after edit gives right lines in error stack trace but quick navigation doesn't lead to correct lines (offset corespodnce to number of added lines)

Previous Next

Package: emacs;

Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>

Date: Mon, 7 Mar 2016 17:02:02 UTC

Severity: normal

Tags: fixed

Found in version 24.5

Fixed in version 28.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 22934 in the body.
You can then email your comments to 22934 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#22934; Package emacs. (Mon, 07 Mar 2016 17:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleksandr Gavenko <gavenkoa <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 07 Mar 2016 17:02:02 GMT) Full text and rfc822 format available.

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

From: Oleksandr Gavenko <gavenkoa <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5;
 python-mode: evaluating whole buffer after edit gives right lines in
 error stack trace but quick navigation doesn't lead to correct lines (offset
 corespodnce to number of added lines)
Date: Mon, 07 Mar 2016 19:00:59 +0200
In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.2)
 of 2015-10-24 on trouble, modified by Debian

  $ emacs -q

  C-x C-f ~/tmp/my.py RET

  def hello(flag):
      if flag:
          print "hello"
      else:
          raise Exception("xxx")

  hello(True)

  C-c C-c
  C-c C-z

Now I see result of my.py file execution.

Lets make edit in file:

  def hello(flag):
      print "THIS LINE WAS ADDED"
      if flag:
          print "hello"
      else:
          raise Exception("xxx")

  hello(False)  # give me exception!

  C-c C-c
  C-c C-z

I see:

  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/user/tmp/my.py", line 8, in <module>
      hello(True)
    File "/home/user/tmp/my.py", line 6, in hello
      raise Exception("xxx")

and line:

    File "/home/user/tmp/my.py", line 6, in hello

is clickable and leads to line **7** in a file. But actually error in line 6
as reported by Python inferior process. Just add more lines to better see
effect.

On each subsequent whole buffer evaluation (C-c C-c or M-x
python-shell-send-buffer) constantly errors point to incorrect line with
offsets according to how how many lines added or deleted before correct line.

Mode should not preserve line mapping between original file submission and
`compile-goto-error' should point to specified line position in file instead
of using "smart mapping" even if edit occurs.

I believe I use official GNU Python mode:

  /usr/share/emacs/24.5/lisp/progmodes/python.el.gz

-- 
http://defun.work/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22934; Package emacs. (Thu, 03 Dec 2020 09:22:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Cc: 22934 <at> debbugs.gnu.org
Subject: Re: bug#22934: 24.5; python-mode: evaluating whole buffer after
 edit gives right lines in error stack trace but quick navigation doesn't
 lead to correct lines (offset corespodnce to number of added lines)
Date: Thu, 03 Dec 2020 10:21:45 +0100
Oleksandr Gavenko <gavenkoa <at> gmail.com> writes:

> I see:
>
>   Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>     File "/home/user/tmp/my.py", line 8, in <module>
>       hello(True)
>     File "/home/user/tmp/my.py", line 6, in hello
>       raise Exception("xxx")
>
> and line:
>
>     File "/home/user/tmp/my.py", line 6, in hello
>
> is clickable and leads to line **7** in a file. But actually error in line 6
> as reported by Python inferior process. Just add more lines to better see
> effect.

This should now be fixed in Emacs 28.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Dec 2020 09:23:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 22934 <at> debbugs.gnu.org and Oleksandr Gavenko <gavenkoa <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Dec 2020 09:23: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. (Thu, 31 Dec 2020 12:24:07 GMT) Full text and rfc822 format available.

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

Previous Next


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