Fix minor corner case bugs in byte compilation and pcase.
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Don't re-preprocess functions from byte-compile-function-environment. * lisp/emacs-lisp/bytecomp.el (byte-compile-constp): Treat #'v as a constant. (byte-compile-close-variables): Bind byte-compile--outbuffer here... (byte-compile-from-buffer): ...rather than here. * lisp/emacs-lisp/pcase.el (pcase--expand): Accept different sets of vars in different alternative patterns. (pcase-codegen): Be more careful to preserve identity. (pcase--u1): Don't forget to mark vars as used.
This commit is contained in:
parent
46b7967e4d
commit
6876a58db3
4 changed files with 71 additions and 45 deletions
|
@ -288,10 +288,14 @@
|
|||
(push `(,(car binding) ',(cdr binding)) renv)))
|
||||
((eq binding t))
|
||||
(t (push `(defvar ,binding) body))))
|
||||
(let ((newfn (byte-compile-preprocess
|
||||
(if (null renv)
|
||||
`(lambda ,args ,@body)
|
||||
`(lambda ,args (let ,(nreverse renv) ,@body))))))
|
||||
(let ((newfn (if (eq fn localfn)
|
||||
;; If `fn' is from the same file, it has already
|
||||
;; been preprocessed!
|
||||
`(function ,fn)
|
||||
(byte-compile-preprocess
|
||||
(if (null renv)
|
||||
`(lambda ,args ,@body)
|
||||
`(lambda ,args (let ,(nreverse renv) ,@body)))))))
|
||||
(if (eq (car-safe newfn) 'function)
|
||||
(byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form)))
|
||||
(byte-compile-log-warning
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue