]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change
authorEli Zaretskii <eliz@gnu.org>
Thu, 2 May 2024 10:04:15 +0000 (13:04 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:33:55 +0000 (18:33 +0200)
* 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)

lisp/progmodes/python.el
test/lisp/progmodes/python-tests.el

index 57cdf68fc25dc33456de5f82b9b304c685ce7370..5ba185bc60c9c861c6d6cb9a74939507ec178386 100644 (file)
@@ -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)
index 889038d0f8c3c9c536bd58b3ebab3cf72c1a9fc3..f50797953c332d071b7982d9ab332aa0a415cc44 100644 (file)
@@ -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