[Top][All Lists]

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

Re: AW: font-locking and open parens in column 0

From: Stefan Monnier
Subject: Re: AW: font-locking and open parens in column 0
Date: Fri, 10 Nov 2006 12:49:40 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (gnu/linux)

>        Normally a defun starts when there is a char with open-parenthesis
>        syntax at the beginning of a line.

> The purpose of open-paren-in-column-0-is-defun-start is to enable to
> disable this heuristic.  Setting it to nil disables the heuristic.
> So I think his change is correct.

Huh?  What do you mean by "heuristic".  The definition of
beginning-of-defun has never used syntax-tables or anything like that.
E.g. when defun-prompt-regexp is used it doesn't pay attention to
syntax-tables either.

open-paren-in-column-0-is-defun-start is only used as a heuristic in
syntax.c when skipping backward over comment.

There's another related heuristic, which is the use of beginning-of-defun
for syntax-begin-function.  This one is a heuristic specifically because
beginning-of-defun only works with regexps.  If we make beginning-of-defun
aware of strings and comments, then we'll have to warn every coder who uses
it in syntax-begin-function that it's not a good heuristic any more
(especially if beginning-of-defun uses syntax-ppss in which case we may get
into inf-loops).


reply via email to

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