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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.org
use-package-custom-update.el

README.org

Info

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

Installation

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

Usage

Using value and default updater

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

(use-package emacs
  :custom-update
  (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
  :custom-update
  (testlist (lambda (old-value)
              (append old-value '(1 2 3)))))
You can’t perform that action at this time.