diff options
| author | Yuuki Harano | 2020-12-21 01:53:07 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2020-12-21 01:53:07 +0900 |
| commit | 565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42 (patch) | |
| tree | 5a25406b9f4ff091cb6856e857d2857bb3e631e4 /lisp/progmodes/python.el | |
| parent | a44cd7c88121bb0e04bdf13d73e15f085cf3b085 (diff) | |
| parent | 87b82a1969edf80d3bd4781454ec9fc968773a6d (diff) | |
| download | emacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.tar.gz emacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.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 | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d75944a702f..d58b32f3c3c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1404,7 +1404,7 @@ With positive ARG search backwards, else search forwards." | |||
| 1404 | (line-beg-pos (line-beginning-position)) | 1404 | (line-beg-pos (line-beginning-position)) |
| 1405 | (line-content-start (+ line-beg-pos (current-indentation))) | 1405 | (line-content-start (+ line-beg-pos (current-indentation))) |
| 1406 | (pos (point-marker)) | 1406 | (pos (point-marker)) |
| 1407 | (beg-indentation | 1407 | (body-indentation |
| 1408 | (and (> arg 0) | 1408 | (and (> arg 0) |
| 1409 | (save-excursion | 1409 | (save-excursion |
| 1410 | (while (and | 1410 | (while (and |
| @@ -1415,9 +1415,16 @@ With positive ARG search backwards, else search forwards." | |||
| 1415 | 0)))) | 1415 | 0)))) |
| 1416 | (found | 1416 | (found |
| 1417 | (progn | 1417 | (progn |
| 1418 | (when (and (< arg 0) | 1418 | (when (and (python-info-looking-at-beginning-of-defun) |
| 1419 | (python-info-looking-at-beginning-of-defun)) | 1419 | (or (< arg 0) |
| 1420 | ;; If looking at beginning of defun, and if | ||
| 1421 | ;; pos is > line-content-start, ensure a | ||
| 1422 | ;; backward re search match this defun by | ||
| 1423 | ;; going to end of line before calling | ||
| 1424 | ;; re-search-fn bug#40563 | ||
| 1425 | (and (> arg 0) (> pos line-content-start)))) | ||
| 1420 | (end-of-line 1)) | 1426 | (end-of-line 1)) |
| 1427 | |||
| 1421 | (while (and (funcall re-search-fn | 1428 | (while (and (funcall re-search-fn |
| 1422 | python-nav-beginning-of-defun-regexp nil t) | 1429 | python-nav-beginning-of-defun-regexp nil t) |
| 1423 | (or (python-syntax-context-type) | 1430 | (or (python-syntax-context-type) |
| @@ -1425,7 +1432,7 @@ With positive ARG search backwards, else search forwards." | |||
| 1425 | ;; backwards by checking indentation. | 1432 | ;; backwards by checking indentation. |
| 1426 | (and (> arg 0) | 1433 | (and (> arg 0) |
| 1427 | (not (= (current-indentation) 0)) | 1434 | (not (= (current-indentation) 0)) |
| 1428 | (>= (current-indentation) beg-indentation))))) | 1435 | (>= (current-indentation) body-indentation))))) |
| 1429 | (and (python-info-looking-at-beginning-of-defun) | 1436 | (and (python-info-looking-at-beginning-of-defun) |
| 1430 | (or (not (= (line-number-at-pos pos) | 1437 | (or (not (= (line-number-at-pos pos) |
| 1431 | (line-number-at-pos))) | 1438 | (line-number-at-pos))) |