[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: When is a syntax-propertize-function called when parse-sexp-lookup-p
From: |
Stefan Monnier |
Subject: |
Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer? |
Date: |
Tue, 05 Oct 2021 21:55:23 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> 1 -> (my-syntax-propertize 980 1555)
> 1 <- my-syntax-propertize: nil
> ======================================================================
> 1 -> (my-syntax-propertize 980 1556)
> 1 <- my-syntax-propertize: nil
> ======================================================================
> 1 -> (my-syntax-propertize 1043 1616)
> 1 <- my-syntax-propertize: nil
> ======================================================================
> 1 -> (my-syntax-propertize 1043 1617)
> 1 <- my-syntax-propertize: nil
So, IIUC even though the function is called, the relevant char doesn't
get the corresponding `syntax-table` text property?
Maybe the major-mode is getting in the way?
You can try to use:
(defun my-syntax-propertize (beg end)
(funcall
(syntax-propertize-rules
("\\(<\\)<"
(1 (progn
(message "OPEN at %S" (match-beginning 1))
(string-to-syntax "(>")))))
(">\\(>\\)"
(1 (progn
(message "CLOSE at %S" (match-beginning 1))
(string-to-syntax "(>")))))
beg end))
Then check your *Messages* buffer to see where the function placed the
property, then look at these positions (e.g. with `C-u C-x =`) to see if
the `syntax-table` text property is still present.
If the property is absent (i.e. has been removed after your function
added it), then you may want to check your `syntax-propertize-function`
and search for `syntax-table` in erlong-mode's code to see what might be
interfering (e.g. maybe this property is added to
`font-lock-extra-properties`?).
Stefan
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, (continued)
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Stefan Monnier, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Emanuel Berg, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Emanuel Berg, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Stefan Monnier, 2021/10/05
- Message not available
- Fwd: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?,
Stefan Monnier <=
- Re: When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer?, Pierre Rouleau, 2021/10/05