1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00

* lisp/emacs-lisp/backquote.el (backquote-process): Optimize away the ,' case.

This commit is contained in:
Stefan Monnier 2014-11-15 23:59:50 -05:00
parent e68a171ebd
commit 86009dd5d8
2 changed files with 15 additions and 10 deletions

View file

@ -1,3 +1,7 @@
2014-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/backquote.el (backquote-process): Optimize away the ,' case.
2014-11-15 Lars Magne Ingebrigtsen <larsi@gnus.org> 2014-11-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/eww.el (eww-search-words): Mention `eww-search-prefix'. * net/eww.el (eww-search-words): Mention `eww-search-prefix'.
@ -11,8 +15,8 @@
* progmodes/python.el (python-shell-font-lock-kill-buffer): * progmodes/python.el (python-shell-font-lock-kill-buffer):
(python-shell-font-lock-with-font-lock-buffer) (python-shell-font-lock-with-font-lock-buffer)
(python-shell-get-buffer, python-ffap-module-path): Use (python-shell-get-buffer, python-ffap-module-path):
`derived-mode-p' instead of equality test on `major-mode'. Use `derived-mode-p' instead of equality test on `major-mode'.
2014-11-14 Fabián Ezequiel Gallina <fgallina@gnu.org> 2014-11-14 Fabián Ezequiel Gallina <fgallina@gnu.org>

View file

@ -148,16 +148,19 @@ LEVEL is only used internally and indicates the nesting level:
(t (t
(list 'apply '(function vector) (cdr n)))))))) (list 'apply '(function vector) (cdr n))))))))
((atom s) ((atom s)
;; FIXME: Use macroexp-quote!
(cons 0 (if (or (null s) (eq s t) (not (symbolp s))) (cons 0 (if (or (null s) (eq s t) (not (symbolp s)))
s s
(list 'quote s)))) (list 'quote s))))
((eq (car s) backquote-unquote-symbol) ((eq (car s) backquote-unquote-symbol)
(if (<= level 0) (if (<= level 0)
(if (> (length s) 2) (cond
;; We could support it with: (cons 2 `(list . ,(cdr s))) ((> (length s) 2)
;; But let's not encourage such uses. ;; We could support it with: (cons 2 `(list . ,(cdr s)))
(error "Multiple args to , are not supported: %S" s) ;; But let's not encourage such uses.
(cons 1 (nth 1 s))) (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)))) (backquote-delay-process s (1- level))))
((eq (car s) backquote-splice-symbol) ((eq (car s) backquote-splice-symbol)
(if (<= level 0) (if (<= level 0)
@ -215,9 +218,7 @@ LEVEL is only used internally and indicates the nesting level:
;; Tack on any initial elements. ;; Tack on any initial elements.
(if firstlist (if firstlist
(setq expression (backquote-listify firstlist (cons 1 expression)))) (setq expression (backquote-listify firstlist (cons 1 expression))))
(if (eq (car-safe expression) 'quote) (cons (if (eq (car-safe expression) 'quote) 0 1) expression)))))
(cons 0 (list 'quote s))
(cons 1 expression))))))
;; backquote-listify takes (tag . structure) pairs from backquote-process ;; backquote-listify takes (tag . structure) pairs from backquote-process
;; and decides between append, list, backquote-list*, and cons depending ;; and decides between append, list, backquote-list*, and cons depending