bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22934: 24.5; python-mode: evaluating whole buffer after edit gives r


From: Oleksandr Gavenko
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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]