diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 104889a31f8..bdc95dfa9cd 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -287,9 +287,8 @@ | |||
| 287 | ;;; 24.x Compat | 287 | ;;; 24.x Compat |
| 288 | 288 | ||
| 289 | 289 | ||
| 290 | (unless (fboundp 'prog-first-column) | 290 | (unless (boundp 'prog-first-column) |
| 291 | (defun prog-first-column () | 291 | (defvar prog-first-column 0)) |
| 292 | 0)) | ||
| 293 | 292 | ||
| 294 | 293 | ||
| 295 | ;;; Bindings | 294 | ;;; Bindings |
| @@ -1026,7 +1025,7 @@ happening for :at-dedenter-block-start context since the | |||
| 1026 | possibilities can be narrowed to specific indentation points." | 1025 | possibilities can be narrowed to specific indentation points." |
| 1027 | (save-excursion | 1026 | (save-excursion |
| 1028 | (pcase (python-indent-context) | 1027 | (pcase (python-indent-context) |
| 1029 | (`(:no-indent . ,_) (prog-first-column)) ; usually 0 | 1028 | (`(:no-indent . ,_) prog-first-column) ; usually 0 |
| 1030 | (`(,(or :after-line | 1029 | (`(,(or :after-line |
| 1031 | :after-comment | 1030 | :after-comment |
| 1032 | :inside-string | 1031 | :inside-string |
| @@ -1064,7 +1063,7 @@ possibilities can be narrowed to specific indentation points." | |||
| 1064 | (let ((opening-block-start-points | 1063 | (let ((opening-block-start-points |
| 1065 | (python-info-dedenter-opening-block-positions))) | 1064 | (python-info-dedenter-opening-block-positions))) |
| 1066 | (if (not opening-block-start-points) | 1065 | (if (not opening-block-start-points) |
| 1067 | (prog-first-column) ; if not found default to first column | 1066 | prog-first-column ; if not found default to first column |
| 1068 | (mapcar (lambda (pos) | 1067 | (mapcar (lambda (pos) |
| 1069 | (save-excursion | 1068 | (save-excursion |
| 1070 | (goto-char pos) | 1069 | (goto-char pos) |
| @@ -1082,7 +1081,7 @@ integers. Levels are returned in ascending order, and in the | |||
| 1082 | case INDENTATION is a list, this order is enforced." | 1081 | case INDENTATION is a list, this order is enforced." |
| 1083 | (if (listp indentation) | 1082 | (if (listp indentation) |
| 1084 | (sort (copy-sequence indentation) #'<) | 1083 | (sort (copy-sequence indentation) #'<) |
| 1085 | (nconc (number-sequence (prog-first-column) (1- indentation) | 1084 | (nconc (number-sequence prog-first-column (1- indentation) |
| 1086 | python-indent-offset) | 1085 | python-indent-offset) |
| 1087 | (list indentation)))) | 1086 | (list indentation)))) |
| 1088 | 1087 | ||
| @@ -1107,7 +1106,7 @@ minimum." | |||
| 1107 | (python-indent--previous-level levels (current-indentation)) | 1106 | (python-indent--previous-level levels (current-indentation)) |
| 1108 | (if levels | 1107 | (if levels |
| 1109 | (apply #'max levels) | 1108 | (apply #'max levels) |
| 1110 | (prog-first-column))))) | 1109 | prog-first-column)))) |
| 1111 | 1110 | ||
| 1112 | (defun python-indent-line (&optional previous) | 1111 | (defun python-indent-line (&optional previous) |
| 1113 | "Internal implementation of `python-indent-line-function'. | 1112 | "Internal implementation of `python-indent-line-function'. |