Skip to content
:custom-update keyword for use-package
Emacs Lisp
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Works as :custom keyword, but instead of a value takes update function or the second (the first is the original one) argument to the default updater


(use-package use-package-custom-update
  (use-package-custom-update :repo "a13/use-package-custom-update" :fetcher github :version original))


Using value and default updater

If you want to add elements to a list testlist (similar to add-to-list)

(use-package emacs
  (testlist '(1 2)))

By default a variable is modified by use-package-custom-update-union function, which takes a variable value (or its symbol, if use-package-custom-update-updater-use-symbol is set to true) as the first argument, and the supplied updater second, you can customize it by setting use-package-custom-update-default-updater function.

Using a function

(use-package emacs
  (testlist (lambda (old-value)
              (append old-value '(1 2 3)))))
You can’t perform that action at this time.