From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: Mapping file types to major modes Date: Fri, 23 Sep 2022 19:09:34 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36632"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/+ () (2022-06-11) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 23 23:37:40 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obqMe-0009NB-KZ for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Sep 2022 23:37:40 +0200 Original-Received: from localhost ([::1]:36210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obqMd-0007s5-Nl for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Sep 2022 17:37:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obqLG-0006Sc-04 for emacs-devel@gnu.org; Fri, 23 Sep 2022 17:36:14 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:34417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obqLE-0003aj-Fc for emacs-devel@gnu.org; Fri, 23 Sep 2022 17:36:13 -0400 Original-Received: from localhost ([::ffff:197.239.5.97]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000B5AC6.00000000632E26AB.00007754; Fri, 23 Sep 2022 14:35:38 -0700 Mail-Followup-To: Stefan Monnier , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296094 Archived-At: * Stefan Monnier [2022-09-23 18:48]: > Emacs has various facilities to decide which major mode to use for which > file based on its name and/or contents. All those facilities specify > directly the mode to use. This is usually exactly what we want because > there's only ever 1 major mode for that type. I agree on good idea that it would be helpful that major modes correspond to file types, though practically it is not so easy to determine it. Example is asciidoctor that can in some cases look completely same as markdown, also txt2tags that may look as markdown and similar lightweight markup languages. Additionally many applications produce .txt files which are markdown formatted. I suggest that upon first invocation where mode is unclear that Emacs asks user about preferred mode and give him option to understand descriptions and differences of such modes. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/