]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/backquote.el (backquote-process): Catch uses of , and ,@
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 8 Oct 2013 04:30:31 +0000 (00:30 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 8 Oct 2013 04:30:31 +0000 (00:30 -0400)
with more than one argument.

Fixes: debbugs:15538
lisp/ChangeLog
lisp/emacs-lisp/backquote.el

index db02ef7a67fa57480a0221f63465338df53667bf..fd132cad1a2ba67aa687e71314b215c8374800e6 100644 (file)
@@ -1,5 +1,8 @@
 2013-10-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/backquote.el (backquote-process): Catch uses of , and ,@
+       with more than one argument (bug#15538).
+
        * mpc.el (mpc-songs-jump-to): Adjust to different playlist format.
 
        * vc/pcvs.el: Use lexical-binding.
index 2dc84e9ddfb4900e2a5e1b8b1a4cf4f3b090d4d2..81d11ff4f7715fa4fd7e55dc350b726786cef8ee 100644 (file)
@@ -153,11 +153,18 @@ LEVEL is only used internally and indicates the nesting level:
              (list 'quote s))))
    ((eq (car s) backquote-unquote-symbol)
     (if (<= level 0)
-        (cons 1 (nth 1 s))
+        (if (> (length s) 2)
+            ;; We could support it with: (cons 2 `(list . ,(cdr s)))
+            ;; But let's not encourage such uses.
+            (error "Multiple args to , are not supported: %S" s)
+          (cons 1 (nth 1 s)))
       (backquote-delay-process s (1- level))))
    ((eq (car s) backquote-splice-symbol)
     (if (<= level 0)
-        (cons 2 (nth 1 s))
+        (if (> (length s) 2)
+            ;; (cons 2 `(append . ,(cdr s)))
+            (error "Multiple args to ,@ are not supported: %S" s)
+          (cons 2 (nth 1 s)))
       (backquote-delay-process s (1- level))))
    ((eq (car s) backquote-backquote-symbol)
       (backquote-delay-process s (1+ level)))