emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d5e3922: * lisp/emacs-lisp/backquote.el: Fix bug wi


From: Stefan Monnier
Subject: [Emacs-diffs] master d5e3922: * lisp/emacs-lisp/backquote.el: Fix bug with unoptimized exp.
Date: Fri, 30 Jan 2015 21:00:37 +0000

branch: master
commit d5e3922e08587e7eb9e5aec2e9f84cbda405f857
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/emacs-lisp/backquote.el: Fix bug with unoptimized exp.
    
    Fixes: debbugs:19734
    
    * lisp/emacs-lisp/backquote.el (backquote-delay-process): Don't reuse `s'
    since it may be "equivalent" in some sense, yet different.
    * test/automated/core-elisp-tests.el (core-elisp-tests-3-backquote): New 
test.
---
 lisp/ChangeLog                     |    5 +++++
 lisp/emacs-lisp/backquote.el       |    4 +---
 test/ChangeLog                     |    4 ++++
 test/automated/core-elisp-tests.el |    7 +++++--
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eac2e44..3724388 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-30  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/backquote.el (backquote-delay-process): Don't reuse `s'
+       since it may be "equivalent" in some sense, yet different (bug#19734).
+
 2015-01-30  Oleh Krehel  <address@hidden>
 
        * outline.el (outline-font-lock-face): Add docstring.
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 082955e..d5cdca2 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -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.
diff --git a/test/ChangeLog b/test/ChangeLog
index 3ae9807..8e4fdb8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-30  Stefan Monnier  <address@hidden>
+
+       * automated/core-elisp-tests.el (core-elisp-tests-3-backquote): New 
test.
+
 2015-01-28  Fabián Ezequiel Gallina  <address@hidden>
 
        * automated/python-tests.el (python-indent-pep8-1)
diff --git a/test/automated/core-elisp-tests.el 
b/test/automated/core-elisp-tests.el
index 1b76c76..c31ecef 100644
--- a/test/automated/core-elisp-tests.el
+++ b/test/automated/core-elisp-tests.el
@@ -24,7 +24,7 @@
 
 ;;; Code:
 
-(ert-deftest core-elisp-tests ()
+(ert-deftest core-elisp-tests-1-defvar-in-let ()
   "Test some core Elisp rules."
   (with-temp-buffer
     ;; Check that when defvar is run within a let-binding, the toplevel default
@@ -36,7 +36,7 @@
                          c-e-x)
                    '(1 2)))))
 
-(ert-deftest core-elisp-test-window-configurations ()
+(ert-deftest core-elisp-tests-2-window-configurations ()
   "Test properties of window-configurations."
   (let ((wc (current-window-configuration)))
     (with-current-buffer (window-buffer (frame-selected-window))
@@ -45,5 +45,8 @@
     (set-window-configuration wc)
     (should (or (not mark-active) (mark)))))
 
+(ert-deftest core-elisp-tests-3-backquote ()
+  (should (eq 3 (eval ``,,'(+ 1 2)))))
+
 (provide 'core-elisp-tests)
 ;;; core-elisp-tests.el ends here



reply via email to

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