emacs-devel
[Top][All Lists]
Advanced

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

Re: IDE


From: David Kastrup
Subject: Re: IDE
Date: Sun, 18 Oct 2015 20:58:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Achim Gratz <address@hidden> writes:

> 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’.

[...]

> 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.

Ok, how about a different approach using auto-mode-alist?
auto-mode-alist contains several patterns including directories, so one
could match on /include/[a-zA-Z-]+\' or similar.  That's somewhat crude
(and non C++ programmers might protest the results) but at least for a
C++ programmer it seems like a reasonable default setting.  Another
possibility for particular projects would be to use directory variables.

-- 
David Kastrup



reply via email to

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