aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-08-09 23:51:24 +0200
committerLars Ingebrigtsen2020-08-09 23:51:24 +0200
commitf1e2d366e5ff30c72ab92d38dacd14b544324066 (patch)
tree173803976f5ab6502b6cbb397da21c9e5e06c7a4 /lisp/progmodes/python.el
parent450644e9f7923c30ef3d885638e69d3263bfa3a8 (diff)
downloademacs-f1e2d366e5ff30c72ab92d38dacd14b544324066.tar.gz
emacs-f1e2d366e5ff30c72ab92d38dacd14b544324066.zip
Revert "Indent python multiline strings to start and previous levels"
This reverts commit b78583cde7d8aaa1fa19c20975c03d689c78baef. The multi-line string indentation was incorrect after applying this patch.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index dcdadae0c4b..3af55be4a19 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1070,18 +1070,11 @@ possibilities can be narrowed to specific indentation points."
1070 (`(:no-indent . ,_) (prog-first-column)) ; usually 0 1070 (`(:no-indent . ,_) (prog-first-column)) ; usually 0
1071 (`(,(or :after-line 1071 (`(,(or :after-line
1072 :after-comment 1072 :after-comment
1073 :inside-string
1073 :after-backslash) . ,start) 1074 :after-backslash) . ,start)
1074 ;; Copy previous indentation. 1075 ;; Copy previous indentation.
1075 (goto-char start) 1076 (goto-char start)
1076 (current-indentation)) 1077 (current-indentation))
1077 (`(,(or :inside-string
1078 :inside-docstring) . ,start)
1079 ;; Copy previous indentation inside string
1080 (let ((prev (progn (forward-line -1)
1081 (current-indentation)))
1082 (base (progn (goto-char start)
1083 (current-column))))
1084 (sort (delete-dups (list 0 prev base)) #'<)))
1085 (`(,(or :inside-paren-at-closing-paren 1078 (`(,(or :inside-paren-at-closing-paren
1086 :inside-paren-at-closing-nested-paren) . ,start) 1079 :inside-paren-at-closing-nested-paren) . ,start)
1087 (goto-char (+ 1 start)) 1080 (goto-char (+ 1 start))
@@ -1090,6 +1083,12 @@ possibilities can be narrowed to specific indentation points."
1090 (current-indentation) 1083 (current-indentation)
1091 ;; Align with opening paren. 1084 ;; Align with opening paren.
1092 (current-column))) 1085 (current-column)))
1086 (`(:inside-docstring . ,start)
1087 (let* ((line-indentation (current-indentation))
1088 (base-indent (progn
1089 (goto-char start)
1090 (current-indentation))))
1091 (max line-indentation base-indent)))
1093 (`(,(or :after-block-start 1092 (`(,(or :after-block-start
1094 :after-backslash-first-line 1093 :after-backslash-first-line
1095 :after-backslash-assignment-continuation 1094 :after-backslash-assignment-continuation