[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IDE
From: |
Achim Gratz |
Subject: |
Re: IDE |
Date: |
Sun, 18 Oct 2015 20:50:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
David Kastrup writes:
> Achim Gratz <address@hidden> writes:
>
>> David Engster writes:
>>> It doesn't help that Emacs is a very conservative piece of software. A
>>> good example was already given: C++ includes without an extension. By
>>> default, Emacs will open such files in fundamental mode.
>>
>> If I use /usr/bin/file on such an include, it happily tells me it's been
>> looking at "C++ source, ASCII text". So instead of insisting on a known
>> extension to determine the major mode, Emacs could check what the file
>> mode is supposed to be in its absence before falling back to fundamental
>> mode.
>
> Emacs can do that.
>
> magic-mode-alist is a variable defined in ‘files.el’.
> Its value is nil
>
> This variable may be risky if used as a file-local variable.
>
> Documentation:
> Alist of buffer beginnings vs. corresponding major mode functions.
> Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION).
> After visiting a file, if REGEXP matches the text at the beginning of the
> buffer, or calling MATCH-FUNCTION returns non-nil, ‘normal-mode’ will
> call FUNCTION rather than allowing ‘auto-mode-alist’ to decide the buffer’s
> major mode.
>
> If FUNCTION is nil, then it is not called. (That is a way of saying
> "allow ‘auto-mode-alist’ to decide for these files.")
>
> [back]
Well, that does the opposite of what I described: it doesn't check
auto-mode-alist at all when it matches. I want auto-mode-alist to take
precedence and only if it doesn't know any better than
"fundamental-mode" should it consult some other mechanism.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
- Re: IDE, (continued)
- Re: IDE, David Engster, 2015/10/18
- Re: IDE, David Kastrup, 2015/10/18
- Re: IDE, Dmitry Gutov, 2015/10/18
- Re: IDE, David Engster, 2015/10/18
- Re: IDE, David Kastrup, 2015/10/18
- Re: IDE, Eric Ludlam, 2015/10/19
- Re: IDE, Achim Gratz, 2015/10/18
- Re: IDE, David Kastrup, 2015/10/18
- Re: IDE,
Achim Gratz <=
- Re: IDE, David Kastrup, 2015/10/18
- Re: IDE, Dmitry Gutov, 2015/10/18
- Re: IDE, Eric Ludlam, 2015/10/19
- Re: IDE, Dmitry Gutov, 2015/10/20
- Re: IDE, Eric Ludlam, 2015/10/20
- Re: IDE, Dmitry Gutov, 2015/10/21
- Re: IDE, Eric Ludlam, 2015/10/21
- Re: IDE, Dmitry Gutov, 2015/10/21
- Re: IDE, Eric Ludlam, 2015/10/21
- Re: IDE, Dmitry Gutov, 2015/10/22