unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Andreas Schwab <schwab@suse.de>, emacs-devel@gnu.org
Subject: Re: Fight: font-lock.el 1.289 vs. cc-defs.el
Date: Sun, 29 Jan 2006 23:33:41 -0500	[thread overview]
Message-ID: <87fyn62vre.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <Pine.LNX.3.96.1060129172112.428F-100000@acm.acm> (Alan Mackenzie's message of "Sun, 29 Jan 2006 17:28:02 +0000 (GMT)")

> CC Mode calls (font-lock-compile-keywords "\\<\\>") at initialisation, to
> test for a bug in middle aged XEmacsen which splatted font-lock-keywords.
> The new check in V1.289 causes CC Mode to bail out with an error.

I must admit I have very little sympathy for ugly code that tries to work
around old bugs that've been fixed a long time ago.

> Andreas Schwab patched a work-around into cc-defs.el V1.38, placing a
> condition-case around the call.  This seems suboptimal: If some error
> occurs whilst calling some Font Lock function, we definitely want to know
> about it.

> A better(??) kludge would be for cc-defs to bind font-lock-set-defaults
> to non-nil before calling (font-lock-compile-keywords "\\<\\>"), but this
> is really ghastly coding practise.

So a better/real fix would be to remove this workaround altogether and if
someone complains, tell him to fix it himself or upgrade his old XEmacs or
stick to an old cc-mode.  Plenty of choice left.

> I'm asking that this change to font-lock.el be reconsidered, though I
> admit I don't know the problem it fixes.

It help(s|ed) detect faulty code, more precisely code that used font-lock
code without first setting up font-lock variables.  I guess with the recent
changes that force font-lock-fontify-buffer and font-lock-fontify-region to
setup the variables, this is not needed any more, since those were the
main culprits.

> Might a better solution be (make-variable-buffer-local
> 'font-lock-keywords)?

That would only hide the problem.  Calling font-lock-set-defaults does a lot
more than make this variable local to a buffer.

> That variable surely _cannot_ have a meaningful global value - or can it?

Indeed.


        Stefan

  reply	other threads:[~2006-01-30  4:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-29 17:28 Fight: font-lock.el 1.289 vs. cc-defs.el Alan Mackenzie
2006-01-30  4:33 ` Stefan Monnier [this message]
2006-01-30 14:01   ` Alan Mackenzie
2006-01-30 18:46 ` Richard M. Stallman
2006-01-31 14:13   ` Alan Mackenzie

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87fyn62vre.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@suse.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).