From 499f5f062efa031228dc20c5153849151f7a7614 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 6 May 2022 22:13:41 +0200 Subject: [PATCH] Make elisp-mode-syntax-propertize tighter to reflect syntax * lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize): ?\N and #s are case sensitive, so don't case-fold. (And adjust regexps.) --- lisp/progmodes/elisp-mode.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0b647d247b9..775b6ebab47 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -239,22 +239,23 @@ Comments in the form will be lost." (defun elisp-mode-syntax-propertize (start end) (goto-char start) - (funcall - (syntax-propertize-rules - ;; Empty symbol. - ("##" (0 (unless (nth 8 (syntax-ppss)) - (string-to-syntax "_")))) - ;; Unicode character names. (The longest name is 88 characters - ;; long.) - ("\\?\\\\N{[-A-Z ]\\{,88\\}}" - (0 (unless (nth 8 (syntax-ppss)) - (string-to-syntax "_")))) - ((rx "#" (or (seq (group-n 1 "&" (+ digit)) ?\") ; Bool-vector. - (seq (group-n 1 "s") "(") ; Record. - (seq (group-n 1 (+ "^")) "["))) ; Char-table. - (1 (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) - (string-to-syntax "'"))))) - start end)) + (let ((case-fold-search nil)) + (funcall + (syntax-propertize-rules + ;; Empty symbol. + ("##" (0 (unless (nth 8 (syntax-ppss)) + (string-to-syntax "_")))) + ;; Unicode character names. (The longest name is 88 characters + ;; long.) + ("\\?\\\\N{[-A-Za-z0-9 ]\\{,100\\}}" + (0 (unless (nth 8 (syntax-ppss)) + (string-to-syntax "_")))) + ((rx "#" (or (seq (group-n 1 "&" (+ digit)) ?\") ; Bool-vector. + (seq (group-n 1 "s") "(") ; Record. + (seq (group-n 1 (+ "^")) "["))) ; Char-table. + (1 (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0)))) + (string-to-syntax "'"))))) + start end))) (defcustom emacs-lisp-mode-hook nil "Hook run when entering Emacs Lisp mode." -- 2.39.2