unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: 22934@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	[thread overview]
Message-ID: <87egbm5ik4.fsf@gavenkoa.example.com> (raw)

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	other threads:[~2016-03-07 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 17:00 Oleksandr Gavenko [this message]
2020-12-03  9:21 ` 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) Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egbm5ik4.fsf@gavenkoa.example.com \
    --to=gavenkoa@gmail.com \
    --cc=22934@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).