[Q21.5] Make the X11 font menu work again.

Aidan Kehoe kehoea at parhasard.net
Sat Jan 20 13:15:36 EST 2007


 Ar an naoú lá déag de mí Eanair, scríobh Stephen J. Turnbull: 

 > Aidan Kehoe writes:
 > 
 >  >  > I don't understand why you changed the code rather than the
 >  >  > docstring.
 >  > 
 >  > The code that called it relied on it not reverting the default
 >  > face. 
 > 
 > IMO, the calling code is broken, then. 

It’s relying on the documented behaviour of the function it calls! It’s
not broken. Maybe the API is wrong, but the code isn’t. 

 > The functionality provided by `(reset-face 'default)' is useful (to me,
 > when hacking, at least),

(remove-specifier (face-font 'default)) is equivalent. 

 > and reset-face is fairly rarely called.  Once again:
 >  >  > If people want a font to be controlled by Custom, let them set
 >  >  > it via Custom, no?  Is this needed to make the font-menu work?
 >  > 
 >  > The font-menu uses Custom to change the face family and size, which
 >  > is well and good, duplicating the frobbing Custom does would be a
 >  > waste. If, however, a face specifier doesn’t have 'custom in its
 >  > specifier tag list, as will be the case if it was initialised from
 >  > X resources or from the corresponding fallback, Custom won’t
 >  > modify a faces.
 > 
 > I don't understand what you're saying.  I've never had trouble
 > Customizing any face, but AFAIK no face is initialized with 'custom
 > tags on any of the instantiators.

Start XEmacs 21.4. Click on Options -> Font, choose a font. Click on Options
-> Save Options to Custom File. Exit XEmacs. Start XEmacs again. (face-font
'default) will show that the face has custom tags on the instantiators.

 >  >  > I guess you can recover the resource settings by reinitializing
 >  >  > the face, but wouldn't it be preferable to keep the
 >  >  > resource-based instantiators and implement reset-to-default by
 >  >  > clearing instantiators with the Custom tag-set?
 >  > 
 >  > That’s the current situation, and it has the disadvantage that the
 >  > font menu doesn’t work.
 > 
 > Well, it *did* work at one time.  AFAIK it does work in 21.4, I'll
 > need to check.  That's basically the same font-menu code IIRC, except
 > for the Xft-related kludges in recent 21.5.

There were changes, and I don’t understand them in detail. I suspect it’s a
question of the relative order of instantiators, which would have been
fragile even when it worked.

 > More important, I don't see how neutralizing X resources makes it
 > "really work"; there are other ways of editing face specifications.
 > According to the logic you've presented, to placate Custom you're
 > going to need to deprecate the whole set-specifier UI as well as
 > set-face-font and friends.  Am I missing something special about X
 > resources?
 > 
 > Can you explain why we want to go there?  It seems to me that what we
 > want to do is to turn Custom into a convenient front-end to the
 > specifier API, rather than to remove the specifier API.

I’m not making a complete API, and I don’t want to. I want clicking on
Options -> Font to do something useful. It’s important. It’s the first thing
lots of new users do. 

-- 
When I was in the scouts, the leader told me to pitch a tent. I couldn't
find any pitch, so I used creosote.



More information about the XEmacs-Patches mailing list