From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: IDE Date: Sun, 18 Oct 2015 20:58:57 +0200 Message-ID: <87twpoknpq.fsf@fencepost.gnu.org> References: <83bnc7tavr.fsf@gnu.org> <5618C92A.3040207@yandex.ru> <83a8rrt9ag.fsf@gnu.org> <871tcyexa9.fsf@fimbulvetr.bsc.es> <87612a7my2.fsf@fencepost.gnu.org> <561DC925.5050001@siege-engine.com> <561E32D2.4060501@yandex.ru> <83wpum3ozk.fsf@gnu.org> <87si59ln6u.fsf@isaac.fritz.box> <56224B63.3010803@yandex.ru> <87k2qlldny.fsf@isaac.fritz.box> <5622AD4D.3010504@yandex.ru> <87bnbwl7ac.fsf@isaac.fritz.box> <5623CA16.5090300@yandex.ru> <87wpukje2o.fsf@isaac.fritz.box> <87vba411pf.fsf@Rainer.invalid> <8737x8m3pg.fsf@fencepost.gnu.org> <87io64106c.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1445194755 22266 80.91.229.3 (18 Oct 2015 18:59:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2015 18:59:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Achim Gratz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 18 20:59:07 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZntAg-00069v-Jn for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 20:59:06 +0200 Original-Received: from localhost ([::1]:35207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZntAf-00026P-Od for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 14:59:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZntAZ-00026H-3W for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:58:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZntAY-0005LU-6F for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:58:59 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZntAY-0005LQ-37; Sun, 18 Oct 2015 14:58:58 -0400 Original-Received: from localhost ([127.0.0.1]:36797 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZntAX-00011f-L4; Sun, 18 Oct 2015 14:58:57 -0400 Original-Received: by lola (Postfix, from userid 1000) id 0E10BDF535; Sun, 18 Oct 2015 20:58:57 +0200 (CEST) In-Reply-To: <87io64106c.fsf@Rainer.invalid> (Achim Gratz's message of "Sun, 18 Oct 2015 20:50:03 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192001 Archived-At: Achim Gratz writes: > David Kastrup writes: >> Achim Gratz 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 =E2=80=98files.el=E2=80=99. [...] > 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. --=20 David Kastrup