"Stephen J. Turnbull" <turnbull(a)sk.tsukuba.ac.jp> writes:
> Per> I wrote the face specification interface to have something
> Per> simple I could understand that would work the same on both
> Per> Emacs and XEmacs, and hoped someone someday would write a
> Per> function to translate the simple face specifications into
> Per> XEmacs specifiers. Much the same idea as easymenu is based
> Per> on. I believe Hrvoje Niksic tried, but found that the XEmacs
> Per> specifiers missed some (tags?) necessary.
>
> OK, I'll look at this. Missing tags shouldn't be a problem, Custom
> can define its own.
Which is exactly the problem I encountered -- the custom [note the
pun] tagset functions get a DEVICE argument, whereas Custom would
need a FRAME argument. This was the killer problem against porting
Custom to use specifiers.
I also couldn't fathom a way to extend custom tagsets without breaking
backward compatibility (and NO, we can't know that there is no code
using that stuff.) But read on.
[Imagine Hrvoje with a lamp lit above his head] A way to fix it in a
backward-compatible way has popped into my head! Just add another
optional argument to `define-specifier-tag' that determines how
PREDICATE will be called:
(define-specifier-tag TAG &optional PREDICATE HOW-TO-CALL)
Documentation:
Define a new specifier tag.
If PREDICATE is specified, it should be a function of one argument
(by default a device) that specifies whether the tag matches that
particular device. If PREDICATE is omitted, the tag matches all
devices.
With HOW-TO-CALL you can specify the argument that will be provided to
PREDICATE; legal values are `device' for a device argument, `frame'
for a frame argument, and `locale' for a generalized locale argument
(window, buffer, frame, or device.) For backward compatibility, nil
is the same as `device'.
You can redefine an existing user-defined specifier tag. However,
you cannot redefine the built-in specifier tags (the device types
and classes) or the symbols nil, t, 'all, or 'global.
Custom would set up its specifier tag for the background-mode property
of the locale, or frame (but NOT device!)
Note that only the interface light-bulb is lit -- implementation might
still be hard, especially if we did it right. In this case, "do it
right" means that a statement like automagically changes face
instances in the selected window:
(set-face-background 'default "black" (selected-window))
> Possibly there's something missing in the semantics of specifiers,
> or maybe Hrvoje just didn't like the apparent bloat.
See above, and sorry for the time it took me to respond. RL is a
bitch.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
aibohphobia (ay' bo fo beeya): n. The fear of palindromes.