From: Eli Zaretskii Date: Thu, 2 May 2024 10:04:15 +0000 (+0300) Subject: ; Fix last change X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=84cff09208153de1d9af6b100d796abfcc6cbb8f;p=emacs.git ; Fix last change * lisp/progmodes/python.el (python-shell-send-block): Doc fix. * test/lisp/progmodes/python-tests.el (python-test--shell-send-block): Avoid byte-compiler warnings. (Bug#70609) (cherry picked from commit 59c18389bdd89d48e92c485ba27721490ea03e16) --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 57cdf68fc25..5ba185bc60c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4147,10 +4147,11 @@ interactively." (defun python-shell-send-block (&optional arg msg) "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'. When optional argument ARG is non-nil, send -the block body without its header. When optional argument MSG is -non-nil, forces display of a user-friendly message if there's no process -running; defaults to t when called interactively." +`python-nav-end-of-block'. If optional argument ARG is non-nil +(interactively, the prefix argument), send the block body without +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) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 889038d0f8c..f50797953c3 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -7473,9 +7473,9 @@ buffer with overlapping strings." for x in range(1,3): print('current %s' % x) print('current 3')" - (goto-line 1) + (goto-char (point-min)) (should-error (python-shell-send-block) :type 'user-error) - (goto-line 2) + (forward-line) (python-shell-send-block) (python-tests-shell-wait-for-prompt) (python-shell-with-shell-buffer @@ -7484,7 +7484,7 @@ print('current 3')" (should (re-search-forward "current 1" nil t)) (should (re-search-forward "current 2" nil t)) (should-not (re-search-forward "current 3" nil t))) - (goto-line 3) + (forward-line) (python-shell-send-block t) ;; send block body only (python-tests-shell-wait-for-prompt) (python-shell-with-shell-buffer