From: "Drew Adams" <drew.adams@oracle.com>
To: "'Fan'" <gnu.emacs.fan@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Need Help on Whitespace-mode in Emacs 24.1.1
Date: Sun, 26 Aug 2012 16:31:08 -0700 [thread overview]
Message-ID: <4D9E5ABD8CAF433E8B8C4D3694F4E492@us.oracle.com> (raw)
In-Reply-To: <813A428BC67F43078FBEBABF365F0224@us.oracle.com>
> > > http://www.emacswiki.org/emacs/download/font-menus-da.el
> >
> > Thanks, Drew. It works like a charm. I now can have my cake
> > and eat it too. :)
>
> Hm. I don't think it works like a charm yet. So far, what I
> uploaded does not work with recent Emacs versions (at least on
> Windows). But I will soon upload something that does work.
> So stay tuned.
FYI - Should be OK now.
---
La petite histoire -
Font lock has changed a _lot_ since Emacs 21 (the last version for which this
code really worked, until now).
Among other things, in recent Emacs versions, `font-lock-set-defaults', the
function that is advised here, is called a zillion times when you turn on
font-locking, and most of those calls are in places outside the context that
should be advised here (i.e., within function `font-lock-fontify-level').
The result was that you could go down font-lock levels but you could not go back
up. `font-lock-set-menu' was getting called (many times) outside the context
where `font-lock-maximum-decoration' was bound to the new level, so the level
was being treated as if it were `t' (maximum).
In Emacs 20/21, `font-lock-set-menu' was called only once. Now it is called
many times in the course of switching levels (once). Even by doing nothing for
most of those calls (since they are outside `font-lock-fontify-level', I make
them no-ops), it is still the case that the code gets repeated three times
(IIRC). Not a big deal, but no doubt a slight waste. At least it works again.
---
BTW, as I tried to explain on emacs-devel today, you need not treat the
so-called "levels" as levels of an amount of highlighting. You can treat them
as just different highlighting patterns (not necessarily more or less
highlighting).
IOW, you can cycle among "levels" 1, 2, 3, etc., but that need not mean
increasing or decreasing the amount of highlighting. Think of the 1, 2, 3, etc.
the way you would think of switching among desktops or window configurations
that are numbered 1, 2, 3, etc.: they're just alternatives you can choose.
prev parent reply other threads:[~2012-08-26 23:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-26 3:15 Need Help on Whitespace-mode in Emacs 24.1.1 Fan
2012-08-26 8:17 ` Peter Dyballa
[not found] ` <mailman.7595.1345969075.855.help-gnu-emacs@gnu.org>
2012-08-26 14:46 ` Fan
2012-08-26 15:04 ` Peter Dyballa
2012-08-26 15:17 ` Drew Adams
2012-08-26 15:57 ` Peter Dyballa
2012-08-26 16:20 ` Drew Adams
2012-08-26 16:22 ` Drew Adams
[not found] ` <mailman.7604.1345994243.855.help-gnu-emacs@gnu.org>
2012-08-26 22:45 ` Fan
2012-08-26 22:54 ` Drew Adams
2012-08-26 23:31 ` Drew Adams [this message]
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=4D9E5ABD8CAF433E8B8C4D3694F4E492@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=gnu.emacs.fan@gmail.com \
--cc=help-gnu-emacs@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.