From 7109307c1a62fb3ab781989d495bacd3c2b15a2e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 11 Mar 2021 21:47:10 -0500 Subject: * lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Use `macroexp-let2` This also silences the recently introduced compilation warning. --- lisp/emacs-lisp/syntax.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/syntax.el') diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index bee2f9639e7..6d5b04b83bb 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -290,12 +290,13 @@ all RULES in total." ',(string-to-syntax (nth 1 action))) ,@(nthcdr 2 action)) `((let ((mb (match-beginning ,gn)) - (me (match-end ,gn)) - (syntax ,(nth 1 action))) - (if syntax - (put-text-property - mb me 'syntax-table syntax)) - ,@(nthcdr 2 action))))) + (me (match-end ,gn))) + ,(macroexp-let2 nil syntax (nth 1 action) + `(progn + (if ,syntax + (put-text-property + mb me 'syntax-table ,syntax)) + ,@(nthcdr 2 action))))))) (t `((let ((mb (match-beginning ,gn)) (me (match-end ,gn)) -- cgit v1.2.3 From 3988411f6c6a1170bca0831874233ff4b739009c Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 30 May 2021 22:38:48 +0200 Subject: Give 'syntax-propertize-wholelines' a docstring. This function is generally useful. * lisp/emacs-lisp/syntax.el (syntax-propertize-wholelines): Add docstring. --- lisp/emacs-lisp/syntax.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp/emacs-lisp/syntax.el') diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 6d5b04b83bb..0bb1b8916b1 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -125,6 +125,10 @@ otherwise nil. That construct can be a two character comment delimiter or an Escaped or Char-quoted character.")) (defun syntax-propertize-wholelines (start end) + "Extend the region delimited by START and END to whole lines. +This function is useful for +`syntax-propertize-extend-region-functions'; +see Info node `(elisp) Syntax Properties'." (goto-char start) (cons (line-beginning-position) (progn (goto-char end) -- cgit v1.2.3