aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-05-02 08:56:02 -0700
committerPaul Eggert2016-05-02 08:59:24 -0700
commit628053101d65749aecad5cc59d4dc0d0e7a8098d (patch)
tree1e491144adc90609d4791ca10abf0d7f8e66e76d
parentfd7b430afdd7ddea40cad7d231f634ff8bd536d8 (diff)
downloademacs-628053101d65749aecad5cc59d4dc0d0e7a8098d.tar.gz
emacs-628053101d65749aecad5cc59d4dc0d0e7a8098d.zip
Don’t electrically quote ‘'’ in Python
Problem reported by Philipp Stephani (Bug#23387). * lisp/electric.el (electric-quote-post-self-insert-function): Do not requote a string starter or ender.
-rw-r--r--lisp/electric.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/electric.el b/lisp/electric.el
index ab79943c9dd..e2896010405 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -444,10 +444,15 @@ This requotes when a quoting key is typed."
444 (let ((start 444 (let ((start
445 (if (and comment-start comment-use-syntax) 445 (if (and comment-start comment-use-syntax)
446 (when (or electric-quote-comment electric-quote-string) 446 (when (or electric-quote-comment electric-quote-string)
447 (let ((syntax (syntax-ppss))) 447 (let* ((syntax (syntax-ppss))
448 (and (or (and electric-quote-comment (nth 4 syntax)) 448 (beg (nth 8 syntax)))
449 (and beg
450 (or (and electric-quote-comment (nth 4 syntax))
449 (and electric-quote-string (nth 3 syntax))) 451 (and electric-quote-string (nth 3 syntax)))
450 (nth 8 syntax)))) 452 ;; Do not requote a quote that starts or ends
453 ;; a comment or string.
454 (eq beg (nth 8 (save-excursion
455 (syntax-ppss (1- (point)))))))))
451 (and electric-quote-paragraph 456 (and electric-quote-paragraph
452 (derived-mode-p 'text-mode) 457 (derived-mode-p 'text-mode)
453 (or (eq last-command-event ?\`) 458 (or (eq last-command-event ?\`)