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:28:11 +0200 Message-ID: <8737x8m3pg.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> 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 1445192900 23931 80.91.229.3 (18 Oct 2015 18:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2015 18:28:20 +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:28:19 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 1Znsgs-0001jp-Bt for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 20:28:18 +0200 Original-Received: from localhost ([::1]:35108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znsgr-0003c2-0f for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 14:28:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znsgn-0003bs-VG for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:28:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Znsgn-00066Y-50 for emacs-devel@gnu.org; Sun, 18 Oct 2015 14:28:13 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Znsgn-00066U-1d; Sun, 18 Oct 2015 14:28:13 -0400 Original-Received: from localhost ([127.0.0.1]:36388 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1Znsgm-0008Li-2H; Sun, 18 Oct 2015 14:28:12 -0400 Original-Received: by lola (Postfix, from userid 1000) id 77D49DF535; Sun, 18 Oct 2015 20:28:11 +0200 (CEST) In-Reply-To: <87vba411pf.fsf@Rainer.invalid> (Achim Gratz's message of "Sun, 18 Oct 2015 20:17:00 +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:191995 Archived-At: 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. 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, =E2=80=98normal-mode=E2= =80=99 will call FUNCTION rather than allowing =E2=80=98auto-mode-alist=E2=80=99 to dec= ide the buffer=E2=80=99s major mode. If FUNCTION is nil, then it is not called. (That is a way of saying "allow =E2=80=98auto-mode-alist=E2=80=99 to decide for these files.") [back] --=20 David Kastrup