emacs-devel
[Top][All Lists]
Advanced

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

Semantics of font-lock-beginning-of-syntax-function


From: Martin Stjernholm
Subject: Semantics of font-lock-beginning-of-syntax-function
Date: 09 Jun 2002 15:50:47 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

The docstring for font-lock-beginning-of-syntax-function says:

    Non-nil means use this function to move back outside of a
    syntactic block.  When called with no args it should leave point
    at the beginning of any enclosing syntactic block.

I'd like to know what - exactly - "syntactic block" means here. How is
this function used, and what assumptions does the code that uses it
have on the target position? A couple of guesses I've made more or
less out of the blue are:

o  The point should be outside any comment or string literal.
o  The point should be no later than the beginning of the current
   line.

The word "block" suggests that it also should be at the beginning of a
programmatic block, i.e. a paren sexp in C and similar languages. If
so, why does font-lock need that? Afaics it doesn't operate on the
structural level at all. Not knowing all the details, I thought it'd
be enough to go to any preceding position that's outside comments and
string literals.

If I interpret the second sentence correctly, it should move to (at
least) the beginning of the outermost enclosing block. When and why is
it necessary to move that far? Many times (e.g. in Java code) that's
almost as bad as the beginning of the buffer since there might very
well be a single class surrounding all the code in a file.





reply via email to

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