From 7cc86d344f32d6dce349efaa8f024a01c4cd3f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20K=C3=A4stner?= Date: Mon, 1 Feb 2021 18:49:58 +0100 Subject: [PATCH] Enhance defcustom definitions 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'. --- show-notes/Emacs-Lisp-04.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/show-notes/Emacs-Lisp-04.org b/show-notes/Emacs-Lisp-04.org index 3124e98..49810e4 100644 --- a/show-notes/Emacs-Lisp-04.org +++ b/show-notes/Emacs-Lisp-04.org @@ -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)