all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Martin Stjernholm <mast@lysator.liu.se>
Subject: Semantics of font-lock-beginning-of-syntax-function
Date: 09 Jun 2002 15:50:47 +0200	[thread overview]
Message-ID: <5bzny44l3c.fsf@lister.roxen.com> (raw)

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	other threads:[~2002-06-09 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-09 13:50 Martin Stjernholm [this message]
2002-06-10 14:51 ` Semantics of font-lock-beginning-of-syntax-function Stefan Monnier
2002-06-10 21:49   ` Thien-Thi Nguyen
2002-06-10 21:51     ` 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

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

  git send-email \
    --in-reply-to=5bzny44l3c.fsf@lister.roxen.com \
    --to=mast@lysator.liu.se \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.