tanishk56bisht · 2022-06-16 13:06
I am trying to load the impatient-mode as soon as I open an html file on Emacs
So i added this in my config.el file
(require 'impatient-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\' " . impatient-mode))
But it doesn't work and the browser says
Public Buffers
Enable impatient-mode in buffers to publish them.
Help me out with this please
Sudo_Brew · 2022-06-16 16:25
Regular expressions in ELisp have some odd differences with most other regex engines. In particular here, when you write a regex as a string like this, you have to escape the backslashes with more backslashes. Try this:
```
(require 'impatient-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . impatient-mode))
```
Edit: I've never used impatient-mode so if this isn't the issue, I'm probably of no further help
tanishk56bisht · 2022-06-17 07:20
Yes ill try this thanks
I actually figured it out how to make it work
I wrote
(add-hook 'web-mode-hook impatient-mode)
And it's working just how I wanted it to
So thanks anyways I'll try out your method as well
Sudo_Brew · 2022-06-17 13:43
Great solution! That way is possibly even better than just running on html files
tanishk56bisht · 2022-06-17 13:44
Yess
Thanks