From: Jorgen Schaefer <contact@jorgenschaefer.de>
To: 21193@debbugs.gnu.org
Subject: bug#21193: 25.0.50; python-shell-buffer-substring adds bogus if True: to unindented line
Date: Wed, 05 Aug 2015 13:04:17 +0200 [thread overview]
Message-ID: <87614u6lou.fsf@loki.jorgenschaefer.de> (raw)
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
reply other threads:[~2015-08-05 11:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87614u6lou.fsf@loki.jorgenschaefer.de \
--to=contact@jorgenschaefer.de \
--cc=21193@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).