When I execute a M-x describe-variable web-mode-markup-indent-offset I get this output:

web-mode-markup-indent-offset is a variable defined in `web-mode.el'.
Its value is 4
Original value was 2

Html indentation level.

You can customize this variable.

I want the original value, but I can't find where in my setup I've set it to 4. Is there a way to determine this? (I'm using prelude, if that matters).

  • No the "Is there any way to trap when this variable is changed and display or log some sort of backtrace?" question in the pointed to answer was never answered. We specifically want to be able to set some type of hook or trap or something that gives a backtrace into the messages buffer whenever that variable gets set. – bgoodr Aug 28 '19 at 15:55

A variable might be changed anywhere at runtime. Grep for it's name to see at which point it happens.


Don't know much about Prelude, but if the variable has value 4 after running just

% emacs
C-h v web-mode-markup-indent-offset RET

then it's presumably somewhere in "your" configuration.

If not, then it might still be somewhere in your configuration, but via a piece of code whose execution is delayed. You can try to use the new M-x debug-watch feature in Emacs-26 to track it down.

But I think I'd personally start with something like what Andreas recommends:

find ~/. -type f -print0 | xargs -0 grep -n 'web-mode-markup-indent-offset'

Not the answer you're looking for? Browse other questions tagged or ask your own question.