diff options
| author | Yuuki Harano | 2020-12-05 20:30:42 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2020-12-05 20:30:42 +0900 |
| commit | da92d5700eff8f628b6306202635a2514eb8b387 (patch) | |
| tree | e632bd68bf0286525e59ce35326986c1cb6f7755 /lisp/progmodes/python.el | |
| parent | d46a223d8595e8edb67c6361033625797503cacf (diff) | |
| parent | dc39c66d3bb6b1db6af0519659ff154bf6d8a5d1 (diff) | |
| download | emacs-da92d5700eff8f628b6306202635a2514eb8b387.tar.gz emacs-da92d5700eff8f628b6306202635a2514eb8b387.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 091456aa89a..e9c3b3986aa 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3197,6 +3197,8 @@ the python shell: | |||
| 3197 | (line-beginning-position) (line-end-position)))) | 3197 | (line-beginning-position) (line-end-position)))) |
| 3198 | (buffer-substring-no-properties (point-min) (point-max))))) | 3198 | (buffer-substring-no-properties (point-min) (point-max))))) |
| 3199 | 3199 | ||
| 3200 | (declare-function compilation-forget-errors "compile") | ||
| 3201 | |||
| 3200 | (defun python-shell-send-region (start end &optional send-main msg | 3202 | (defun python-shell-send-region (start end &optional send-main msg |
| 3201 | no-cookie) | 3203 | no-cookie) |
| 3202 | "Send the region delimited by START and END to inferior Python process. | 3204 | "Send the region delimited by START and END to inferior Python process. |
| @@ -3214,6 +3216,10 @@ process running; defaults to t when called interactively." | |||
| 3214 | (original-string (buffer-substring-no-properties start end)) | 3216 | (original-string (buffer-substring-no-properties start end)) |
| 3215 | (_ (string-match "\\`\n*\\(.*\\)" original-string))) | 3217 | (_ (string-match "\\`\n*\\(.*\\)" original-string))) |
| 3216 | (message "Sent: %s..." (match-string 1 original-string)) | 3218 | (message "Sent: %s..." (match-string 1 original-string)) |
| 3219 | ;; Recalculate positions to avoid landing on the wrong line if | ||
| 3220 | ;; lines have been removed/added. | ||
| 3221 | (with-current-buffer (process-buffer process) | ||
| 3222 | (compilation-forget-errors)) | ||
| 3217 | (python-shell-send-string string process))) | 3223 | (python-shell-send-string string process))) |
| 3218 | 3224 | ||
| 3219 | (defun python-shell-send-statement (&optional send-main msg) | 3225 | (defun python-shell-send-statement (&optional send-main msg) |