unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Tassilo Horn <tsdh@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: Migrating from font-lock-syntactic-keywords to syntax-propertize-function
Date: Tue, 12 May 2020 16:44:10 +0300	[thread overview]
Message-ID: <c248e292-4688-f1bb-9562-05e108613b51@yandex.ru> (raw)
In-Reply-To: <87sgg51msg.fsf@gnu.org>

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	other threads:[~2020-05-12 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 10:15 Migrating from font-lock-syntactic-keywords to syntax-propertize-function Tassilo Horn
2020-05-12 13:44 ` Dmitry Gutov [this message]
2020-05-12 22:17   ` Tassilo Horn
2020-05-14  9:56     ` Tassilo Horn
2020-05-12 14:49 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c248e292-4688-f1bb-9562-05e108613b51@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).