From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Old-style backquotes in cc-vars.el Date: Sat, 6 Oct 2007 20:51:18 +0000 Message-ID: <20071006205118.GA21218@muc.de> References: <20071006163101.GA2565@muc.de> <87y7egjdr6.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191703624 669 80.91.229.12 (6 Oct 2007 20:47:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2007 20:47:04 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Peter Dyballa , Martin Stjernholm , Stefan Monnier , emacs-devel@gnu.org To: Thien-Thi Nguyen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 22:47:00 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 1IeGY7-0003sJ-TR for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2007 22:47:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IeGY2-0003NF-GH for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2007 16:46:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IeGXy-0003J2-0p for emacs-devel@gnu.org; Sat, 06 Oct 2007 16:46:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IeGXw-0003Gw-Tq for emacs-devel@gnu.org; Sat, 06 Oct 2007 16:46:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IeGXw-0003Gk-Q9 for emacs-devel@gnu.org; Sat, 06 Oct 2007 16:46:48 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IeGXw-00063s-Dg for emacs-devel@gnu.org; Sat, 06 Oct 2007 16:46:48 -0400 Original-Received: (qmail 49557 invoked by uid 3782); 6 Oct 2007 20:46:46 -0000 Original-Received: from acm.muc.de (p57B1EF6D.dip.t-dialin.net [87.177.239.109]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 06 Oct 2007 22:46:42 +0200 Original-Received: (qmail 22834 invoked by uid 1000); 6 Oct 2007 20:51:18 -0000 Content-Disposition: inline In-Reply-To: <87y7egjdr6.fsf@ambire.localdomain> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-Detected-Kernel: FreeBSD 4.6-4.9 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:80350 Archived-At: Hi, Thi! On Sat, Oct 06, 2007 at 08:31:57PM +0200, Thien-Thi Nguyen wrote: > () 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! Can you explain to me what it is doing? If so, please do! :-) > 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))))))) It doesn't quite work - (car type) bombs, because type is 'integer, not a list. I'll figure out, though. > thi -- Alan.