From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: Old-style backquotes in cc-vars.el Date: Sat, 06 Oct 2007 20:31:57 +0200 Message-ID: <87y7egjdr6.fsf@ambire.localdomain> References: <20071006163101.GA2565@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191695628 12369 80.91.229.12 (6 Oct 2007 18:33:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2007 18:33:48 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Peter Dyballa , Martin Stjernholm , Stefan Monnier , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 20:33:44 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IeET9-000302-Sv for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2007 20:33:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IeET4-00051G-Jt for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2007 14:33:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IeET1-00050f-43 for emacs-devel@gnu.org; Sat, 06 Oct 2007 14:33:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IeESz-0004zy-N1 for emacs-devel@gnu.org; Sat, 06 Oct 2007 14:33:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IeESz-0004zv-G6 for emacs-devel@gnu.org; Sat, 06 Oct 2007 14:33:33 -0400 Original-Received: from ppp-56-36.21-151.libero.it ([151.21.36.56] helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IeESt-0007y2-K5; Sat, 06 Oct 2007 14:33:28 -0400 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1IeERS-0007FO-5B; Sat, 06 Oct 2007 20:31:58 +0200 In-Reply-To: <20071006163101.GA2565@muc.de> (Alan Mackenzie's message of "Sat\, 6 Oct 2007 16\:31\:01 +0000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Genre and OS details not recognized. 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:80341 Archived-At: () Alan Mackenzie () Sat, 6 Oct 2007 16:31:01 +0000 ,@(plist-put args ':type `(` (radio <========================== (const :tag "Use style settings" set-from-style) ,(, (let ((type (eval (plist-get args ':type)))) (unless (consp type) (setq type (list type))) (unless (c-safe (plist-get (cdr type) ':value)) (setcdr type (append '(:value (, -value-)) (cdr type)))) (unless (c-safe (plist-get (cdr type) ':tag)) (setcdr type (append '(:tag "Override style settings") (cdr type)))) (bq-process type)))))) wow, funky! how about this replacement? (defmacro defcustom-c-stylevar (name val doc &rest args) "Defines a style variable." (let* ((val (eval val)) (type (eval (list 'identity (plist-get args :type)))) (head (car type)) (tail (cdr type)) (newt (append (unless (plist-get tail :tag) '(:tag "Override style settings")) (unless (plist-get tail :value) `(:value ,val)) tail))) `(progn (c-set-stylevar-fallback ',name ,val) (custom-declare-variable ',name ''set-from-style ,(concat doc "\n\nZZZ") ,@(plist-put args :type `(radio (const :tag "Use style settings" set-from-style) ,(cons head newt))))))) the ZZZ stands for the original blurb, reinstatable after discussion. calls to `c-safe' were removed since plist-get never errs. thi