From: martin rudalics <rudalics@gmx.at>
Cc: AMackenzie@harmanbecker.com,
Stefan Monnier <monnier@iro.umontreal.ca>,
emacs-devel@gnu.org
Subject: Re: AW: font-locking and open parens in column 0
Date: Sun, 12 Nov 2006 20:45:03 +0100 [thread overview]
Message-ID: <455779BF.8050802@gmx.at> (raw)
In-Reply-To: <E1Gj7gC-0000mI-PG@fencepost.gnu.org>
> However, I did not realize that CC mode actually used that case. I
> thought it had a beginning-of-defun-function. I was surprised just
> now to see that it didn't have one. Perhaps that should be changed.
I've been asking before why c-mode cannot use `c-beginning-of-defun'
here. Is it because syntax-table properties haven't been set up? I
recall invoking `c-beginning-of-defun' in arbitrary not yet fontified
text and getting strange results.
> However, taking out the use of syntax-ppss in beginning-of-defun-raw
> isn't the right way to get good behavior in CC mode. That would only
> make it parse from the start of the file every time.
When scrolling through a buffer backwards, the current patch will cause
parsing from bob every time I scroll.
> (In any case, such a problem won't arise in Emacs Lisp mode, since
> open-paren-in-column-0-is-defun-start = t.)
`open-paren-in-column-0-is-defun-start' is a user option.
> A reliable way to get behavior 1 is to use syntax-ppss rather than
> beginning-of-defun.
>
> That is a good point. Maybe some uses of beginning-of-defun
> (such as in Font Lock) ought to use syntax-ppss instead.
This would introduce a circular dependency since `syntax-ppss' may call
`beginning-of-defun'.
> The proposed patch basically tries to make beginning-of-defun follow the
> behavior number 1 and to make it do so reliably.
>
> I don't see it that way.
I see it Stefan's way.
next prev parent reply other threads:[~2006-11-12 19:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 8:44 AW: font-locking and open parens in column 0 Mackenzie, Alan
2006-11-03 14:02 ` martin rudalics
2006-11-03 14:14 ` Stefan Monnier
2006-11-04 6:38 ` AW: " Richard Stallman
2006-11-10 17:49 ` Stefan Monnier
2006-11-11 2:11 ` Richard Stallman
2006-11-11 4:52 ` Stefan Monnier
2006-11-12 5:14 ` Richard Stallman
2006-11-12 5:14 ` Richard Stallman
2006-11-12 19:45 ` martin rudalics [this message]
2006-11-13 17:16 ` 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=455779BF.8050802@gmx.at \
--to=rudalics@gmx.at \
--cc=AMackenzie@harmanbecker.com \
--cc=emacs-devel@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.
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.