summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/python.el11
-rw-r--r--test/lisp/progmodes/python-tests.el1
2 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index f848f4c1030..7818ab1ab05 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -775,12 +775,14 @@ is used to limit the scan."
;; The first quote is escaped, so it's not part of a triple quote!
(goto-char (1+ quote-starting-pos)))
((null string-start)
- ;; This set of quotes delimit the start of a string.
- (put-text-property quote-starting-pos (1+ quote-starting-pos)
+ ;; This set of quotes delimit the start of a string. Put
+ ;; string fence syntax on last quote. (bug#49518)
+ (put-text-property (1- quote-ending-pos) quote-ending-pos
'syntax-table (string-to-syntax "|")))
(t
- ;; This set of quotes delimit the end of a string.
- (put-text-property (1- quote-ending-pos) quote-ending-pos
+ ;; This set of quotes delimit the end of a string. Put
+ ;; string fence syntax on first quote. (bug#49518)
+ (put-text-property quote-starting-pos (1+ quote-starting-pos)
'syntax-table (string-to-syntax "|"))))))
(defvar python-mode-syntax-table
@@ -4308,6 +4310,7 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
(and (equal (string-to-syntax "|")
(syntax-after (point)))
(point)))))
+ ;; JT@2021-09-21: Since bug#49518's fix this will always be 1
(num-quotes (python-syntax-count-quotes
(char-after str-start-pos) str-start-pos))
(str-line-start-pos
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index afdae4c75c6..6ab9c62746e 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -193,7 +193,6 @@ aliqua."
(ert-deftest python-syntax-after-python-backspace ()
;; `python-indent-dedent-line-backspace' garbles syntax
- :expected-result :failed
(python-tests-with-temp-buffer
"\"\"\""
(goto-char (point-max))