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

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

When is a syntax-propertize-function called when parse-sexp-lookup-prope


From: Pierre Rouleau
Subject: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?
Date: Mon, 4 Oct 2021 23:54:23 -0400

Hi

I'm trying to modify the behaviour of erlang.el erlang-mode wrt. the
handling of
binaries in order to get forward-sexp and friends to handle << >> pair
matching.

I have been trying to add something like the following in the code and also
trying to put embedded message calls or even error calls to be able to see
when the function gets called.  So far I did not see it called.

``` lisp
 (defconst erlang-mode-syntax-propertize-function
    (syntax-propertize-rules
     ("\\(<\\)<" (1 "(>"))
     (">\\(>\\)" (2 ")<")))
    "Syntax properties to activate << >> pairing.")
  (setq-local parse-sexp-lookup-properties t)
  (setq-local syntax-propertize-function
              erlang-mode-syntax-propertize-function)
```
I most probably don't understand the mechanism.
I expanded the macro above to see the generated code
which makes sense, and read all I could find on Emacs syntax properties,
text properties, stickiness, etc..

What I'd like to understand is what calls the generated function, providing
it
the 2 arguments (start & end) and when should it be called.

Are these calls protected against error so I can't see them if they occur?

Thanks

/Pierre



-- 
/Pierre


reply via email to

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