Fix (cached-)nix-shell interpreter-mode-alist entries
By combining them. Also emit a more helpful message if the sub-interpreter cannot be read.
This commit is contained in:
parent
169fe6a7f4
commit
483a7caf0f
2 changed files with 3 additions and 3 deletions
|
@ -46,7 +46,8 @@
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(when (re-search-forward "#! *\\(?:cached-\\)?nix-shell +-i +\\([^ \n]+\\)" 256 t)
|
(if (not (re-search-forward "#! *\\(?:cached-\\)?nix-shell +-i +\\([^ \n]+\\)" 256 t))
|
||||||
|
(message "Couldn't determine mode for this script")
|
||||||
(let* ((interp (match-string 1))
|
(let* ((interp (match-string 1))
|
||||||
(mode
|
(mode
|
||||||
(assoc-default
|
(assoc-default
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
;;; lang/nix/config.el -*- lexical-binding: t; -*-
|
;;; lang/nix/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package! nix-mode
|
(use-package! nix-mode
|
||||||
:interpreter ("cached-nix-shell" . +nix-shell-init-mode)
|
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
||||||
:interpreter ("nix-shell" . +nix-shell-init-mode)
|
|
||||||
:mode "\\.nix\\'"
|
:mode "\\.nix\\'"
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'nix-mode 'company-nixos-options)
|
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue