From 5a253c144573a81ca52fd48006938e8f8cbdf748 Mon Sep 17 00:00:00 2001 From: Youmu Date: Fri, 2 Oct 2020 00:52:59 +0800 Subject: [PATCH] Use EOS instead of EOL for auto mode regexp This prevent matching filename like "xxxx.pom\nxxxx". A corner case which satisfies POSIX filename standard but weird for daily use. I found many regexp in auto-mode-alist are ended with \\' but typescript-mode use $. So curiosity drives me to find the answer. You can create a file which name contains a linebreak by pressing C-j in find-file prompt. --- modules/prelude-xml.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prelude-xml.el b/modules/prelude-xml.el index 35810ba..20b7e02 100644 --- a/modules/prelude-xml.el +++ b/modules/prelude-xml.el @@ -35,7 +35,7 @@ (push '("<\\?xml" . nxml-mode) magic-mode-alist) ;; pom files should be treated as xml files -(add-to-list 'auto-mode-alist '("\\.pom$" . nxml-mode)) +(add-to-list 'auto-mode-alist '("\\.pom\\'" . nxml-mode)) (setq nxml-child-indent 4) (setq nxml-attribute-indent 4)