I recently installed a new major mode for something I'm working on, and suddenly spaces in expressions I'm searching for don't work as expected. Help!

  • 3
    Care to tell us in which way they don't work as expected?
    – Stefan
    Commented Jan 25, 2020 at 20:18
  • 1
    The question is unclear. Please state (1) what behavior you see, that you didn't expect, and (2) what you expected instead. And then say what your question is, given that information. I expected to see a train. I saw a plane instead. My question is ____.
    – Drew
    Commented Jan 25, 2020 at 20:56

1 Answer 1


Anything that makes changes to your ~/.emacs/~/.emacs.d/init.el initialisation file may, for various reasons, tinker with the emacs variables isearch-regexp-lax-whitespace and search-whitespace-regexp. This may lead to behaviour other than what most emacs users are used to, that is, a single space character standing for an arbitrary number of whitespace characters. Thus, the fix would involve restoring these variables to their defaults, by adding the following lines at the end of the initialisation file.

(setq isearch-regexp-lax-whitespace t) (setq search-whitespace-regexp "\\s-+")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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