[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8925: 23.2; all syntax highlighting disappears from ERC mode when I
bug#8925: 23.2; all syntax highlighting disappears from ERC mode when I M-x toggle-show-tabs-show-ws
Sat, 25 Jun 2011 10:34:53 -0700
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:18.104.22.168) Gecko/20110616 Thunderbird/3.1.11
-----BEGIN PGP SIGNED MESSAGE-----
On 6/24/11 6:23 PM, Glenn Morris wrote:
> "Zooko O'Whielacronx" wrote:
>> ERC normally shows all sorts of useful information by changing the
>> fonts, for example, nicks are in different colors. However recently I
>> ran M-x toggle-show-tabs-show-ws, and now when I start an ERC buffer
>> (for example by joining a new IRC channel), it shows the normal
>> syntax-highlighted view, but then whenever I hit a key (or maybe
>> whenever someone else posts a message to the channel? I'm not sure) all
>> the syntax highlighting disappears, and it becomes a very boring black
>> and white rendering of the channel.
> Probably you should report this to the authors of whatever package
> provides the function `toggle-show-tabs-show-ws' (it's not part of Emacs).
The problem is more general. ERC inserts strings with face properties
into its buffer. When _anything_ that uses font-lock also runs in this
buffer, font-lock will clear all face attributes and undo ERC's
highlighting. This highlighting can't be easily reconstructed because it
depends on information no longer present in the buffer, such as the
membership list of a channel at the time a particular message was received.
There are two approaches to solving the issue:
1) Have ERC use overlays instead of text properties for its highlighting, or
2) Transform ERC face properties to another property (e.g., erc-face),
and create a custom font-lock matcher that applies the highlights stored
in these erc-face properties to face, allowing the highlighting scheme
to be reconstructed on demand.
The first is arguably cleaner, but without setting face, text yanked to
another buffer from an ERC buffer will be unhighlighted.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
-----END PGP SIGNATURE-----