Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [defcustom]

The tag has no usage guidance.

1
vote
1answer
19 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 ...
2
votes
0answers
44 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 ...
0
votes
1answer
77 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
34 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
69 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.
0
votes
0answers
13 views

Patch user-customizations with new defaults?

I want to create a defcustom variable, that contains an alist mapping mode names to values. When the default value gets updated to include defaults for new modes, I want customizations created by the ...
0
votes
0answers
26 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
75 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 ...
4
votes
1answer
32 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
149 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
114 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
55 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 ...
1
vote
1answer
255 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 ...
2
votes
2answers
216 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
13 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
54 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 ...
9
votes
1answer
756 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 ...
14
votes
2answers
2k 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
36 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 others ...