From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Add a separate mode for .dir-locals.el Date: Sat, 19 Oct 2019 12:51:37 -0400 Message-ID: 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> <83a79w7rg6.fsf@gnu.org> 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="82239"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: emacs-devel@gnu.org, joaotavora@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 19 18:51:50 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 1iLrxG-000LId-1F for ged-emacs-devel@m.gmane.org; Sat, 19 Oct 2019 18:51:50 +0200 Original-Received: from localhost ([::1]:59366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLrxE-0000m4-5V for ged-emacs-devel@m.gmane.org; Sat, 19 Oct 2019 12:51:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54016) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLrx7-0000kP-JC for emacs-devel@gnu.org; Sat, 19 Oct 2019 12:51:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLrx6-0003qz-CW for emacs-devel@gnu.org; Sat, 19 Oct 2019 12:51:41 -0400 Original-Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:33386) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLrx6-0003qZ-6s; Sat, 19 Oct 2019 12:51:40 -0400 Original-Received: by mail-qt1-x82b.google.com with SMTP id r5so14005550qtd.0; Sat, 19 Oct 2019 09:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=moRGJS7qsJcla7gnfW44zas03kvAWNYPuOIfvCg93JU=; b=uXjQtq/i89c4fMkmdSm2jXVq2yHTSLN2e2URYgMd7pnPQskpjx0Uq8VM8BWsZ6eYSY dXOVww1dvDOnD3LO5fEHSjcVFqL5BCPBp6zu1bwCuo72FSaQo3yEVU6o4EYLImdv9vOw sBoQagj5cS2Qtz2XJa1NBoJdPbRjg01kbDL7sfOsnEV8ZstvW5JDUyTDLxXJINjxMiBm VozKrFShFUyf9YNfBtHjmh0Oe+DBi1vu00E9z7vJWShwP54U3asT8gUY4iPNBO/Pqp1b Lyz3pdn7LNB1vVTsKKOZkYU97vuQKw6fNGXxwoEaxXwSgbSw13wOoieIzRP0P8ipTe/s amZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=moRGJS7qsJcla7gnfW44zas03kvAWNYPuOIfvCg93JU=; b=tx1f9MIElAvlFsMEHZH1GT/x4v8NAVEO3CSdwjVqGB6/K+ha7er1onV509g7jdU1NR CNPIRDK0eTCZqkebkDfIfV+nqNZjapYZmmcDr6RM1wOpNXlThoKD4hqUhJYGZvzxji6M YXb5ehZNGHFa7Z7hBAqabymkRE86WhrOPZocrOvx85HSlizR0o7VTm2IdA6SNmHQ1MkJ i8rs3XQL7ih2Vrdkj7zC6C4yZrTCg8Q38QLJnF878x/CouJ89yCP9kgA054F8QTP2iyr e7tccj6FHl+EE5ko8dCsQM09IA3AvbDZIdoZM4V4T6lvtf9eD4SuCqW6mbaXSp8Xh7Ou Mmzg== X-Gm-Message-State: APjAAAULa8D0gH2TyJqsFj9Wzp6Pm17Q4ColsgXz5PPh72+FAmAusdTF bft1g3T2DF1y1exHxM/SHuR7mAZY X-Google-Smtp-Source: APXvYqzVgR+7j3Pyk/uGxk7ms/AOJi/xuV+e4jYNz/IP09ruJPYyAW61gNlQ4TematyBnBBNAE5kyg== X-Received: by 2002:ac8:8a1:: with SMTP id v30mr3409454qth.44.1571503899491; Sat, 19 Oct 2019 09:51:39 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:29f4:b2db:5f83:f6d2? ([2601:184:4180:66e7:29f4:b2db:5f83:f6d2]) by smtp.googlemail.com with ESMTPSA id o14sm6048503qtk.52.2019.10.19.09.51.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Oct 2019 09:51:38 -0700 (PDT) In-Reply-To: <83a79w7rg6.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82b 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:241235 Archived-At: On 2019-10-19 10:14, Eli Zaretskii wrote: >> 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. That's true. I didn't give these files much thought, because (since they don't end in .el) they don't trigger emacs-lisp-mode, and so they are not a problem for Flycheck. > 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. That's true if we were to introduce a general mode for Lisp data (and, indeed I haven't given such a mode much thought). If we introduced a mode specifically designed for dir-locals files, on the other hand, it would be turned on automatically for all relevant files (but I see why it's more attractive to look for a solution more general than a dir-locals mode). > 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. Understood. So, for now at least, I will push a patch to Flycheck along the lines of the patch you suggested for Flymake. Clément.