* 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)
@ 2016-03-07 17:00 Oleksandr Gavenko
2020-12-03 9:21 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Oleksandr Gavenko @ 2016-03-07 17:00 UTC (permalink / raw
To: 22934
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* 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)
2016-03-07 17:00 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) Oleksandr Gavenko
@ 2020-12-03 9:21 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-03 9:21 UTC (permalink / raw
To: Oleksandr Gavenko; +Cc: 22934
Oleksandr Gavenko <gavenkoa@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-03 9:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 17:00 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) Oleksandr Gavenko
2020-12-03 9:21 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.