[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Specifying a file in auto-mode-alist
From: |
Stefan Monnier |
Subject: |
Re: Specifying a file in auto-mode-alist |
Date: |
Fri, 23 Apr 2021 18:23:45 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> (add-to-list 'auto-mode-alist '("^[Bb]uild.*\\.log$" . compilation-mode))
[...]
> emacs ~/workspace/src/build.log
> Nope, it shows up in Fundamental mode.
BTW, this is because of the `^` in his regexp: the regexps in
`auto-mode-alist` are matched against the full (absolute) file name, so
your regexp has to match ".../build.log" rather than just "build.log".
Stefan