Skip to content

Commit

Permalink
Enhance defcustom definitions
Browse files Browse the repository at this point in the history
While there is a `list' type in `defcustom', it is meant for a very specific list. '(list string) means that you want a list with exactly one string. '(list string function) means that the customizable variable should take two elements: a string and a function.

However, we want arbitrary many strings, that's what `repeat' is for. Note that we could probably use `file' instead of `string', but the auto-completion does not recognize the `dotfiles-folder' as search-folder. Oh well.

For directories there is the special type 'directory'.
  • Loading branch information
bkaestner committed Feb 1, 2021
1 parent 52a4a77 commit 7cc86d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions show-notes/Emacs-Lisp-04.org
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,13 @@ We're going convert a couple of the variables from last time into customizable v

(defcustom dotfiles-folder "~/.dotfiles"
"The folder where dotfiles and org-mode configuration files are stored."
:type 'string
:type 'directory
:group 'dotfiles)

(defcustom dotfiles-org-files '()
"The list of org-mode files under the `dotfiles-folder' which
contain configuration files that should be tangled"
:type '(list string)
:type '(repeat string)
:group 'dotfiles)

(defun dotfiles-tangle-org-file (&optional org-file)
Expand Down

0 comments on commit 7cc86d3

Please sign in to comment.