help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Migrating from font-lock-syntactic-keywords to syntax-propertize-fun


From: Dmitry Gutov
Subject: Re: Migrating from font-lock-syntactic-keywords to syntax-propertize-function
Date: Tue, 12 May 2020 16:44:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 12.05.2020 13:15, Tassilo Horn wrote:
   (setq-local syntax-propertize-function
               (my-make-syntax-propertize-function))

This will be

  (setq-local syntax-propertize-function
              #'my-make-syntax-propertize-function)

2. Some of my syntax rules are not static, so I cannot provide a fixed
    set of rules to `syntax-propertize-rules'.  Is there anything better
    than using `eval' like

      (defun my-make-syntax-propertize-function ()
        (eval
         `(syntax-propertize-rules
           ,@(mapcar
              #'my-convert-legacy-syntactic-keywords
              (my-compute-syntactic-keywords)))))

    or should I prefer writing a manual `syntax-propertize-function'?

syntax-propertize-rules can have elisp code inside, just like font-lock-keywords. See js-syntax-propertize as one example.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]