diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/electric.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/electric.el b/lisp/electric.el index 96c805bb5fb..a71e79ff78a 100644 --- a/lisp/electric.el +++ b/lisp/electric.el | |||
| @@ -469,20 +469,20 @@ This requotes when a quoting key is typed." | |||
| 469 | (and (not electric-quote-context-sensitive) | 469 | (and (not electric-quote-context-sensitive) |
| 470 | (eq last-command-event ?\`))) | 470 | (eq last-command-event ?\`))) |
| 471 | (not (run-hook-with-args-until-success | 471 | (not (run-hook-with-args-until-success |
| 472 | 'electric-quote-inhibit-functions))) | 472 | 'electric-quote-inhibit-functions)) |
| 473 | (if (and comment-start comment-use-syntax) | 473 | (if (derived-mode-p 'text-mode) |
| 474 | (when (or electric-quote-comment electric-quote-string) | 474 | electric-quote-paragraph |
| 475 | (let* ((syntax (syntax-ppss)) | 475 | (and comment-start comment-use-syntax |
| 476 | (beg (nth 8 syntax))) | 476 | (or electric-quote-comment electric-quote-string) |
| 477 | (and beg | 477 | (let* ((syntax (syntax-ppss)) |
| 478 | (or (and electric-quote-comment (nth 4 syntax)) | 478 | (beg (nth 8 syntax))) |
| 479 | (and electric-quote-string (nth 3 syntax))) | 479 | (and beg |
| 480 | ;; Do not requote a quote that starts or ends | 480 | (or (and electric-quote-comment (nth 4 syntax)) |
| 481 | ;; a comment or string. | 481 | (and electric-quote-string (nth 3 syntax))) |
| 482 | (eq beg (nth 8 (save-excursion | 482 | ;; Do not requote a quote that starts or ends |
| 483 | (syntax-ppss (1- (point))))))))) | 483 | ;; a comment or string. |
| 484 | (and electric-quote-paragraph | 484 | (eq beg (nth 8 (save-excursion |
| 485 | (derived-mode-p 'text-mode)))) | 485 | (syntax-ppss (1- (point))))))))))) |
| 486 | (pcase electric-quote-chars | 486 | (pcase electric-quote-chars |
| 487 | (`(,q< ,q> ,q<< ,q>>) | 487 | (`(,q< ,q> ,q<< ,q>>) |
| 488 | (save-excursion | 488 | (save-excursion |