* Is Default face a per frame attribute or a global one?
@ 2014-08-24 23:29 Alexandros Prekates
2014-08-25 5:54 ` Alex Kost
0 siblings, 1 reply; 7+ messages in thread
From: Alexandros Prekates @ 2014-08-24 23:29 UTC (permalink / raw)
To: help-gnu-emacs
Continuing little experiments to better undestand the relation among
fonts, faces, frames etc, i noticed
that if i have 2 frames (A and B) and i evaluate from ielm in frame A
(set-frame-font "liberation serif" nil nil) . when i check the default
face's font i see different values in frame A from frame B.
So it seems that default face is a frame's variable.
i mean every frame has its own default face? Is that right?
Alexandros
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Is Default face a per frame attribute or a global one?
2014-08-24 23:29 Is Default face a per frame attribute or a global one? Alexandros Prekates
@ 2014-08-25 5:54 ` Alex Kost
2014-08-25 10:07 ` Alexandros Prekates
0 siblings, 1 reply; 7+ messages in thread
From: Alex Kost @ 2014-08-25 5:54 UTC (permalink / raw)
To: Alexandros Prekates; +Cc: help-gnu-emacs
Alexandros Prekates (2014-08-25 03:29 +0400) wrote:
> Continuing little experiments to better undestand the relation among
> fonts, faces, frames etc, i noticed
> that if i have 2 frames (A and B) and i evaluate from ielm in frame A
> (set-frame-font "liberation serif" nil nil) . when i check the default
> face's font i see different values in frame A from frame B.
>
> So it seems that default face is a frame's variable.
>
> i mean every frame has its own default face? Is that right?
As you can see after "C-h f set-frame-font":
“...
If FRAMES is nil, apply the font to the selected frame only.
...”
So the second nil in your expression means you set a font only for the
current frame A.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Is Default face a per frame attribute or a global one?
2014-08-25 5:54 ` Alex Kost
@ 2014-08-25 10:07 ` Alexandros Prekates
2014-08-25 12:03 ` Alex Kost
0 siblings, 1 reply; 7+ messages in thread
From: Alexandros Prekates @ 2014-08-25 10:07 UTC (permalink / raw)
To: Alex Kost; +Cc: help-gnu-emacs
On 25/08/2014 08:54 πμ, Alex Kost wrote:
> Alexandros Prekates (2014-08-25 03:29 +0400) wrote:
>
>> Continuing little experiments to better undestand the relation among
>> fonts, faces, frames etc, i noticed
>> that if i have 2 frames (A and B) and i evaluate from ielm in frame A
>> (set-frame-font "liberation serif" nil nil) . when i check the default
>> face's font i see different values in frame A from frame B.
>>
>> So it seems that default face is a frame's variable.
>>
>> i mean every frame has its own default face? Is that right?
> As you can see after "C-h f set-frame-font":
>
> “...
> If FRAMES is nil, apply the font to the selected frame only.
> ...”
>
> So the second nil in your expression means you set a font only for the
> current frame A.
>
>
So default face is not a global emacs session variable. It's an
attribute per frame.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Is Default face a per frame attribute or a global one?
2014-08-25 10:07 ` Alexandros Prekates
@ 2014-08-25 12:03 ` Alex Kost
2014-08-25 23:07 ` Alexandros Prekates
0 siblings, 1 reply; 7+ messages in thread
From: Alex Kost @ 2014-08-25 12:03 UTC (permalink / raw)
To: Alexandros Prekates; +Cc: help-gnu-emacs
Alexandros Prekates (2014-08-25 14:07 +0400) wrote:
> On 25/08/2014 08:54 πμ, Alex Kost wrote:
>> Alexandros Prekates (2014-08-25 03:29 +0400) wrote:
>>
>>> Continuing little experiments to better undestand the relation among
>>> fonts, faces, frames etc, i noticed
>>> that if i have 2 frames (A and B) and i evaluate from ielm in frame A
>>> (set-frame-font "liberation serif" nil nil) . when i check the default
>>> face's font i see different values in frame A from frame B.
>>>
>>> So it seems that default face is a frame's variable.
>>>
>>> i mean every frame has its own default face? Is that right?
>> As you can see after "C-h f set-frame-font":
>>
>> “...
>> If FRAMES is nil, apply the font to the selected frame only.
>> ...”
>>
>> So the second nil in your expression means you set a font only for the
>> current frame A.
>>
>>
> So default face is not a global emacs session variable. It's an
> attribute per frame.
I thought you were talking about frame fonts. AFAIU there is only one
‘default’ face (defined in "faces.el"), if that's what you mean.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Is Default face a per frame attribute or a global one?
2014-08-25 12:03 ` Alex Kost
@ 2014-08-25 23:07 ` Alexandros Prekates
2014-08-26 4:55 ` Alex Kost
0 siblings, 1 reply; 7+ messages in thread
From: Alexandros Prekates @ 2014-08-25 23:07 UTC (permalink / raw)
To: Alex Kost; +Cc: help-gnu-emacs
On 25/08/2014 03:03 μμ, Alex Kost wrote:
> Alexandros Prekates (2014-08-25 14:07 +0400) wrote:
>
>> On 25/08/2014 08:54 πμ, Alex Kost wrote:
>>> Alexandros Prekates (2014-08-25 03:29 +0400) wrote:
>>>
>>>> Continuing little experiments to better undestand the relation among
>>>> fonts, faces, frames etc, i noticed
>>>> that if i have 2 frames (A and B) and i evaluate from ielm in frame A
>>>> (set-frame-font "liberation serif" nil nil) . when i check the default
>>>> face's font i see different values in frame A from frame B.
>>>>
>>>> So it seems that default face is a frame's variable.
>>>>
>>>> i mean every frame has its own default face? Is that right?
>>> As you can see after "C-h f set-frame-font":
>>>
>>> “...
>>> If FRAMES is nil, apply the font to the selected frame only.
>>> ...”
>>>
>>> So the second nil in your expression means you set a font only for the
>>> current frame A.
>>>
>>>
>> So default face is not a global emacs session variable. It's an
>> attribute per frame.
> I thought you were talking about frame fonts. AFAIU there is only one
> ‘default’ face (defined in "faces.el"), if that's what you mean.
>
But the assumption that there is only one global default face
contradicts with what i see.
In two frames (of the same emacs session) M-x describe-face (default)
gives me different font families ( i changed in each frame the font with
set-frame-font.)
Alexandros
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Is Default face a per frame attribute or a global one?
2014-08-25 23:07 ` Alexandros Prekates
@ 2014-08-26 4:55 ` Alex Kost
2014-08-27 1:49 ` Alexandros Prekates
0 siblings, 1 reply; 7+ messages in thread
From: Alex Kost @ 2014-08-26 4:55 UTC (permalink / raw)
To: Alexandros Prekates; +Cc: help-gnu-emacs
Alexandros Prekates (2014-08-26 03:07 +0400) wrote:
> On 25/08/2014 03:03 μμ, Alex Kost wrote:
>> Alexandros Prekates (2014-08-25 14:07 +0400) wrote:
>>
>>> On 25/08/2014 08:54 πμ, Alex Kost wrote:
>>>> Alexandros Prekates (2014-08-25 03:29 +0400) wrote:
>>>>
>>>>> Continuing little experiments to better undestand the relation among
>>>>> fonts, faces, frames etc, i noticed
>>>>> that if i have 2 frames (A and B) and i evaluate from ielm in frame A
>>>>> (set-frame-font "liberation serif" nil nil) . when i check the default
>>>>> face's font i see different values in frame A from frame B.
>>>>>
>>>>> So it seems that default face is a frame's variable.
>>>>>
>>>>> i mean every frame has its own default face? Is that right?
>>>> As you can see after "C-h f set-frame-font":
>>>>
>>>> “...
>>>> If FRAMES is nil, apply the font to the selected frame only.
>>>> ...”
>>>>
>>>> So the second nil in your expression means you set a font only for the
>>>> current frame A.
>>>>
>>>>
>>> So default face is not a global emacs session variable. It's an
>>> attribute per frame.
>> I thought you were talking about frame fonts. AFAIU there is only one
>> ‘default’ face (defined in "faces.el"), if that's what you mean.
>>
>
> But the assumption that there is only one global default face
> contradicts with what i see.
>
> In two frames (of the same emacs session) M-x describe-face (default)
> gives me different font families ( i changed in each frame the font with
> set-frame-font.)
I didn't mean there is always only one global value of a face for all
frames. As you could see it is possible to set face attributes for a
particular frame. Here is a paragraph from (info "(elisp) Faces"):
“...
By default, each face name corresponds to the same set of attributes
in all frames. But you can also assign a face name a special set of
attributes in one frame (*note Attribute Functions::).
”
You can look at (info "(elisp) Attribute Functions") to read how it can
be done. And ‘set-frame-font’ does exactly that: it calls
‘set-face-attribute’ to specify a font for the current frame.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Is Default face a per frame attribute or a global one?
2014-08-26 4:55 ` Alex Kost
@ 2014-08-27 1:49 ` Alexandros Prekates
0 siblings, 0 replies; 7+ messages in thread
From: Alexandros Prekates @ 2014-08-27 1:49 UTC (permalink / raw)
To: Alex Kost; +Cc: help-gnu-emacs
On 26/08/2014 07:55 πμ, Alex Kost wrote:
> Alexandros Prekates (2014-08-26 03:07 +0400) wrote:
>
>> On 25/08/2014 03:03 μμ, Alex Kost wrote:
>>> Alexandros Prekates (2014-08-25 14:07 +0400) wrote:
>>>
>>>> On 25/08/2014 08:54 πμ, Alex Kost wrote:
>>>>> Alexandros Prekates (2014-08-25 03:29 +0400) wrote:
>>>>>
>>>>>> Continuing little experiments to better undestand the relation among
>>>>>> fonts, faces, frames etc, i noticed
>>>>>> that if i have 2 frames (A and B) and i evaluate from ielm in frame A
>>>>>> (set-frame-font "liberation serif" nil nil) . when i check the default
>>>>>> face's font i see different values in frame A from frame B.
>>>>>>
>>>>>> So it seems that default face is a frame's variable.
>>>>>>
>>>>>> i mean every frame has its own default face? Is that right?
>>>>> As you can see after "C-h f set-frame-font":
>>>>>
>>>>> “...
>>>>> If FRAMES is nil, apply the font to the selected frame only.
>>>>> ...”
>>>>>
>>>>> So the second nil in your expression means you set a font only for the
>>>>> current frame A.
>>>>>
>>>>>
>>>> So default face is not a global emacs session variable. It's an
>>>> attribute per frame.
>>> I thought you were talking about frame fonts. AFAIU there is only one
>>> ‘default’ face (defined in "faces.el"), if that's what you mean.
>>>
>> But the assumption that there is only one global default face
>> contradicts with what i see.
>>
>> In two frames (of the same emacs session) M-x describe-face (default)
>> gives me different font families ( i changed in each frame the font with
>> set-frame-font.)
> I didn't mean there is always only one global value of a face for all
> frames. As you could see it is possible to set face attributes for a
> particular frame. Here is a paragraph from (info "(elisp) Faces"):
>
> “...
> By default, each face name corresponds to the same set of attributes
> in all frames. But you can also assign a face name a special set of
> attributes in one frame (*note Attribute Functions::).
> ”
>
> You can look at (info "(elisp) Attribute Functions") to read how it can
> be done. And ‘set-frame-font’ does exactly that: it calls
> ‘set-face-attribute’ to specify a font for the current frame.
>
Thanks. That makes things more clear now.
set-frame-font --> set-face-attribute -->
internal-set-lisp-face-attribute (c function).
That last one somehow implements the
http://www.emacswiki.org/emacs/FacesPerFrame funtionality.
Although i 'm curious of how you do that in a non-OO language :-)
Alexandros
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-08-27 1:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-24 23:29 Is Default face a per frame attribute or a global one? Alexandros Prekates
2014-08-25 5:54 ` Alex Kost
2014-08-25 10:07 ` Alexandros Prekates
2014-08-25 12:03 ` Alex Kost
2014-08-25 23:07 ` Alexandros Prekates
2014-08-26 4:55 ` Alex Kost
2014-08-27 1:49 ` Alexandros Prekates
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).