Questions tagged [defcustom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

How can I get the tag value associated with a current custom variable?

I've got a custom variable defined: (defcustom monorail-search-mode :issues-open "Current search mode for queries (controls whether we're searching all issues, open issues, new issues, etc)&...
0
votes
1answer
43 views

How to properly specify defcustom default list of heterogeneous types?

How to properly write the default value for a non-trivial defcustom form for something like I have below: a list of 3-element lists, with choices of the types? The defcustom form is: defcustom ...
1
vote
1answer
28 views

How to properly specify defcustom default list of non-trivial data types?

How to properly write the default value for a non-trivial defcustom form in standard for something like I have below: a list of 3-element lists, with choices of the types? The defcustom form is: ...
0
votes
1answer
25 views

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 ...
0
votes
2answers
123 views

How to run a function when setting a 'defcustom' option?

Is it possible to run code when setting an option defined by defcustom? For example, I would like (setq my-package-option t) to install a hook. While defcustom has a :set keyword, it's documented ...
4
votes
1answer
588 views

init.el and trampling of custom-set-variables

My new init.el uses require to load various settings that I have organised into directories and files. This is an attempt to tame what was a very large and messy init.el and custom.el file. Also I ...
1
vote
0answers
37 views

Storing and Loading Non-Static/Multiple Configs

I'm writing an emacs wrapper to a set of scripts that require a lot of config settings to run. These can be variously environment variables, command line parameters and so forth. They should be user ...
0
votes
1answer
65 views

How to set up personal information alist with defcustom

I would like to have a variable, say my-info that would have an alist attached to it. In normal programming it would look like this: (setq my-info '((my-name . "Giuseppe Sextus-Packus") (my-email . "...
1
vote
1answer
27 views

How best to define nullable integer customizable variables?

I would like to define a variable using defcustom so that it can be customized by users of an emacs package. The variable is an integer (let's call it spam-override), and its function is to override ...
3
votes
0answers
60 views

How to define a “composite type” with the “group” constructor?

I am trying to define a composite type using the "group" compositor (see Elisp Manual, section "Composite Types"). Previously, I managed to define a composite type with the "list" constructor. The ...
1
vote
1answer
550 views

How to overwrite a defcustom of a package within the initfile?

I have an installed packages (say mypackage.el) in \.emacs.d\lisp\ directory. In that package there is (defcustom xyz "path1" "Path to the program" :group 'blablabla :type 'string) I would like ...
1
vote
1answer
46 views

macro takes multiple pairs of arguments

I found this snippet of code from oremacs (defmacro csetq (variable value) `(funcall (or (get ',variable 'custom-set) 'set-default) ',variable ,value)) I would like to expand this macro so that is ...
2
votes
1answer
306 views

How to create a defcustom variable that accepts only a vector of strings?

I am using repeat for now. But I don't know how to have the same for vector. EDIT: I want INS and DEL options like in repeat.
2
votes
0answers
33 views

How to translate between custom choice type and widget items?

I have a custom variable (defcustom myvar .... :type '(choice (const :tag "foo" 1) ...)) and I need to map it to (widget-create ... '(item :tag "foo" :value 1) ...) ...
2
votes
1answer
122 views

What is the recommended way to generalize a defcustom from atom to sequence?

In an Emacs package I have a defcustom, say custom-string, that is defined as an atom of type string like so: (defcustom custom-string "foo" "A customizable string." :type 'string) I need to ...
3
votes
1answer
40 views

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 ...
2
votes
1answer
221 views

Define a customizable (defcustom) key binding

I want to allow the user to redefine key bindings for the interactive commands in a major mode. I tried putting them in strings, but I can't get the customized variable value in my mode-map. Here's ...
4
votes
1answer
140 views

Autoloading defcustoms: good practice or not?

In my init file, I often find myself trying to set a customizable variable before the file (usually a mode of some sort) is loaded. This, of course, results in an error. While this problem could be ...
2
votes
1answer
129 views

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 ...
3
votes
2answers
626 views

Should “custom” variables defined without defcustom be set via custom-set-variables or setq?

Should I use custom-set-variables (as opposed to setq) when setting a variable that returns non-nil for custom-variable-p but was not defined by defcustom? For example, echo-keystrokes is defined in ...
3
votes
2answers
324 views

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-...
-1
votes
1answer
15 views

Hide some entries in the customize interface? Or prevent the user from setting them?

I'm writing a package where I need to store some data and restore it in the next session. I don't want to create a file for it so my idea is to save it with customize-save-variable. This works great ...
1
vote
1answer
71 views

How to sync customize interface with external config file?

I would like to have an interface in customize for a package I'm writing. Whenever I set the values it should update an external config file, too. So the values should be saved in the emacs custom ...
8
votes
1answer
1k views

What is a hook?

Just to clarify... For example, in this doc: A hook is a Lisp variable which holds a list of functions, to be called on some well-defined occasion. (This is called running the hook.) The ...
15
votes
2answers
4k views

How to properly use defcustom?

Like most Emacs users I've customized a mode by changing the variables. What never occurred to me is the whole programming mentality behind having customizable this-and-that. I realized this when I ...
0
votes
1answer
42 views

What is the “customize” feature associated with defcustom and used in projectile.el?

Asking this question because it's really hard to Google "emacs customize" and get to the feature. From the defcustom documentation: You can specify variables using defcustom so that you and ...