From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alan Mackenzie <acm@muc.de>
Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org
Subject: Re: Emacs revision #107149
Date: Sun, 12 Feb 2012 21:42:59 +0100 [thread overview]
Message-ID: <87zkcnhjfw.fsf@gnus.org> (raw)
In-Reply-To: <20120211195927.GA3969@acm.acm> (Alan Mackenzie's message of "Sat, 11 Feb 2012 19:59:27 +0000")
Alan Mackenzie <acm@muc.de> writes:
> You cannot get away with this. These hooks belong to the major mode (or
> perhaps the user), and if you arbitrarily inhibit them, then font lock,
> in the general case, will not be fully initialised.
As Wolfgang Jenkner said, I think it has something to do with disabling
the delayed fontification modes. But I'm not actually sure -- the code
has been that way forever, and I probably didn't write it.
> Again, why are you breaking these hook calls? This seems to be a very
> bad solution to whatever the problem was.
It works for all modes tested, except C mode, apparently.
>> Is there any reason why `c-standard-font-lock-fontify-region-function'
>> is nil, when this makes just calling `(font-lock-fontify-buffer)' not
>> work?
>
> font-lock-fontify-region will work fine if you just initialise font lock
> fully. That involves running the hook.
So there is no reason?
> Setting that variable to font-lock-default-fontify-region at build time
> couples CC Mode and font lock mode too closely. In particular, it will
> prevent CC Mode loading on any system in which font lock is not present.
What systems would this be?
As far as I can tell from the cc-mode code, `c-font-lock-fontify-region'
unconditionally calls `c-standard-font-lock-fontify-region-function'.
Furthermore, `c-standard-font-lock-fontify-region-function' doesn't seem
to be set to anything other than `(default-value
'font-lock-fontify-region-function)'. And the variable is not a
user-level variable, which seems to make the entire tap-dance routine
here rather ... odd.
Why not just call `(default-value 'font-lock-fontify-region-function)'
unconditionally?
--
(domestic pets only, the antidote for overdose, milk.)
http://lars.ingebrigtsen.no * Sent from my Rome
next prev parent reply other threads:[~2012-02-12 20:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 23:20 Emacs revision #107149 Alan Mackenzie
2012-02-11 15:56 ` Lars Ingebrigtsen
2012-02-11 18:07 ` Wolfgang Jenkner
2012-02-11 19:59 ` Alan Mackenzie
2012-02-12 20:42 ` Lars Ingebrigtsen [this message]
2012-02-12 22:22 ` Alan Mackenzie
2012-02-13 1:00 ` Wolfgang Jenkner
2012-02-13 21:35 ` Alan Mackenzie
2012-02-13 3:15 ` Stefan Monnier
2012-02-13 21:42 ` Alan Mackenzie
2012-02-13 22:18 ` Stefan Monnier
2012-02-13 21:03 ` Lars Ingebrigtsen
2012-02-13 22:07 ` Alan Mackenzie
2012-02-20 9:51 ` Lars Ingebrigtsen
2012-02-21 15:16 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zkcnhjfw.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=acm@muc.de \
--cc=bug-cc-mode@gnu.org \
--cc=emacs-devel@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.