all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: bug-cc-mode@gnu.org, Peter Dyballa <Peter_Dyballa@Web.DE>,
	Martin Stjernholm <mast@lysator.liu.se>,
	emacs-devel@gnu.org
Subject: Re: Old-style backquotes in cc-vars.el
Date: Sat, 6 Oct 2007 16:31:01 +0000	[thread overview]
Message-ID: <20071006163101.GA2565@muc.de> (raw)
In-Reply-To: <jwvtzqqrn74.fsf-monnier+emacs@gnu.org>

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

<http://cc-mode.cvs.sourceforge.net/cc-mode/cc-mode/cc-vars.el?r1=5.112&r2=5.113>.

> 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.

  parent reply	other threads:[~2007-10-06 16:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-23 20:51 Old-style backquotes in cc-vars.el Stefan Monnier
2007-09-01 10:18 ` Alan Mackenzie
2007-09-03 20:46   ` Stefan Monnier
2007-09-04  3:14     ` T. V. Raman
2007-09-04 22:57       ` Richard Stallman
2007-09-05  2:21         ` T. V. Raman
2007-09-05  2:44           ` dhruva
2007-09-05  3:26             ` Stefan Monnier
2007-09-05 20:02               ` Richard Stallman
2007-09-06 14:27                 ` Juri Linkov
2007-09-07  6:32                   ` Richard Stallman
2007-09-05 13:29             ` T. V. Raman
2007-10-06 16:31 ` Alan Mackenzie [this message]
2007-10-06 18:31   ` Thien-Thi Nguyen
2007-10-06 20:51     ` Alan Mackenzie
2007-10-06 21:46       ` Thien-Thi Nguyen
2007-10-11 17:41     ` Davis Herring
2007-10-19  7:29       ` Thien-Thi Nguyen
2007-10-06 22:27   ` Stefan Monnier
2007-10-07  9:40     ` Alan Mackenzie
2007-10-07  9:41       ` Thien-Thi Nguyen
2007-10-07 19:40       ` Eli Zaretskii
2007-10-07 13:10   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071006163101.GA2565@muc.de \
    --to=acm@muc.de \
    --cc=Peter_Dyballa@Web.DE \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mast@lysator.liu.se \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.