* Directory-local variables?
@ 2008-12-28 17:29 Richard M Stallman
2008-12-28 19:35 ` Eli Zaretskii
2008-12-30 20:19 ` Stefan Monnier
0 siblings, 2 replies; 13+ messages in thread
From: Richard M Stallman @ 2008-12-28 17:29 UTC (permalink / raw)
To: emacs-devel
+@node Directory Local Variables
+@section Directory Local Variables
+@cindex directory local variables
+
+ A directory can specify local variable values common to all files in
+that directory; Emacs uses these to create buffer-local bindings for
+those variables in buffers visiting any file in that directory. This
+is useful when the files in the directory belong to some @dfn{project}
+and therefore share the same local variables.
The term "directory-local variables" is potentially misleading; Emacs
does not implement directory-local bindings. What this feature really
does is systematically set up buffer-local bindings for all files in a
directory.
So I think this needs to be described as a variant on the file local
variable lists.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-28 17:29 Directory-local variables? Richard M Stallman
@ 2008-12-28 19:35 ` Eli Zaretskii
2008-12-29 0:30 ` Juri Linkov
2008-12-29 22:09 ` Richard M Stallman
2008-12-30 20:19 ` Stefan Monnier
1 sibling, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-12-28 19:35 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
> From: Richard M Stallman <rms@gnu.org>
> Date: Sun, 28 Dec 2008 12:29:14 -0500
>
> The term "directory-local variables" is potentially misleading; Emacs
> does not implement directory-local bindings. What this feature really
> does is systematically set up buffer-local bindings for all files in a
> directory.
>
> So I think this needs to be described as a variant on the file local
> variable lists.
We would still need a short and catchy term for this feature. Can you
(or someone else) suggest one that is different from "directory-local
variables"?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-28 19:35 ` Eli Zaretskii
@ 2008-12-29 0:30 ` Juri Linkov
2008-12-29 4:06 ` Eli Zaretskii
2008-12-29 22:09 ` Richard M Stallman
2008-12-29 22:09 ` Richard M Stallman
1 sibling, 2 replies; 13+ messages in thread
From: Juri Linkov @ 2008-12-29 0:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: rms, emacs-devel
>> The term "directory-local variables" is potentially misleading; Emacs
>> does not implement directory-local bindings. What this feature really
>> does is systematically set up buffer-local bindings for all files in a
>> directory.
>>
>> So I think this needs to be described as a variant on the file local
>> variable lists.
>
> We would still need a short and catchy term for this feature. Can you
> (or someone else) suggest one that is different from "directory-local
> variables"?
It seems to me that the most precise and unambiguous term is
"directory-local file variables". It is based on the standard term
"file variables" as defined in the node (info "(emacs) File Variables")
and "directory-local" says that their scope is limited to the specified
directory.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-29 0:30 ` Juri Linkov
@ 2008-12-29 4:06 ` Eli Zaretskii
2008-12-29 22:09 ` Richard M Stallman
1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-12-29 4:06 UTC (permalink / raw)
To: Juri Linkov; +Cc: rms, emacs-devel
> From: Juri Linkov <juri@jurta.org>
> Cc: rms@gnu.org, emacs-devel@gnu.org
> Date: Mon, 29 Dec 2008 02:30:29 +0200
>
> It seems to me that the most precise and unambiguous term is
> "directory-local file variables".
If you say "file variables", then "local" in "directory-local" loses
precision. It is actually "file local variables common to all files
in a directory", but that's too long and a mouthful.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-29 0:30 ` Juri Linkov
2008-12-29 4:06 ` Eli Zaretskii
@ 2008-12-29 22:09 ` Richard M Stallman
2008-12-29 22:19 ` Lennart Borgman
2008-12-30 0:05 ` Juri Linkov
1 sibling, 2 replies; 13+ messages in thread
From: Richard M Stallman @ 2008-12-29 22:09 UTC (permalink / raw)
To: Juri Linkov; +Cc: eliz, emacs-devel
It seems to me that the most precise and unambiguous term is
"directory-local file variables". It is based on the standard term
"file variables" as defined in the node (info "(emacs) File Variables")
and "directory-local" says that their scope is limited to the specified
directory.
Since a directory is _less_ "local" than a single file,
perhaps "directory-wide file variables" would be better.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-29 22:09 ` Richard M Stallman
@ 2008-12-29 22:19 ` Lennart Borgman
2008-12-30 0:05 ` Juri Linkov
1 sibling, 0 replies; 13+ messages in thread
From: Lennart Borgman @ 2008-12-29 22:19 UTC (permalink / raw)
To: rms; +Cc: Juri Linkov, eliz, emacs-devel
On Mon, Dec 29, 2008 at 11:09 PM, Richard M Stallman <rms@gnu.org> wrote:
> It seems to me that the most precise and unambiguous term is
> "directory-local file variables". It is based on the standard term
> "file variables" as defined in the node (info "(emacs) File Variables")
> and "directory-local" says that their scope is limited to the specified
> directory.
>
> Since a directory is _less_ "local" than a single file,
> perhaps "directory-wide file variables" would be better.
buffer local variables
file local variables
dir local variables
proj local variables
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-29 22:09 ` Richard M Stallman
2008-12-29 22:19 ` Lennart Borgman
@ 2008-12-30 0:05 ` Juri Linkov
1 sibling, 0 replies; 13+ messages in thread
From: Juri Linkov @ 2008-12-30 0:05 UTC (permalink / raw)
To: rms; +Cc: eliz, emacs-devel
> It seems to me that the most precise and unambiguous term is
> "directory-local file variables". It is based on the standard term
> "file variables" as defined in the node (info "(emacs) File Variables")
> and "directory-local" says that their scope is limited to the specified
> directory.
>
> Since a directory is _less_ "local" than a single file,
> perhaps "directory-wide file variables" would be better.
The package dir-locals from http://www.loveshack.ukfsn.org/emacs/dir-locals.el
(that we tried to follow and reimplement in Emacs) uses the following term in
its docstrings and comments: "Directory-wide file-local variables". We could
use the same in Emacs.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-28 19:35 ` Eli Zaretskii
2008-12-29 0:30 ` Juri Linkov
@ 2008-12-29 22:09 ` Richard M Stallman
1 sibling, 0 replies; 13+ messages in thread
From: Richard M Stallman @ 2008-12-29 22:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
I suggest "Directory local variables lists".
The _list_ certainly pertains to the directory.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-28 17:29 Directory-local variables? Richard M Stallman
2008-12-28 19:35 ` Eli Zaretskii
@ 2008-12-30 20:19 ` Stefan Monnier
2008-12-31 12:29 ` Juri Linkov
1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2008-12-30 20:19 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
> So I think this needs to be described as a variant on the file local
> variable lists.
Yes, clearly it should use similar terminology to the one used for
file variables. So if it's not "directory variables" then we'd need to
change the "file variables" as well.
Stefan
PS: it now occurs to me that the name ".dir-locals.el" is redundant.
It could just say ".locals.el" or ".local-variables.el" since it's
placed in a directory. Just like file variables are enclosed in
a "Local Variables" section rather than a "File Local
Variables" section.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-30 20:19 ` Stefan Monnier
@ 2008-12-31 12:29 ` Juri Linkov
2009-01-03 0:46 ` Juri Linkov
0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2008-12-31 12:29 UTC (permalink / raw)
To: Stefan Monnier; +Cc: rms, emacs-devel
> PS: it now occurs to me that the name ".dir-locals.el" is redundant.
> It could just say ".locals.el" or ".local-variables.el" since it's
> placed in a directory. Just like file variables are enclosed in
> a "Local Variables" section rather than a "File Local
> Variables" section.
".locals.el" is a reasonably short file name, and it looks nicer than
".dir-locals.el" without redundant "dir-" part. So perhaps we should
finally settle on this name.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2008-12-31 12:29 ` Juri Linkov
@ 2009-01-03 0:46 ` Juri Linkov
2009-01-07 0:45 ` Juri Linkov
0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2009-01-03 0:46 UTC (permalink / raw)
To: Stefan Monnier; +Cc: rms, emacs-devel
>> PS: it now occurs to me that the name ".dir-locals.el" is redundant.
>> It could just say ".locals.el" or ".local-variables.el" since it's
>> placed in a directory. Just like file variables are enclosed in
>> a "Local Variables" section rather than a "File Local
>> Variables" section.
>
> ".locals.el" is a reasonably short file name, and it looks nicer than
> ".dir-locals.el" without redundant "dir-" part. So perhaps we should
> finally settle on this name.
One thing that still disturbs me is that this file is not in the same
format as in a Local Variables: section.
1. File local variables
;; Local Variables:
;; mode: change-log
;; add-log-time-zone-rule: t
;; fill-column: 74
;; End:
2. Directory-wide file local variables
(change-log-mode .
((add-log-time-zone-rule . t)
(fill-column . 74)))
Two different formats for the same feature is a bad thing. It requires
complete rewriting of these settings when moving file local variables
to the directory-wide file and back. This is very inconvenient.
While it is not too late, I think we should use the same easy to write
format as in a Local Variables: section with keeping already implemented
features of directory-wide file variables (specifying multiply mode
settings in the same file).
Another thing that needs to be fixed is caching data from the
directory-wide file. Currently after changing the settings in this file
they don't become effective. We should check the file timestamp and
reread them.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2009-01-03 0:46 ` Juri Linkov
@ 2009-01-07 0:45 ` Juri Linkov
2009-01-12 18:21 ` Stefan Monnier
0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2009-01-07 0:45 UTC (permalink / raw)
To: Stefan Monnier; +Cc: rms, emacs-devel
> Two different formats for the same feature is a bad thing. It requires
> complete rewriting of these settings when moving file local variables
> to the directory-wide file and back. This is very inconvenient.
>
> While it is not too late, I think we should use the same easy to write
> format as in a Local Variables: section with keeping already implemented
> features of directory-wide file variables (specifying multiply mode
> settings in the same file).
How about the following format for the directory-wide local variables file?
It is based on the standard Emacs format for Local Variables. The first
section applies to any mode, and subsequent sections begin with the
`-*-...-*-' line and specify either a mode or a subdirectory:
Local variables:
indent-tabs-mode: maybe
tab-width: 8
fill-column: 70
End:
-*- mode: c -*-
Local variables:
c-file-style: "GNU"
End:
-*- mode: change-log -*-
Local variables:
add-log-time-zone-rule: t
fill-column: 74
End:
-*- default-directory: "src/imported" -*-
Local variables:
change-log-default-name: "ChangeLog.local"
End:
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Directory-local variables?
2009-01-07 0:45 ` Juri Linkov
@ 2009-01-12 18:21 ` Stefan Monnier
0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2009-01-12 18:21 UTC (permalink / raw)
To: Juri Linkov; +Cc: rms, emacs-devel
> How about the following format for the directory-wide local variables file?
> It is based on the standard Emacs format for Local Variables. The first
> section applies to any mode, and subsequent sections begin with the
> `-*-...-*-' line and specify either a mode or a subdirectory:
I'd rather change file variables to use a more Lispish syntax than the
other way around.
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2009-01-12 18:21 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-28 17:29 Directory-local variables? Richard M Stallman
2008-12-28 19:35 ` Eli Zaretskii
2008-12-29 0:30 ` Juri Linkov
2008-12-29 4:06 ` Eli Zaretskii
2008-12-29 22:09 ` Richard M Stallman
2008-12-29 22:19 ` Lennart Borgman
2008-12-30 0:05 ` Juri Linkov
2008-12-29 22:09 ` Richard M Stallman
2008-12-30 20:19 ` Stefan Monnier
2008-12-31 12:29 ` Juri Linkov
2009-01-03 0:46 ` Juri Linkov
2009-01-07 0:45 ` Juri Linkov
2009-01-12 18:21 ` 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).