Skip to content
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

nix-drv-mode.el: make regexp more selective #127

Merged
merged 1 commit into from Jan 24, 2021

Conversation

leungbk
Copy link
Member

@leungbk leungbk commented Jan 22, 2021

In the Auctex package, latex.el adds '("\.drv\'" . latex-mode) to auto-mode-alist, so we
prefer to use some other regexp to avoid opening Nix derivations in the wrong mode.

I made the following patch to Auctex upstream just now:

(add-to-list 'auto-mode-alist '("\\.drv\\'" . latex-mode) t) ;; append to the end of `auto-mode-alist' to give higher priority to Guix/Nix's derivation modes

This way, the Nix-derivation regexp always gets checked first. I'm not aware of a quick way of mimicking a lookahead assertion in the Auctex regexp, but that would probably be preferable to what I did.

latex.el adds '("\\.drv\\'" . latex-mode) to auto-mode-alist, so we
prefer to use something else.
@matthewbauer matthewbauer merged commit 0023fc5 into NixOS:master Jan 24, 2021
@matthewbauer
Copy link
Member

Thanks!

@leungbk leungbk deleted the nix-drv-regexp branch January 24, 2021 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants