help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specifying a file in auto-mode-alist


From: Patrick Mahan
Subject: Re: Specifying a file in auto-mode-alist
Date: Fri, 23 Apr 2021 15:09:04 -0700

On Fri, Apr 23, 2021 at 1:51 PM Óscar Fuentes <ofv@wanadoo.es> wrote:

> Patrick Mahan <plmahan@gmail.com> writes:
>
> > All,
> >
> > I have build scripts that capture a build (makefile output) into files
> > called build*.log or Build*.log. These files may occur at various points
> in
> > the directory tree.
> >
> > However if I use the following:
> >
> > (add-to-list 'auto-mode-alist (quote("build*\\.log'" .
> compilation-mode)))
> ____________________________________________________^
>
> > When I edit a file say 'build.log' it does not enable compilation mode.
> >
> > I tried -
> >
> > (add-to-list 'auto-mode-alist (quote("build*\\'" . compilation-mode)))
> ________________________________________________^
>
> Why the ' ?
>
>
A lot of the examples in the wiki used them.  But I see I should have
prefaced it with \\'.


> Try this regexp: "^[Bb]uild.*\\.log$"
>
> That means: Starts with B or b followed by uild and then zero or more
> arbitrary characters and ends with .log
>
> (add-to-list 'auto-mode-alist '("^[Bb]uild.*\\.log$" . compilation-mode))
>
>
emacs ~/workspace/src/build.log
Nope, it shows up in Fundamental mode.

Neither does emacs ~/workspace/src/build202104191533.log

Is there a "verbose" mode for emacs?  Someway of seeing what is being
applied?

Thanks,

Patrick


reply via email to

[Prev in Thread] Current Thread [Next in Thread]