[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use of `mouse-face' to delimit text zones

From: Stefan Monnier
Subject: Re: use of `mouse-face' to delimit text zones
Date: Tue, 23 Aug 2011 15:22:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> > How is Joe R. Hacker supposed to know that adding invisible characters
>> > to a portion of text covered by mouse-face will break completion??
>> We're talking about a property added *by the completion code* and *for
>> the completion code*.  I.e. an internal use.
> Not entirely true: when the mouse hovers above those parts of the
> *Completions* buffer, the candidate under the mouse gets highlighted.
> By contrast, a face added for internal purposed would be invisible to
> the user.

The completion code wants to add a mouse-face property so it gets
highlighted when the mouse hovers above it, yes.  That's not an
internal detail.  The internal detail is "how does it figure out the
element boundaries": the fact that it uses the mouse-face property for
that is an internal detail.

>> Joe R. Hacker doesn't need to know about it unless he actually hacks
>> on the code that handles minibuffer-completion-help.
> Guess what? he just did.

Luckily he sent his code for review, so someone knowledgeable in the
relevant code pointed out the pitfall he was about to fall into.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]