For some reason, my script mode shells are not executing. An example in my .emacs:
(add-hook 'shell-script-mode-hook (lambda () (rainbow-delimiters-mode 1)))
causes the variables to be set, but the mode does not load for open script files. What is the correct way here?
I use the default shell mode script (modeline says, for example, Shell-script[bash] ). Do I need to connect for each type of shell individually (sh, bash, zsh)? If so, can you tell me how?
Thank you very much!
EDIT3:
This turned out to be due to a text mode conflict with the insertion of a skeleton-pair in sh-mode (I tried to avoid a conflict by disabling textmate in sh-mode, which then left sh-mood-hook aparatus in ruins. I completely deleted text mode and now use the standard skeleton-pair globality.
I agree with the phils answer - without it, I probably would not be able to debug this on my own.
EDIT2:
Thanks to phils, I think his comment brings us closer to a solution. However, this is not a problem with rainbow separators. I removed all sh-mode-hook except your welcome message and restarted Emacs. When I open the .sh file, I get the following:
Indentation settings for the bash shell type indentation settings. Indentation variables are now local. Indenting the bash shell type Invalid file mode specification: (void-function nil)
Pay attention to the message "hello." Sh-mode-hook value: (nil (lambda nil (message "hello")))
I think the problem is that this is the first nil value - although I donβt see it being installed anywhere.
If I do this:
(setq sh-mode-hook t) (add-hook 'sh-mode-hook (lambda () (message "hello")))
I see a welcome message, although after a reboot (I put these lines in .emacs) it disappeared again (zero again on the top of the hook).
Any idea what to do to have an active hook when setting up?
EDIT1: I also tried:
(add-hook 'sh-mode-hook (lambda () (rainbow-delimiters-mode 1)))
with the same negative result - I'm not sure that this is relevant, although ...