I have some value and know that some Emacs variable holds it. How to find, which variable has this value in it? The value can be a symbol, integer or string, and the variable may hold the value itself, but a list which contains a value.
Example. A variable default-directory
contains string "/var/www/"
. I have that string, but i suddenly forgot the variable's name. How do i search through variables and find that default-directory
contains that string?
Is there some builtin function for that, or the only solution is custom elisp snippet?
setq does not evaluate symbol ; it sets the symbol that you write. We say that this argument is automatically quoted. The ' q ' in setq stands for “quoted”. The value of the setq form is the value of the last form .
There are actually two kinds of variables in Common Lisp, called lexical (or static) variables and special (or dynamic) variables. At any given time either or both kinds of variable with the same name may have a current value.
To define a customizable variable, you should use defcustom (which calls defvar as a subroutine). See Variable Definitions. This special form defines symbol as a variable. Note that symbol is not evaluated; the symbol to be defined should appear explicitly in the defvar form.
M-x apropos-value
RET ^"/var/www/"$
RET
The required command is apropos-value
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With