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 16:31:01 +0000 Message-ID: <20071006163101.GA2565@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191688008 23944 80.91.229.12 (6 Oct 2007 16:26:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2007 16:26:48 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Peter Dyballa , Martin Stjernholm , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 18:26: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 1IeCUF-0007dQ-WF for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2007 18:26:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IeCUB-00042J-3A for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2007 12:26:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IeCU7-00042B-Qb for emacs-devel@gnu.org; Sat, 06 Oct 2007 12:26:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IeCU6-00041o-9a for emacs-devel@gnu.org; Sat, 06 Oct 2007 12:26:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IeCU6-00041h-1X for emacs-devel@gnu.org; Sat, 06 Oct 2007 12:26:34 -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 1IeCU5-00039b-Er for emacs-devel@gnu.org; Sat, 06 Oct 2007 12:26:33 -0400 Original-Received: (qmail 93455 invoked by uid 3782); 6 Oct 2007 16:26:31 -0000 Original-Received: from acm.muc.de (p57B1D6FE.dip.t-dialin.net [87.177.214.254]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 06 Oct 2007 18:26:27 +0200 Original-Received: (qmail 31384 invoked by uid 1000); 6 Oct 2007 16:31:01 -0000 Content-Disposition: inline In-Reply-To: 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:80339 Archived-At: Hi, Stefan! On Thu, Aug 23, 2007 at 04:51:08PM -0400, Stefan Monnier wrote: > cc-vars uses a mix of old-style a new-style backquotes. I don't think it does. The patch to cc-vars.el which created this form was made by Martin S. on 2001-09-23. He wouldn't knowingly have put in old-style BQs as late as 2001. But he might well have just tried one thing after another until he got something to work. I've CC'd him, just in case he'd like to comment. The exact patch can be seen at . > I've fixed other uses of old-style backquotes in Emacs-22 but feel like > there may be something fishy going on here, .... Indeed. At the risk of offending against public decency regulations, here is the form lread.c is complaining about: ;-) ,@(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)))))) I think (but I'm not entirely sure) the associativity of the backticks and braces is: `( `(radio , not ` (` (radio , i.e. I think it is actually nested new-style backquotes. I've given up trying to figure out when the inner commas get evaluated. I'm not sure whether the rules for nested backquotes are clearly laid out anywhere. I think they're formally ambiguous (i.e., RTFS). I tried replacing "`(` (radio" with both "`( (` (radio" (explicitly putting in an "old-style" BQ) , and "`` (radio" (replacing the alleged "old-style" BQ with a "new-style" one) , but each of these generated results different from the original (checked with macroexpand). > ...., so I'd rather someone else does the conversion here. So would I. ;-( Who is the bytecomp expert, again? Could we possibly ask him about the semantics of `(` (radio ? Possibly, the analysis in lread.c needs to be done more rigorously. > Stefan -- Alan.