From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: bind faces? Date: Sat, 13 May 2006 10:54:24 -0700 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1147542901 31330 80.91.229.2 (13 May 2006 17:55:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 May 2006 17:55:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 13 19:54:57 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FeyKP-0001Wk-5A for ged-emacs-devel@m.gmane.org; Sat, 13 May 2006 19:54:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FeyKO-0008Rz-WE for ged-emacs-devel@m.gmane.org; Sat, 13 May 2006 13:54:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FeyKB-0008Qy-2Y for emacs-devel@gnu.org; Sat, 13 May 2006 13:54:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FeyK9-0008Px-0p for emacs-devel@gnu.org; Sat, 13 May 2006 13:54:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FeyK8-0008Pu-Mp for emacs-devel@gnu.org; Sat, 13 May 2006 13:54:40 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1FeyM8-0004xf-45 for emacs-devel@gnu.org; Sat, 13 May 2006 13:56:44 -0400 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k4DHsTO4011053 for ; Sat, 13 May 2006 11:54:29 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-64-178.vpn.oracle.com [141.144.64.178]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k4DHsSQn011243 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sat, 13 May 2006 11:54:28 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54392 Archived-At: 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.