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.

Full log


View this message in rfc822 format

From: Oleksandr Gavenko <gavenkoa <at> gmail.com>
To: 22934 <at> debbugs.gnu.org
Subject: 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: 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/




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

Previous Next


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