emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] [emacs] 01/01: * lisp/emacs-lisp/backquote.el (backquote-p


From: Stefan Monnier
Subject: [Emacs-diffs] [emacs] 01/01: * lisp/emacs-lisp/backquote.el (backquote-process): Optimize away the , ' case.
Date: Sun, 16 Nov 2014 05:01:40 +0000

monnier pushed a commit to branch master
in repository emacs.

commit 86009dd5d886f1101358990e4f8f69a5d1467eb8
Author: Stefan Monnier <address@hidden>
Date:   Sat Nov 15 23:59:50 2014 -0500

    * lisp/emacs-lisp/backquote.el (backquote-process): Optimize away the ,' 
case.
---
 lisp/ChangeLog               |    8 ++++++--
 lisp/emacs-lisp/backquote.el |   17 +++++++++--------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5eb4e3a..634412e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-16  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/backquote.el (backquote-process): Optimize away the ,' 
case.
+
 2014-11-15  Lars Magne Ingebrigtsen  <address@hidden>
 
        * net/eww.el (eww-search-words): Mention `eww-search-prefix'.
@@ -11,8 +15,8 @@
 
        * progmodes/python.el (python-shell-font-lock-kill-buffer):
        (python-shell-font-lock-with-font-lock-buffer)
-       (python-shell-get-buffer, python-ffap-module-path): Use
-       `derived-mode-p' instead of equality test on `major-mode'.
+       (python-shell-get-buffer, python-ffap-module-path):
+       Use `derived-mode-p' instead of equality test on `major-mode'.
 
 2014-11-14  Fabián Ezequiel Gallina  <address@hidden>
 
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index a497acd..5cecbcd 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -148,16 +148,19 @@ LEVEL is only used internally and indicates the nesting 
level:
                 (t
                  (list 'apply '(function vector) (cdr n))))))))
    ((atom s)
+    ;; FIXME: Use macroexp-quote!
     (cons 0 (if (or (null s) (eq s t) (not (symbolp s)))
                s
              (list 'quote s))))
    ((eq (car s) backquote-unquote-symbol)
     (if (<= level 0)
-        (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)))
+        (cond
+         ((> (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))
+         (t (cons (if (eq (car-safe (nth 1 s)) 'quote) 0 1)
+                  (nth 1 s))))
       (backquote-delay-process s (1- level))))
    ((eq (car s) backquote-splice-symbol)
     (if (<= level 0)
@@ -215,9 +218,7 @@ LEVEL is only used internally and indicates the nesting 
level:
       ;; Tack on any initial elements.
       (if firstlist
          (setq expression (backquote-listify firstlist (cons 1 expression))))
-      (if (eq (car-safe expression) 'quote)
-         (cons 0 (list 'quote s))
-       (cons 1 expression))))))
+      (cons (if (eq (car-safe expression) 'quote) 0 1) expression)))))
 
 ;; backquote-listify takes (tag . structure) pairs from backquote-process
 ;; and decides between append, list, backquote-list*, and cons depending



reply via email to

[Prev in Thread] Current Thread [Next in Thread]