Skip to content

a13/use-package-custom-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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)))))

About

:custom-update keyword for use-package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published