From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tsgatesv Newsgroups: gmane.emacs.help Subject: defmacro and defface problems Date: Fri, 21 Mar 2008 09:26:43 +0900 Message-ID: <1206059203.8927.9.camel@prosummer> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206066722 3072 80.91.229.12 (21 Mar 2008 02:32:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2008 02:32:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 21 03:32:31 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JcX3W-0005Tg-Qq for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Mar 2008 03:32:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcX2w-000752-FM for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Mar 2008 22:31:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcV5o-0007X3-HB for help-gnu-emacs@gnu.org; Thu, 20 Mar 2008 20:26:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcV5n-0007VT-0O for help-gnu-emacs@gnu.org; Thu, 20 Mar 2008 20:26:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcV5m-0007VA-FR for help-gnu-emacs@gnu.org; Thu, 20 Mar 2008 20:26:42 -0400 Original-Received: from wf-out-1314.google.com ([209.85.200.171]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JcV5m-0007YJ-12 for help-gnu-emacs@gnu.org; Thu, 20 Mar 2008 20:26:42 -0400 Original-Received: by wf-out-1314.google.com with SMTP id 29so1266902wff.24 for ; Thu, 20 Mar 2008 17:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=9CAzk9jbEvq9h1nyxH0rnKqs25Y+KsSktDXGzOidGB4=; b=rRjbczIcEO3Z+3hHOy2drkpbkAG/6HS79h1zmiw0hHHRv1JnsFnQLxLXTEmsUHwFrM20HYShnVCQYBlYo5fwMQAsdWn9JWaH6n3RIocGyRdQ+dWLCTlLReevoWcvh6dantzzuvuxCLhkZf1hEMcQxu82uakFkdvmfdDgt5XS/d8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=K8/+Lecqlykj3FbbxF9Van/LXy/kxrx2EwEdtRmcekhvOoeh8cmgPeImxwfmLLd6NBxJelaVnQFO0zBpQRK4GPX8HJIx2x1L2MNi5KAVfy4DfP4/JUIeYQmvmTc9GSCadERqMEVLrxbJkaQnQCw3Hjp8Xix3ar8YdXEdZhja/DI= Original-Received: by 10.142.240.9 with SMTP id n9mr1968923wfh.6.1206059200625; Thu, 20 Mar 2008 17:26:40 -0700 (PDT) Original-Received: from ?192.168.77.113? ( [125.143.160.43]) by mx.google.com with ESMTPS id 30sm5063528wff.11.2008.03.20.17.26.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 Mar 2008 17:26:38 -0700 (PDT) X-Mailer: Evolution 2.12.1 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-Mailman-Approved-At: Thu, 20 Mar 2008 22:30:00 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52582 Archived-At: hi, all! I met a problem about defining macro with defface! It looks extremely strange to me, help! 1. define macro "git--face" in order to short my codes -------------------------------------------------------------------------- (defmacro git--face (name fore1 prop1 fore2 prop2) `(defface ,(make-symbol (concat "git--" (symbol-name name) "-face")) '((((class color) (background light)) (:foreground ,fore1 ,@prop1)) (((class color) (background dark)) (:foreground ,fore2 ,@prop2))) ,(concat "git " (symbol-name name) " face in status buffer mode") :group 'git)) -------------------------------------------------------------------------- 2. seems like work, -------------------------------------------------------------------------- (git--face wow "red" (:bold t) "tomato" (:bold t)) git--wow-face -------------------------------------------------------------------------- 3. but not defined (but, there is 'git--wow-face in "list-faces-display) -------------------------------------------------------------------------- (facep 'git--wow-face) nil -------------------------------------------------------------------------- 4. this is what I want to eval -------------------------------------------------------------------------- (defface git--wow-face '((((class color) (background light)) (:foreground "gray" :bold t :italic t)) (((class color) (background dark)) (:foreground "gray" :bold t :italic t))) "git wow face in status buffer mode" :group 'git) git--wow-face (facep 'git--wow-face) [face unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified ...] -------------------------------------------------------------------------- 5. Actually, the expanded macro of 1 and 4 is exactly same like under -------------------------------------------------------------------------- (macroexpand '(git--face wow "red" (:bold t) "tomato" (:bold t))) (custom-declare-face (quote git--wow-face) (quote ((... ...) (... ...))) "git wow face in status buffer mode" :group (quote git)) (macroexpand '(defface git--wow-face '((((class color) (background light)) (:foreground "gray" :bold t :italic t)) (((class color) (background dark)) (:foreground "gray" :bold t :italic t))) "git wow face in status buffer mode" :group 'git)) (custom-declare-face (quote git--wow-face) (quote ((... ...) (... ...))) "git wow face in status buffer mode" :group (quote git)) -------------------------------------------------------------------------- Thank you for reading and please help me!