unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master 61fb521: Avoid false indications from Flymake in .dir-locals.el files
       [not found] ` <20191021113055.AA1BF209DE@vcs0.savannah.gnu.org>
@ 2019-10-21 12:42   ` Stefan Monnier
  2019-10-21 13:11     ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2019-10-21 12:42 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] master 61fb521: Avoid false indications from Flymake in .dir-locals.el files
  2019-10-21 12:42   ` [Emacs-diffs] master 61fb521: Avoid false indications from Flymake in .dir-locals.el files Stefan Monnier
@ 2019-10-21 13:11     ` Eli Zaretskii
  2019-10-21 14:24       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2019-10-21 13:11 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Mon, 21 Oct 2019 08:42:09 -0400
> 
> 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".

Not on MS-Windows, AFAICT.

I got the idea from bytecomp.el, btw.  I just checked it and saw that
lock files are indeed visited in elisp-mode.

> IOW maybe we should have a general
> 
>     ("/\\.#[^/]*\\'" . fundamental-mode)
> 
> entry in auto-mode-alist?

Maybe.  But then why does bytecomp.el does this by file name?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] master 61fb521: Avoid false indications from Flymake in .dir-locals.el files
  2019-10-21 13:11     ` Eli Zaretskii
@ 2019-10-21 14:24       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2019-10-21 14:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>> 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".
> Not on MS-Windows, AFAICT.

Ah, right.

>> IOW maybe we should have a general
>>
>>     ("/\\.#[^/]*\\'" . fundamental-mode)
>>
>> entry in auto-mode-alist?
>
> Maybe.  But then why does bytecomp.el does this by file name?

Bytecomp can be called by byte-recompile-directory or something
like that which just looks at file names without paying attention to
their major mode, so the above suggestion wouldn't render the
bytecomp.el exception redundant.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-21 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191021113052.21934.64094@vcs0.savannah.gnu.org>
     [not found] ` <20191021113055.AA1BF209DE@vcs0.savannah.gnu.org>
2019-10-21 12:42   ` [Emacs-diffs] master 61fb521: Avoid false indications from Flymake in .dir-locals.el files Stefan Monnier
2019-10-21 13:11     ` Eli Zaretskii
2019-10-21 14:24       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).