From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 61fb521: Avoid false indications from Flymake in .dir-locals.el files Date: Mon, 21 Oct 2019 08:42:09 -0400 Message-ID: References: <20191021113052.21934.64094@vcs0.savannah.gnu.org> <20191021113055.AA1BF209DE@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="200091"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 21 14:42:26 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 1iMX10-000px3-A6 for ged-emacs-devel@m.gmane.org; Mon, 21 Oct 2019 14:42:26 +0200 Original-Received: from localhost ([::1]:40348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMX0z-00030B-5N for ged-emacs-devel@m.gmane.org; Mon, 21 Oct 2019 08:42:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59042) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMX0r-0002rq-3E for emacs-devel@gnu.org; Mon, 21 Oct 2019 08:42:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMX0p-0002lR-KH for emacs-devel@gnu.org; Mon, 21 Oct 2019 08:42:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59751) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMX0n-0002j4-Vl; Mon, 21 Oct 2019 08:42:14 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2334344920D; Mon, 21 Oct 2019 08:42:13 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EBF2F44920B; Mon, 21 Oct 2019 08:42:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1571661732; bh=/Si0eVDpMNVeodpPH5TMltTZXQHZdYXSb/ZpudvzJ0Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=kwtFE/PLOLJ/l7Tn82sLsSktveJ3SH0zE91aMWi4sdqxyK8h9tI1DJY/ab+oStp+x wOpxRKyug/00hduyKkTcyOEivKXPcuOJBoRK+U4vLR1M6Duyj85RKGA//Nn9xC45BE 29u/lnUIrkX4gIdFcPc/m1HNiVezUouhC/04wndDzDDE2gk4wCoPgiY5JNFqmwDLxk Errt496rBpyk+ew2mGa0IZKVHyANpDXyOahuRaFBSmloFHaaY/3tJcB9r7AZAjuLMf RrhT1r0/8H/sEYnKk1E7y2QRQKG09XZgKUCs2TbJjUBYIv0y39WqReCM0D1bL15LUc r1Vs382lIXOAg== Original-Received: from pastel (unknown [216.154.30.71]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3B071120AA6; Mon, 21 Oct 2019 08:42:11 -0400 (EDT) In-Reply-To: <20191021113055.AA1BF209DE@vcs0.savannah.gnu.org> (Eli Zaretskii's message of "Mon, 21 Oct 2019 07:30:53 -0400 (EDT)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 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:241297 Archived-At: > + ;; .dir-locals.el and lock files will cause the byte-compiler and > + ;; checkdoc emit spurious warnings, because they don't follow the > + ;; conventions of Emacs Lisp sources. Until we have a better fix, > + ;; like teaching elisp-mode about files that only hold data > + ;; structures, we disable the ELisp Flymake backend for these files. > + (unless > + (let* ((bfname (buffer-file-name)) > + (fname (and (stringp bfname) (file-name-nondirectory bfname)))) > + (or (not (stringp fname)) > + (string-match "\\`\\.#" fname) > + (string-equal dir-locals-file fname))) How/when can `fname` match "\\`\\.#" ? AFAICT lock "files" are symlinks that point nowhere so if the user tries to visit one of them he gets an empty buffer and a message "Symbolic link that points to non-existent file". So why do we care enough about this case to add this ad-hoc test there? More generally, if flymake has trouble with the .#foo.el locks, I think it will likely have the same kinds of trouble with .#foo.c locks etc... and I expect similar problems will affect other features of the major modes, because those "files" simply don't hold the contents expected from their extensions. IOW maybe we should have a general ("/\\.#[^/]*\\'" . fundamental-mode) entry in auto-mode-alist? Stefan