emacs-devel
[Top][All Lists]
Advanced

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

bind faces?


From: Drew Adams
Subject: bind faces?
Date: Sat, 13 May 2006 10:54:24 -0700

I think the answer to this is "no", but I'm not sure:

Is there some way to get the effect of "binding" a face to a list of face
properties or the properties of another face? That is, do something akin to
this:

 (let ((some-face another-face-or-a-list-of-face-properties))
   (do-something))

Wouldn't it be useful to be able to do that? We have `let' for variables and
`flet' (via cl.el) for functions, but nothing for faces, IIUC. (Obviously, a
user could work with face variables, but those are not always available and
their use is generally discouraged.)

What is a good way to get such a result currently (i.e. a workaround)? Say
that you want to temporarily make face `x' have all the properties of face
`y'. How would you do that? unwind-protect + defface + defface back again?
Or unwind-protect + loop over all face attributes of `y', assigning them to
`x', then putting back `x's original attributes?

Is there an easy/elegant way to do this?

A special case would be to "wipe out" a face (make it invisible/unnoticable)
temporarily, giving its properties (e.g. fore/background) nil values. Is
there perhaps a good workaround for this special case?

A related feature would be to be able to make an overlay's face
unnoticeable. Not to use the `invisible' property, which hides the text, and
not to delete the overlay, but just to make the face itself
transparent/unnoticeable (e.g. temporarily).

I'm asking here instead of help-gnu-emacs because I suspect there is no easy
way to do this and, if so, I'd propose that we think about creating one
(after the release, of course). Also, in case I'm missing something or
misunderstanding faces or overlays, I know that folks here will help me see
the light. I'd like to know if there is a better way to accomplish what I'm
asking about than fiddling with face properties. Thx.





reply via email to

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