GNU bug report logs - #21193
25.0.50; python-shell-buffer-substring adds bogus if True: to unindented line

Previous Next

Package: emacs;

Reported by: Jorgen Schaefer <contact <at> jorgenschaefer.de>

Date: Wed, 5 Aug 2015 11:05:01 UTC

Severity: normal

Merged with 21086

Found in version 25.0.50

Fixed in version 24.5

Done: fgallina <at> gnu.org (Fabián Ezequiel Gallina)

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 21193 in the body.
You can then email your comments to 21193 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#21193; Package emacs. (Wed, 05 Aug 2015 11:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jorgen Schaefer <contact <at> jorgenschaefer.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 05 Aug 2015 11:05:02 GMT) Full text and rfc822 format available.

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

From: Jorgen Schaefer <contact <at> jorgenschaefer.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50;
 python-shell-buffer-substring adds bogus if True: to unindented line
Date: Wed, 05 Aug 2015 13:04:17 +0200
Hello!

The function `python-shell-buffer-substring' can get confused when it is
used to send a substring of a line. It tries to add if True: around an
indented piece of code to prevent indentation errors, but it fails at
detecting indented code correctly:

(with-temp-buffer
  (insert "def foo():\n"
          "    print('a')\n")
  (re-search-backward "print")
  (python-shell-buffer-substring (point) (point-at-eol) t))

=>

"if True:
print('a')"

Note that the "print" line in the resulting code is not indented.

The expected result would be either "print('a')" or
"if True:\n    print('a')".

Regards,
Jorgen




Merged 21086 21193. Request was from fgallina <at> gnu.org (Fabián Ezequiel Gallina) to control <at> debbugs.gnu.org. (Wed, 12 Aug 2015 03:07: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. (Mon, 21 Sep 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 276 days ago.

Previous Next


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