mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-05 03:39:38 +00:00
Move :pin out of macro expansion phase fixes
This commit is contained in:
parent
308e4e3f2c
commit
d1c78a646c
1 changed files with 5 additions and 6 deletions
|
@ -419,7 +419,7 @@ manually updated package."
|
||||||
(let ((archive-symbol (if (symbolp archive) archive (intern archive)))
|
(let ((archive-symbol (if (symbolp archive) archive (intern archive)))
|
||||||
(archive-name (if (stringp archive) archive (symbol-name archive))))
|
(archive-name (if (stringp archive) archive (symbol-name archive))))
|
||||||
(if (use-package--archive-exists-p archive-symbol)
|
(if (use-package--archive-exists-p archive-symbol)
|
||||||
(add-to-list 'package-pinned-packages (cons package archive-name) t)
|
(add-to-list 'package-pinned-packages (cons package archive-name))
|
||||||
(error "Archive '%s' requested for package '%s' is not available."
|
(error "Archive '%s' requested for package '%s' is not available."
|
||||||
archive-name package))
|
archive-name package))
|
||||||
(package-initialize t)))
|
(package-initialize t)))
|
||||||
|
@ -427,11 +427,10 @@ manually updated package."
|
||||||
(defun use-package-handler/:pin (name keyword archive-name rest state)
|
(defun use-package-handler/:pin (name keyword archive-name rest state)
|
||||||
(let ((body (use-package-process-keywords name rest state))
|
(let ((body (use-package-process-keywords name rest state))
|
||||||
(pin-form (if archive-name
|
(pin-form (if archive-name
|
||||||
`(use-package-pin-package ',name ,archive-name))))
|
`(use-package-pin-package ',(use-package-as-symbol name)
|
||||||
;; We want to avoid pinning packages when the `use-package'
|
,archive-name))))
|
||||||
;; macro is being macro-expanded by elisp completion (see
|
;; Pinning should occur just before ensuring
|
||||||
;; `lisp--local-variables'), but still do pin packages when
|
;; See `use-package-handler/:ensure'.
|
||||||
;; byte-compiling to avoid requiring `package' at runtime.
|
|
||||||
(if (bound-and-true-p byte-compile-current-file)
|
(if (bound-and-true-p byte-compile-current-file)
|
||||||
(eval pin-form) ; Eval when byte-compiling,
|
(eval pin-form) ; Eval when byte-compiling,
|
||||||
(push pin-form body)) ; or else wait until runtime.
|
(push pin-form body)) ; or else wait until runtime.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue