unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <jwv7deq7wgz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: CALTqLibsYwzZH5XJVHrGGAHNt5g=WGTsarX3E15vNT0VbB2uPA@mail.gmail.com

> 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




  reply	other threads:[~2021-10-06  1:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  3:54 When is a syntax-propertize-function called when parse-sexp-lookup-properties is t for a current buffer? Pierre Rouleau
2021-10-05  4:15 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05 12:00   ` Pierre Rouleau
2021-10-05 12:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-10-05 13:48   ` Pierre Rouleau
2021-10-05 14:57     ` Stefan Monnier
2021-10-05 15:36       ` Pierre Rouleau
2021-10-05 17:29         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05 18:45           ` Pierre Rouleau
2021-10-05 19:08             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05 19:42               ` Pierre Rouleau
2021-10-05 19:41         ` Stefan Monnier
     [not found]           ` <CALTqLiab4AZx=fn1wX1ovckxFtie9C20O=qZFYTLyQNKWfWZGg@mail.gmail.com>
2021-10-05 20:05             ` Fwd: " Pierre Rouleau
2021-10-05 20:17           ` Pierre Rouleau
2021-10-06  1:55             ` Stefan Monnier via Users list for the GNU Emacs text editor [this message]
2021-10-06  2:46               ` Pierre Rouleau

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=jwv7deq7wgz.fsf-monnier+emacs@gnu.org \
    --to=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).