Guix and Nix have derivation files that look like "/gnu/store/.*\\.drv". To 
avoid choosing the wrong mode, we prefer to use more stringent regexps for 
those corresponding modes, and add the less-stringent regexp here to the end of 
auto-mode-alist.

-- 
Sent with https://mailfence.com
Secure and private email
>From 5521037d319d25f8b6d845ba78026c4226d2a6c2 Mon Sep 17 00:00:00 2001
From: Brian Leung <[email protected]>
Date: Fri, 22 Jan 2021 12:28:53 -0800
Subject: [PATCH] latex-mode: add "\\.drv\\'" to the end of `auto-mode-alist'

Guix and Nix derivations have paths like '/gnu/store/hash-123.drv', so
we prefer to add latex-mode's regexp to the end of `auto-mode-alist'
and use more stringent regexps for Guix/Nix derivations.

Guix uses a regexp that looks something like "/gnu/store/.*\\.drv",
and a similar patch has been submitted for Nix's derivation mode.
---
 latex.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/latex.el b/latex.el
index b4fd7d38..33851593 100644
--- a/latex.el
+++ b/latex.el
@@ -6048,7 +6048,7 @@ This happens when \\left is inserted."
 (TeX-abbrev-mode-setup latex-mode)
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.drv\\'" . latex-mode))
+(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
 
 ;; HeVeA files (LaTeX -> HTML converter: http://hevea.inria.fr/)
 ;;;###autoload
-- 
2.30.0

Reply via email to