diff options
| author | Stefan Monnier | 2018-03-22 18:18:26 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2018-03-22 18:18:26 -0400 |
| commit | 97b7e58c4d34722e8b0eb73b3ed315fdc9671264 (patch) | |
| tree | 9b5075b0e69f908393028ae2aac5e3985d286ed5 | |
| parent | 86d6417bf15b7ad5717dec2112f8616f67b2c9d3 (diff) | |
| download | emacs-97b7e58c4d34722e8b0eb73b3ed315fdc9671264.tar.gz emacs-97b7e58c4d34722e8b0eb73b3ed315fdc9671264.zip | |
Try and fix the more obvious sources of bug#30635
* lisp/files.el (dir-locals-read-from-dir): Handle the easy cases
without loading `map`.
* lisp/emacs-lisp/bytecomp.el: Don't require cl-lib at run-time.
(byte-compile-and-folded): Avoid cl-every.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 18 | ||||
| -rw-r--r-- | lisp/files.el | 16 |
2 files changed, 17 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b3ea9300b01..07476f1ac96 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -124,17 +124,10 @@ | |||
| 124 | (require 'backquote) | 124 | (require 'backquote) |
| 125 | (require 'macroexp) | 125 | (require 'macroexp) |
| 126 | (require 'cconv) | 126 | (require 'cconv) |
| 127 | (require 'cl-lib) | 127 | ;; Refrain from using cl-lib at run-time here, since it otherwise prevents |
| 128 | 128 | ;; us from emitting warnings when compiling files which use cl-lib without | |
| 129 | ;; During bootstrap, cl-loaddefs.el is not created yet, so loading cl-lib | 129 | ;; requiring it! (bug#30635) |
| 130 | ;; doesn't setup autoloads for things like cl-every, which is why we have to | 130 | (eval-when-compile (require 'cl-lib)) |
| 131 | ;; require cl-extra as well (bug#18804). | ||
| 132 | (or (fboundp 'cl-every) | ||
| 133 | (require 'cl-extra)) | ||
| 134 | |||
| 135 | (or (fboundp 'defsubst) | ||
| 136 | ;; This really ought to be loaded already! | ||
| 137 | (load "byte-run")) | ||
| 138 | 131 | ||
| 139 | ;; The feature of compiling in a specific target Emacs version | 132 | ;; The feature of compiling in a specific target Emacs version |
| 140 | ;; has been turned off because compile time options are a bad idea. | 133 | ;; has been turned off because compile time options are a bad idea. |
| @@ -3582,7 +3575,8 @@ These implicitly `and' together a bunch of two-arg bytecodes." | |||
| 3582 | (cond | 3575 | (cond |
| 3583 | ((< l 3) (byte-compile-form `(progn ,(nth 1 form) t))) | 3576 | ((< l 3) (byte-compile-form `(progn ,(nth 1 form) t))) |
| 3584 | ((= l 3) (byte-compile-two-args form)) | 3577 | ((= l 3) (byte-compile-two-args form)) |
| 3585 | ((cl-every #'macroexp-copyable-p (nthcdr 2 form)) | 3578 | ;; Don't use `cl-every' here (see comment where we require cl-lib). |
| 3579 | ((not (memq nil (mapcar #'macroexp-copyable-p (nthcdr 2 form)))) | ||
| 3586 | (byte-compile-form `(and (,(car form) ,(nth 1 form) ,(nth 2 form)) | 3580 | (byte-compile-form `(and (,(car form) ,(nth 1 form) ,(nth 2 form)) |
| 3587 | (,(car form) ,@(nthcdr 2 form))))) | 3581 | (,(car form) ,@(nthcdr 2 form))))) |
| 3588 | (t (byte-compile-normal-call form))))) | 3582 | (t (byte-compile-normal-call form))))) |
diff --git a/lisp/files.el b/lisp/files.el index 8ec2bde5880..46a105a36f0 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -4018,7 +4018,6 @@ DIR is the absolute name of a directory which must contain at | |||
| 4018 | least one dir-local file (which is a file holding variables to | 4018 | least one dir-local file (which is a file holding variables to |
| 4019 | apply). | 4019 | apply). |
| 4020 | Return the new class name, which is a symbol named DIR." | 4020 | Return the new class name, which is a symbol named DIR." |
| 4021 | (require 'map) | ||
| 4022 | (let* ((class-name (intern dir)) | 4021 | (let* ((class-name (intern dir)) |
| 4023 | (files (dir-locals--all-files dir)) | 4022 | (files (dir-locals--all-files dir)) |
| 4024 | (read-circle nil) | 4023 | (read-circle nil) |
| @@ -4033,12 +4032,19 @@ Return the new class name, which is a symbol named DIR." | |||
| 4033 | (setq latest file-time))) | 4032 | (setq latest file-time))) |
| 4034 | (with-temp-buffer | 4033 | (with-temp-buffer |
| 4035 | (insert-file-contents file) | 4034 | (insert-file-contents file) |
| 4036 | (condition-case-unless-debug nil | 4035 | (let ((newvars |
| 4037 | (setq variables | 4036 | (condition-case-unless-debug nil |
| 4037 | (read (current-buffer)) | ||
| 4038 | (end-of-file nil)))) | ||
| 4039 | (setq variables | ||
| 4040 | ;; Try and avoid loading `map' since that also loads cl-lib | ||
| 4041 | ;; which then might hamper bytecomp warnings (bug#30635). | ||
| 4042 | (if (not (and newvars variables)) | ||
| 4043 | (or newvars variables) | ||
| 4044 | (require 'map) | ||
| 4038 | (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) | 4045 | (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) |
| 4039 | variables | 4046 | variables |
| 4040 | (read (current-buffer)))) | 4047 | newvars)))))) |
| 4041 | (end-of-file nil)))) | ||
| 4042 | (setq success latest)) | 4048 | (setq success latest)) |
| 4043 | (dir-locals-set-class-variables class-name variables) | 4049 | (dir-locals-set-class-variables class-name variables) |
| 4044 | (dir-locals-set-directory-class dir class-name success) | 4050 | (dir-locals-set-directory-class dir class-name success) |