aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-05-02 10:46:53 -0700
committerPaul Eggert2016-05-02 10:46:53 -0700
commit2bf7bc4161a3b3e1eceaf8422773de87ae233ea3 (patch)
treed17e0d30b08dc696fa30cb3eec8673841eddef0a
parentd05806fda1cbba2db112bc783597fbe9d27175b2 (diff)
parentbf21c84f0d3dab33b4836098b789eaddf9492b2a (diff)
downloademacs-2bf7bc4161a3b3e1eceaf8422773de87ae233ea3.tar.gz
emacs-2bf7bc4161a3b3e1eceaf8422773de87ae233ea3.zip
Merge from origin/emacs-25
bf21c84 Fix quoting problem in cc-engine debug message 8f36614 Add electric-quote-string unit test 6280531 Don’t electrically quote ‘'’ in Python fd7b430 `nreverse' Grep hits before passing them to xref--convert-hits
-rw-r--r--lisp/electric.el11
-rw-r--r--lisp/progmodes/cc-engine.el2
-rw-r--r--lisp/progmodes/xref.el2
-rw-r--r--test/lisp/electric-tests.el8
4 files changed, 18 insertions, 5 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 ?\`)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 76a0b201816..d19d2dacda1 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -3527,7 +3527,7 @@ comment at the start of cc-engine.el for more info."
3527 c-state-old-cpp-end 3527 c-state-old-cpp-end
3528 c-parse-state-point)))) 3528 c-parse-state-point))))
3529(defun c-replay-parse-state-state () 3529(defun c-replay-parse-state-state ()
3530 (message 3530 (message "%s"
3531 (concat "(setq " 3531 (concat "(setq "
3532 (mapconcat 3532 (mapconcat
3533 (lambda (arg) 3533 (lambda (arg)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index f674c70b104..b5632af13ab 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -902,7 +902,7 @@ IGNORES is a list of glob patterns."
902 (match-string 1) 902 (match-string 1)
903 (buffer-substring-no-properties (point) (line-end-position))) 903 (buffer-substring-no-properties (point) (line-end-position)))
904 hits))) 904 hits)))
905 (xref--convert-hits hits regexp))) 905 (xref--convert-hits (nreverse hits) regexp)))
906 906
907(defun xref--rgrep-command (regexp files dir ignores) 907(defun xref--rgrep-command (regexp files dir ignores)
908 (require 'find-dired) ; for `find-name-arg' 908 (require 'find-dired) ; for `find-name-arg'
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 107b2e79fb6..afd707667b8 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -584,5 +584,13 @@ baz\"\""
584 (skip-chars-backward "\"") 584 (skip-chars-backward "\"")
585 (mark-sexp -1))) 585 (mark-sexp -1)))
586 586
587
588;;; Electric quotes
589(define-electric-pair-test electric-quote-string
590 "" "'" :expected-string "'" :expected-point 2
591 :fixture-fn #'electric-quote-local-mode
592 :bindings '((electric-quote-string . t))
593 :test-in-comments nil :test-in-strings nil)
594
587(provide 'electric-tests) 595(provide 'electric-tests)
588;;; electric-tests.el ends here 596;;; electric-tests.el ends here