summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLin Sun <sunlin7@hotmail.com>2024-05-20 06:55:31 +0000
committerEli Zaretskii <eliz@gnu.org>2024-05-26 11:23:12 +0300
commitb241ec0e78f141e7fc22cf3afb11037d14fc028c (patch)
tree0fd2cfe9683ab071434c290c684af8cbf0691b92 /lisp
parent9ca89cb4834a20bc7d38289046d4d05e2212ba50 (diff)
downloademacs-b241ec0e78f141e7fc22cf3afb11037d14fc028c.tar.gz
emacs-b241ec0e78f141e7fc22cf3afb11037d14fc028c.tar.bz2
emacs-b241ec0e78f141e7fc22cf3afb11037d14fc028c.zip
Enhance 'python-shell-send-block' for convenience
* lisp/progmodes/python.el (python-shell-send-block): 'python-shell-send-block' will now send block without header by default. * test/lisp/progmodes/python-tests.el (python-test--shell-send-block): Update the test case. (Bug#71083)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/python.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index fea52b2f7d6..b5c00385ef3 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4156,14 +4156,14 @@ interactively."
"Send the block at point to inferior Python process.
The block is delimited by `python-nav-beginning-of-block' and
`python-nav-end-of-block'. If optional argument ARG is non-nil
-(interactively, the prefix argument), send the block body without
+\(interactively, the prefix argument), send the block body with
its header. If optional argument MSG is non-nil, force display
of a user-friendly message if there's no process running; this
always happens interactively."
(interactive (list current-prefix-arg t))
(let ((beg (save-excursion
(when (python-nav-beginning-of-block)
- (if (null arg)
+ (if arg
(beginning-of-line)
(python-nav-end-of-statement)
(beginning-of-line 2)))
@@ -4172,7 +4172,7 @@ always happens interactively."
(python-indent-guess-indent-offset-verbose nil))
(if (and beg end)
(python-shell-send-region beg end nil msg t)
- (user-error "Can't get code block from current position."))))
+ (user-error "Can't get code block from current position"))))
(defun python-shell-send-buffer (&optional send-main msg)
"Send the entire buffer to inferior Python process.