use-package icon indicating copy to clipboard operation
use-package copied to clipboard

Variable assignment doesn't always work as expected

Open berquist opened this issue 6 years ago • 2 comments

It was determined in https://github.com/abo-abo/swiper/issues/2267 that use-package causes ivy-initial-inputs-alist to not be set properly, so code like

(use-package ivy
  :ensure t
  :defer nil
  :custom
  (ivy-initial-inputs-alist nil)
  :init
  (ivy-mode))
(use-package counsel
  :after ivy
  :ensure t
  :defer nil
  :bind (("M-x" . counsel-M-x)
         ("C-x C-f" . counsel-find-file))
  :custom
  ;; seriously, stop
  (ivy-initial-inputs-alist nil))

doesn't work as expected, despite the attempt to defer loading. It's probably caused by lines like https://github.com/abo-abo/swiper/blob/d2052bab4eecebab84e75b8a10b66f66a8574425/counsel.el#L3920.

berquist avatar Oct 25 '19 20:10 berquist

It doesn't use-package issue, it is on swiper, I think. The line disappears now, your issue still exist?

conao3 avatar Feb 22 '21 16:02 conao3

@berquist I was just having a similar issue with ivy-re-builders-alist. For whatever reason, moving the assignment to :config (with the needed setq) seems to have solved the issue. It's as if the variables assigned values via :custom are getting overwritten by the defaults, but not those assigned via :config. Since I still don't understand the difference between how :custom and :config are supposed to differ, I don't know whether this is a use-package issue or a swiper one.

apc avatar Mar 29 '21 13:03 apc