Mirzhan Irkegulov
Mirzhan Irkegulov

Reputation: 18055

Emacs: how to find a variable by its value?

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?

Upvotes: 15

Views: 1430

Answers (2)

event_jr
event_jr

Reputation: 17707

The required command is apropos-value.

Upvotes: 4

yibe
yibe

Reputation: 4109

M-x apropos-value RET ^"/var/www/"$ RET

Upvotes: 18

Related Questions