]> git.eshelyaron.com Git - emacs.git/commitdiff
Move :pin out of macro expansion phase fixes
authorIvan Goncharov <kovrik0@gmail.com>
Tue, 5 Jan 2016 23:56:54 +0000 (12:56 +1300)
committerIvan Goncharov <kovrik0@gmail.com>
Tue, 5 Jan 2016 23:56:54 +0000 (12:56 +1300)
lisp/use-package/use-package.el

index d5226e3a9d3babd2cb33c134cd75a6c60d60aadb..a225d99810f09fc453055917d1b93460e351307b 100644 (file)
@@ -419,7 +419,7 @@ manually updated package."
   (let ((archive-symbol (if (symbolp archive) archive (intern archive)))
         (archive-name   (if (stringp archive) archive (symbol-name archive))))
     (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."
              archive-name package))
     (package-initialize t)))
@@ -427,11 +427,10 @@ manually updated package."
 (defun use-package-handler/:pin (name keyword archive-name rest state)
   (let ((body (use-package-process-keywords name rest state))
         (pin-form (if archive-name
-                      `(use-package-pin-package ',name ,archive-name))))
-    ;; We want to avoid pinning packages when the `use-package'
-    ;; macro is being macro-expanded by elisp completion (see
-    ;; `lisp--local-variables'), but still do pin packages when
-    ;; byte-compiling to avoid requiring `package' at runtime.
+                      `(use-package-pin-package ',(use-package-as-symbol name)
+                                                ,archive-name))))
+    ;; Pinning should occur just before ensuring
+    ;; See `use-package-handler/:ensure'.
     (if (bound-and-true-p byte-compile-current-file)
         (eval pin-form)              ; Eval when byte-compiling,
       (push pin-form body))          ; or else wait until runtime.