From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Achim Gratz Newsgroups: gmane.emacs.devel Subject: Re: IDE Date: Sun, 18 Oct 2015 20:50:03 +0200 Organization: Linux Private Site Message-ID: <87io64106c.fsf@Rainer.invalid> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1445194231 13975 80.91.229.3 (18 Oct 2015 18:50:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2015 18:50:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 18 20:50:22 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 1Znt2D-0005ts-Mw for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 20:50:21 +0200 Original-Received: from localhost ([::1]:35181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znt2C-0000cL-Ts for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 14:50:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znt29-0000c9-FS for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:50:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Znt25-00039K-Du for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:50:17 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znt25-00039F-6p for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:50:13 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Znt23-0005kh-KJ for emacs-devel@gnu.org; Sun, 18 Oct 2015 20:50:11 +0200 Original-Received: from p54b7fc46.dip0.t-ipconnect.de ([84.183.252.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 18 Oct 2015 20:50:11 +0200 Original-Received: from Stromeko by p54b7fc46.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 18 Oct 2015 20:50:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p54b7fc46.dip0.t-ipconnect.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:s0GILeB9/Gk1KobCHdmgyLssS7g= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:191999 Archived-At: 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 ‘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