Questions tagged [defcustom]
34 questions
4
votes
2 answers
defcustom values for selecting from function call?
I have definition:
(defvar my/python-checker-alist
'((pylint . (my/python-pylint-command my/python-pylint-args))
(pep8 . (my/python-pep8-command my/python-pep8-args))
(pyflakes . (my/python-pyflakes-command my/python-pyflakes-args)))
…

gavenkoa
- 3,452
- 20
- 37
3
votes
1 answer
Put a constraint on defcustom with variable type
I have a defcustom with :type variable,
and I would like to constrain the variable name to comply to a pattern.
How would I do that?
for instance let say I want the custom to only accept a variable name starting with some prefix.

AdrieanKhisbe
- 209
- 1
- 10
2
votes
0 answers
how to provide a list of options for a defcustom
i'm writing a defcustom, and i would like to provide a list of strings containing valid options (in a manner akin to how completing-read takes a collection and you can require-match). i have tried the :options keyword, but it doesn't seem to work…

martian
- 548
- 3
- 11
2
votes
1 answer
Using the `:set` and `:initialize` keywords of `defcustom`
I recently encountered a situation in which specifying a :set function for a defcustom raised a Symbol's function definition is void error.
This is because the :set function relies on another function in the same package, which is not yet loaded…

Tianxiang Xiong
- 3,878
- 18
- 28
1
vote
1 answer
is there a defcustom type for a keymap?
I have some defcustom variables that are for keymaps. Is there a way to set the :type in a defcustom to indicate it should be a keymap?
Is the right way to do it like this?
:type '(restricted-sexp :match-alternatives keymapp)

John Kitchin
- 11,891
- 1
- 20
- 42
0
votes
0 answers
Setting custom variable to a cons
I have the following user customisation declaration.
(defgroup px-initial-frame nil
"Customisation group for position of initial frame."
:group 'convenience)
(defcustom px-frame-pos (cons 8 8)
"Position of initial frame."
:type 'sexp
…

Dilna
- 1
- 3
- 11
0
votes
1 answer
why defcustom variable is not seeable from describe symbol?
take org-brain-path for example:
(defcustom org-brain-path (expand-file-name "brain" org-directory)
"The root directory of your org-brain.
`org-mode' files placed in this directory, or its subdirectories,
will be considered org-brain entries."
…

Chen Li
- 137
- 1
- 7