]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/backquote.el
* cedet/srecode/srt.el:
[gnu-emacs] / lisp / emacs-lisp / backquote.el
index 6daaf001433a985f97af8d0305076b8b6e513fb1..bc3292085f3889a08681e971ef7e2b31197cd93d 100644 (file)
@@ -1,7 +1,7 @@
 ;;; backquote.el --- implement the ` Lisp construct
 
 ;; Copyright (C) 1990, 1992, 1994, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Rick Sladkey <jrs@world.std.com>
 ;; Maintainer: FSF
@@ -9,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -85,14 +83,13 @@ For example (backquote-list* 'a 'b 'c) => (a b . c)"
 (defconst backquote-backquote-symbol '\`
   "Symbol used to represent a backquote or nested backquote.")
 
-(defconst backquote-unquote-symbol ',
+(defconst backquote-unquote-symbol '\,
   "Symbol used to represent an unquote inside a backquote.")
 
-(defconst backquote-splice-symbol ',@
+(defconst backquote-splice-symbol '\,@
   "Symbol used to represent a splice inside a backquote.")
 
-;;;###autoload
-(defmacro backquote (arg)
+(defmacro backquote (structure)
   "Argument STRUCTURE describes a template to build.
 
 The whole structure acts as if it were quoted except for certain
@@ -106,11 +103,10 @@ b              => (ba bb bc)              ; assume b has this value
 `(a ,@b c)     => (a ba bb bc c)       ; splice in the value of b
 
 Vectors work just like lists.  Nested backquotes are permitted."
-  (cdr (backquote-process arg)))
+  (cdr (backquote-process structure)))
 
 ;; GNU Emacs has no reader macros
 
-;;;###autoload
 (defalias '\` (symbol-function 'backquote))
 
 ;; backquote-process returns a dotted-pair of a tag (0, 1, or 2) and
@@ -121,9 +117,8 @@ Vectors work just like lists.  Nested backquotes are permitted."
 (defun backquote-delay-process (s level)
   "Process a (un|back|splice)quote inside a backquote.
 This simply recurses through the body."
-  (let ((exp (backquote-listify (list (backquote-process (nth 1 s) level)
-                                      (cons 0 (list 'quote (car s))))
-                                '(0))))
+  (let ((exp (backquote-listify (list (cons 0 (list 'quote (car s))))
+                                (backquote-process (cdr s) level))))
     (if (eq (car-safe exp) 'quote)
         (cons 0 (list 'quote s))
       (cons 1 exp))))