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

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

[debbugs-tracker] bug#21086: closed (24.5; python.el: python-shell-buffe


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#21086: closed (24.5; python.el: python-shell-buffer-substring fails under certain circumstances)
Date: Sun, 23 Aug 2015 23:02:02 +0000

Your message dated Sun, 23 Aug 2015 20:01:15 -0300
with message-id <address@hidden>
and subject line 24.5; python.el: python-shell-buffer-substring fails under 
certain circumstances
has caused the debbugs.gnu.org bug report #21086,
regarding 24.5; python.el: python-shell-buffer-substring fails under certain 
circumstances
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
21086: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21086
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.5; python.el: python-shell-buffer-substring fails under certain circumstances Date: Sat, 18 Jul 2015 18:13:33 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.0
Assuming some python buffer like:

#....
if 1:
    print 1

where the selected region is "print \"1\"" (mark before "p"),
`python-shell-send-region' would fail with:

File "test.py", line 3
    print 1
        ^
IndentationError: expected an indented block

The reason lies within `python-shell-buffer-substring', which assumes
that a region always starts with the correct indentation.

The attached patch fixes the above behavior: when the region doesn't
start with indentation, but the current block does (looking at
(current-indentation)), we prefix the fillstr with the correct amount of
indent.

Attachment: python-buffer-substring.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: 24.5; python.el: python-shell-buffer-substring fails under certain circumstances Date: Sun, 23 Aug 2015 20:01:15 -0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5.50 (gnu/linux)
Fixed in master at af013e0.

I installed a different patch that seems to be more robust on various
conditions (see tests).


Thanks for such detailed report,
Fabián.


--- End Message ---

reply via email to

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