[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 16:57:41 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 17/04/2020 16.14, Stefan Monnier wrote:
>> (with-current-buffer (get-buffer-create "button")
>>   (insert (propertize "[" 'display '(when (display-graphic-p 
>> (selected-frame)) . "")))
>>   (insert (propertize "button" 'face 'my-button))
>>   (insert (propertize "]" 'display '(when (display-graphic-p 
>> (selected-frame)) . ""))))
> My guess is that the (selected-frame) at the time the code is run might
> not be the one you think.  Maybe we should change/fix that (we had the
> same problem when computing the mode/header lines).

Doesn't look like it, from this test:

(with-current-buffer (get-buffer-create "button")
  (insert (propertize "[" 'display '(when (and (message "[%f] On frame %S: %S"
(selected-frame))) . "graphic")))
  (insert (propertize "button" 'face 'my-button))
  (insert (propertize "]" 'display '(when (display-graphic-p (selected-frame)) 
. ""))))

Clicking in the graphical frame reevaluates in both, and the terminal one does 
see nil.  Clicking in the terminal frame reevaluates only there.  In both cases 
the display is updated in all windows (on all frames).

reply via email to

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