emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 61fb521: Avoid false indications from Flymake i


From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> +  ;; .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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]