-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interaction with nix-mode: font-lock broken #324
Comments
Just thought I'd add here that I'm doing something similar - although with a dynamic innermode - and experiencing similar issues. I find that I can often ad-hoc fix things by invoking font-lock with {
script = /* sh */ ''
echo "This is in shell-script-mode"
'';
} Here's my config: (define-hostmode poly-nix-hostmode
:mode 'nix-mode)
(define-auto-innermode poly-nix-dynamic-innermode
:head-matcher "/[*] +[[:alpha:]]+ +[*]/ +''$"
:tail-matcher "^[ \t]+''"
:mode-matcher (cons "/[*] +\\([[:alpha:]]+\\) +[*]/" 1)
:head-mode 'host
:tail-mode 'host)
(define-polymode poly-nix-mode
:hostmode 'poly-nix-hostmode
:innermodes '(poly-nix-dynamic-innermode))
(add-to-list 'auto-mode-alist '("\\.nix" . poly-nix-mode)) |
It seems like the issue is with registering the mode in the hook - if I remove the |
Same problem in groovy hostmode with bash innermode. And with |
Replacing mode-hook with |
I have my emacs configured as a nix expression. In order to have the elisp sections of the config rendered in emacs lisp mode, I created a polymode to handle the elisp blocks in multi-line nix strings beginning with the string
'';;
. This breaks fontification in all nix files - syntax highlighting doesn't work until I run e.g.font-lock-debug-fontify
. When I disable the polymode, syntax highlighting works as expected. I am not an elisp wizard, so I'm not sure if this is an issue withnix-mode
orpolymode
. I was able to reproduce the issue with a minimal config file and load withemacs -q -l minimal.elisp
. The config file is below:If this is an issue with nix-mode, I'm happy to close this and reopen an issue there, but I'm hoping someone can help me figure out where the problem is. Thanks for a great package!
The text was updated successfully, but these errors were encountered: