X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0c3f76c6335de0a2d44db37c9ddf953654ca7f32..540bfa7680268a55fc617ffb822e962cb9fb6c59:/lisp/emacs-lisp/backquote.el diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el index 5cecbcd433..c31f25c795 100644 --- a/lisp/emacs-lisp/backquote.el +++ b/lisp/emacs-lisp/backquote.el @@ -1,6 +1,6 @@ ;;; backquote.el --- implement the ` Lisp construct -;; Copyright (C) 1990, 1992, 1994, 2001-2014 Free Software Foundation, +;; Copyright (C) 1990, 1992, 1994, 2001-2016 Free Software Foundation, ;; Inc. ;; Author: Rick Sladkey @@ -43,7 +43,7 @@ (defun backquote-list*-function (first &rest list) "Like `list' but the last argument is the tail of the new list. -For example (backquote-list* 'a 'b 'c) => (a b . c)" +For example (backquote-list* \\='a \\='b \\='c) => (a b . c)" ;; The recursive solution is much nicer: ;; (if list (cons first (apply 'backquote-list*-function list)) first)) ;; but Emacs is not very good at efficiently processing recursion. @@ -60,7 +60,7 @@ For example (backquote-list* 'a 'b 'c) => (a b . c)" (defmacro backquote-list*-macro (first &rest list) "Like `list' but the last argument is the tail of the new list. -For example (backquote-list* 'a 'b 'c) => (a b . c)" +For example (backquote-list* \\='a \\='b \\='c) => (a b . c)" ;; The recursive solution is much nicer: ;; (if list (list 'cons first (cons 'backquote-list*-macro list)) first)) ;; but Emacs is not very good at efficiently processing such things. @@ -99,9 +99,9 @@ places where expressions are evaluated and inserted or spliced in. For example: b => (ba bb bc) ; assume b has this value -`(a b c) => (a b c) ; backquote acts like quote -`(a ,b c) => (a (ba bb bc) c) ; insert the value of b -`(a ,@b c) => (a ba bb bc c) ; splice in the value of b +\\=`(a b c) => (a b c) ; backquote acts like quote +\\=`(a ,b c) => (a (ba bb bc) c) ; insert the value of b +\\=`(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 structure))) @@ -120,9 +120,7 @@ Vectors work just like lists. Nested backquotes are permitted." This simply recurses through the body." (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)))) + (cons (if (eq (car-safe exp) 'quote) 0 1) exp))) (defun backquote-process (s &optional level) "Process the body of a backquote.