aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-10-27 20:29:08 +0100
committerLars Ingebrigtsen2020-10-27 20:29:08 +0100
commit8c8349e4b57e9772b673cea2594f0a1e01a6f356 (patch)
tree3cc7d8bea2cb7c73132aa9390a3e270cea4a9e31 /lisp/progmodes/python.el
parentf1bf89e3837199fd9ac37faf52a166b2af9ead0f (diff)
downloademacs-8c8349e4b57e9772b673cea2594f0a1e01a6f356.tar.gz
emacs-8c8349e4b57e9772b673cea2594f0a1e01a6f356.zip
Tweak how `C-c C-r' computes the region in python-mode
* lisp/progmodes/python.el (python-shell-buffer-substring): Don't extend the region to the start of the line (bug#39398), but allow sending the actual region as marked.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el6
1 files changed, 1 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 0487964d815..53542a75f58 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3138,11 +3138,7 @@ the python shell:
3138 coding cookie is added. 3138 coding cookie is added.
3139 4. Wraps indented regions under an \"if True:\" block so the 3139 4. Wraps indented regions under an \"if True:\" block so the
3140 interpreter evaluates them correctly." 3140 interpreter evaluates them correctly."
3141 (let* ((start (save-excursion 3141 (let* ((substring (buffer-substring-no-properties start end))
3142 ;; Normalize start to the line beginning position.
3143 (goto-char start)
3144 (line-beginning-position)))
3145 (substring (buffer-substring-no-properties start end))
3146 (starts-at-point-min-p (save-restriction 3142 (starts-at-point-min-p (save-restriction
3147 (widen) 3143 (widen)
3148 (= (point-min) start))) 3144 (= (point-min) start)))