[Top][All Lists]

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

Re: "Why is emacs so square?"

From: Clément Pit-Claudel
Subject: Re: "Why is emacs so square?"
Date: Fri, 17 Apr 2020 13:57:05 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 17/04/2020 13.45, Eli Zaretskii wrote:
>> Cc: address@hidden
>> From: Clément Pit-Claudel <address@hidden>
>> Date: Fri, 17 Apr 2020 13:40:29 -0400
>> There is a way to change the color, backgorund, etc. of a bit of text 
>> depending on the properties of the display it is on, through the face-specs 
>> of defface.  Is there a similar facility for showing or hiding a piece of 
>> text depending on properties of the frame it's shown on?  I tried using a 
>> conditional 'display property, but that doesn't seem to work.
> I don't think I understand the problem.  Faces can have different
> definitions on different frames, so what is the problem, exactly?

The problem is to indicate that a string is a button on a text terminal.  
Currently, custom does this by writing the string "[button]" with an underline 
on text terminals, and "button" with a raised look on graphical terminals.

This is done by inserting different text in the buffer depending on whether the 
display supports the `:box' face property.  Because of this, a customization 
buffer created on a text terminal shows "[button]" instead of "button" when 
displayed on a graphical terminal.

The question is: is there a way to insert something in a buffer that will 
display as "[button]" when shown on a text terminal and as "button" when shown 
on a graphical terminal?
I thought of using something like (propertize "[" 'display '(when 
(display-graphic-p) . "")), but it doesn't work well: when the buffer is shown 
on two frames (one graphical, one non-graphical), it doesn't look right in both.

reply via email to

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