emacs-devel
[Top][All Lists]
Advanced

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

Re: Add a separate mode for .dir-locals.el


From: Yuri Khan
Subject: Re: Add a separate mode for .dir-locals.el
Date: Thu, 17 Oct 2019 22:45:20 +0700

On Thu, 17 Oct 2019 at 21:57, Clément Pit-Claudel <address@hidden> wrote:

> Flymake in ELisp mode is configured from emacs-lisp-mode, by adding two 
> checkers to flymake-diagnostic-functions.  We could change that code to only 
> add the hooks if the file name is not .dir-locals.el, but that seems less 
> clean than creating a separate mode for .dir-locals.el files, since they 
> aren't proper Emacs Lisp files.

.dir-locals.el is not the only kind of an .el file that is not proper
Emacs Lisp code. Many modes store persistent data in the user’s
.emacs.d, in files ending in .el. Only some of those (e.g. recentf)
take extra steps to make that data valid code. Most just dump a data
structure and call it a day.

Maybe there should be a base major mode for S-expression files, and
emacs-lisp-mode, along with every other lisp-like mode, deriving from
that?

(There is a similar issue with Javascript vs JSON files, where the
former are code and the latter are data. Out-of-the-box, Emacs treats
them the same, with js-mode, though only some Javascript-related
things make sense in a JSON file, and certainly checks for data files
would be different.)



reply via email to

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