From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Add a separate mode for .dir-locals.el Date: Sat, 19 Oct 2019 17:14:33 +0300 Message-ID: <83a79w7rg6.fsf@gnu.org> References: <2058328b-aee5-8cb1-2659-a793e1354517@mit.edu> <835zkndcz4.fsf@gnu.org> <83ftjrbjhm.fsf@gnu.org> <83ftjr9sx4.fsf@gnu.org> <83eezb9s5b.fsf@gnu.org> <83bluf9qgb.fsf@gnu.org> <835zkn9o01.fsf@gnu.org> <83lfti8ovn.fsf@gnu.org> <83d0eu8c80.fsf@gnu.org> <83lfth6p0y.fsf@gnu.org> <7f141905-6be3-2c21-e2af-b5926dd80223@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="264124"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org, joaotavora@gmail.com, monnier@iro.umontreal.ca To: =?windows-1252?Q?Cl=E9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 19 16:14:54 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iLpVN-0016by-Ql for ged-emacs-devel@m.gmane.org; Sat, 19 Oct 2019 16:14:53 +0200 Original-Received: from localhost ([::1]:55580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLpVM-0005a9-Fv for ged-emacs-devel@m.gmane.org; Sat, 19 Oct 2019 10:14:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41709) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLpVG-0005Za-5n for emacs-devel@gnu.org; Sat, 19 Oct 2019 10:14:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iLpVF-0002o4-IZ; Sat, 19 Oct 2019 10:14:45 -0400 Original-Received: from [176.228.60.248] (port=1732 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iLpVF-0006yV-0S; Sat, 19 Oct 2019 10:14:45 -0400 In-reply-to: <7f141905-6be3-2c21-e2af-b5926dd80223@gmail.com> (message from =?windows-1252?Q?Cl=E9ment?= Pit-Claudel on Sat, 19 Oct 2019 08:53:23 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:241233 Archived-At: > From: Clément Pit-Claudel > Date: Sat, 19 Oct 2019 08:53:23 -0400 > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > > Yes, I can describe in more details. [...] Thanks, Clément, for your detailed description. It really makes the situation with Flymake crystal clear. > My motivation for proposing a separate mode was that we already have a mechanism (atuo-mode-alist) to attach specific behaviors to specific file names, so it seemed natural to reuse that mechanism to run different code for regular ELisp files and dir-locals files. IOW, I thought it was an anti-pattern to do file-name checks in a major-mode definition. But this part only works for .dir-locals.el files, it will not work for any file named otherwise. E.g., my saveplace file is called _places.sav (for boring historical reasons), and the only way of using such a new mode for it would be to manually turn it on when that file is visited. The same will happen with ~/.emacs.d/bookmarks and for many other files that just hold Lisp data. That's not how our major modes work: Emacs almost always turns them on automatically, by examining the file's name or contents. > Finally, what motivated me to propose a split was the fact that a fix was needed in two places (Flymake and Flycheck), and likely in others (company and completion-at-point-functions should ideally work differently in .dir-locals.el; imenu doesn't make much sense there, ELisp syntax-highlighting is sub-optimal for these files outside of `eval' forms, etc.). I suggested to collect the traits common to these files, and then discuss what would be the appropriate mode for them. I don't think we have now a clear picture of what is or might be needed. In particular, I don't think we have enough data to decide whether elisp-mode should support such files as a built-in feature, or there's enough differences to justify a separate mode. In the latter case, we will have to devise some way of turning on that new mode automatically in most cases. Thanks.