all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dan.colascione@gmail.com>
To: 8925@debbugs.gnu.org
Cc: zooko@zooko.com
Subject: bug#8925: 23.2; all syntax highlighting disappears from ERC mode when I M-x toggle-show-tabs-show-ws
Date: Sat, 25 Jun 2011 10:34:53 -0700	[thread overview]
Message-ID: <4E061C3D.4080109@gmail.com> (raw)
In-Reply-To: <xhr56i901d.fsf@fencepost.gnu.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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)

iEUEARECAAYFAk4GHDsACgkQ17c2LVA10VuN3QCVEPDiJxaS9d5q2nBtIzzLL31I
zACg126suj9jFjrv9hgOXvf1SfqCiBs=
=pfdM
-----END PGP SIGNATURE-----






  reply	other threads:[~2011-06-25 17:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24  4:56 bug#8925: 23.2; all syntax highlighting disappears from ERC mode when I M-x toggle-show-tabs-show-ws Zooko O'Whielacronx
2011-06-25  1:23 ` Glenn Morris
2011-06-25 17:34   ` Daniel Colascione [this message]
2011-06-26 12:59   ` Stefan Monnier

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=4E061C3D.4080109@gmail.com \
    --to=dan.colascione@gmail.com \
    --cc=8925@debbugs.gnu.org \
    --cc=zooko@zooko.com \
    /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.