all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
Cc: Alan Mackenzie <acm@muc.de>, Richard Stallman <rms@gnu.org>,
	emacs-devel@gnu.org
Subject: Re: font-locking and open parens in column 0
Date: Sat, 04 Nov 2006 10:30:09 +0100	[thread overview]
Message-ID: <454C5DA1.70608@gmx.at> (raw)
In-Reply-To: <DA6197CAE190A847B662079EF7631C0603407A8B@OEKAW2EXVS03.hbi.ad.harman.com>

 >> But I still think the
 >>"bug" is with the author who put the left paren in column zero of that
 >>comment.  That author should be warned just as in emacs-lisp-mode.
 >
 >
 > Should _HAVE_ been warned.  Martin Stjernholm has worked very hard to
 > remove that restriction from C Mode without sacrificing (much) speed.  It
 > would be a shame now to leave the restriction in Emacs 22.

Which means that Martin Stjernholm's change did not make it to
font-locking which, for c-mode, still uses the `beginning-of-defun' from
lisp-mode.  I see only two reasonable fixes to this:

(1) Set `syntax-begin-function' (or `beginning-of-defun-function') to
     `c-beginning-of-defun' if you trust that change.  This should,
     hopefully, populate your cache.

(2) Set `syntax-begin-function' to nil as Stefan suggested and let
     `syntax-ppss' do the work.  This should populate Stefan's cache.

Any other solution would be a shameful waste of resources since the
results of `parse-partial-sexp' from your original proposal don't get
stored anywhere (jumping to a position n in a c-mode buffer and
subsequently jumping to a position m < n would afford to rescan from
bob).  Also make sure that `font-lock-beginning-of-syntax-function'
nowhere interferes with these settings.

Ideally, there would be one and only one cache populated and consulted
by both - c-mode and `syntax-ppss'.

  parent reply	other threads:[~2006-11-04  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-03 16:19 font-locking and open parens in column 0 Mackenzie, Alan
2006-11-03 19:29 ` Stefan Monnier
2006-11-04 11:35   ` martin rudalics
2006-11-04  9:30 ` martin rudalics [this message]
2006-11-05  7:08 ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2006-11-03  8:44 AW: " Mackenzie, Alan
2006-11-03 14:14 ` Stefan Monnier
2006-11-02  8:49 Mackenzie, Alan
2006-11-02 18:31 ` martin rudalics

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=454C5DA1.70608@gmx.at \
    --to=rudalics@gmx.at \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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.