15

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?

Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166

2 Answers2

18

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

yibe
  • 3,939
  • 2
  • 24
  • 17
4

The required command is apropos-value.

event_jr
  • 17,467
  • 4
  • 47
  • 62