unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: Tom Tromey <tromey@redhat.com>,
	"T.V. Raman" <tv.raman.tv@gmail.com>,
	emacs-devel@gnu.org
Subject: Re: files.el: Patch to make project-settings optional/customizable
Date: Sun, 23 Nov 2008 12:45:59 +0200	[thread overview]
Message-ID: <87ljvayb18.fsf@jurta.org> (raw)
In-Reply-To: <200811230810.mAN8A6fp022636@mothra.ics.uci.edu> (Dan Nicolaescu's message of "Sun, 23 Nov 2008 00:10:06 -0800 (PST)")

> So there are 2 uses .dir-locals.el 3 lines apart in the same 24 lines function.
> The defconst adds 4 lines.  It's hard to keep a straight face and claim
> that the defconst is a good idea.
> (and the 2 uses could be reduced to a single one if we make
> locate-dominating-file return an expanded file name -- which seems to be
> a good idea anyway).
>
> It's kind of painful that this discussion is still going on, it should
> have never occurred in the first place...

I can't believe we have this kind of discussion :(

All packages with similar functionality have defcustom for the file name.

dir-locals.el:

(defcustom dir-locals-file-name ".emacs-locals"
  "File name used by Dir-Locals mode to specify local variables.
This should specify local variables in the normal way.  When Dir-Locals
minor mode is active, these will be inherited by files found in a
directory tree containing such a file at its root.
This may also be a function of no arguments which returns the name to
use, allowing arbitrary per-directory customization of the
per-directory customization file on the basis of `default-directory'."
  :group 'dir-locals
  :type '(choice file function))

dirvars.el:

(defcustom dirvars-file-name ".emacs-dirvars"
  "File base name that is loaded by dirvars."
  :type 'string)

dir-locals.el was created in 2005 and dirvars.el in 2002.
For several years they provided customization without problems.

Our discussion reached the need to make this file name constant.
I'm ok with this conclusion.  So I created defconst because it
explicitly says that the file name should not be modified by the user,
unlike if it was hidden in the function dir-locals-find-file where users
will be the temptation to redefine the whole function without understanding
that the file name have to be constant.

PS: Reading the docstring of dir-locals-file-name in dir-locals.el
seems to indicate that users trying to switch from dir-locals.el
to similar functionality implemented now in files.el will be annoyed
by its limitations but I'll leave this for another discussion where
we will argue with the users of these packages.

-- 
Juri Linkov
http://www.jurta.org/emacs/




  reply	other threads:[~2008-11-23 10:45 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 14:29 files.el: Patch to make project-settings optional/customizable T.V. Raman
2008-11-13 15:20 ` Chong Yidong
2008-11-13 16:07   ` Dan Nicolaescu
2008-11-13 16:19     ` Dan Nicolaescu
2008-11-13 16:45       ` Tom Tromey
2008-11-13 17:14         ` Chong Yidong
2008-11-13 17:28           ` Dan Nicolaescu
2008-11-13 17:55             ` Juanma Barranquero
2008-11-13 17:59               ` Dan Nicolaescu
2008-11-13 19:13                 ` Juanma Barranquero
2008-11-13 19:00               ` Tom Tromey
2008-11-13 19:15                 ` Juanma Barranquero
2008-11-13 18:26             ` Chong Yidong
2008-11-13 18:48               ` Dan Nicolaescu
2008-11-18 16:36                 ` Dan Nicolaescu
2008-11-18 22:04                   ` Juri Linkov
2008-11-18 22:15                     ` Dan Nicolaescu
2008-11-18 22:42                       ` Juanma Barranquero
2008-11-18 23:18                         ` Dan Nicolaescu
2008-11-18 23:41                           ` Juanma Barranquero
2008-11-18 22:59                     ` Stefan Monnier
2008-11-18 23:31                       ` Juri Linkov
2008-11-18 23:33                       ` Chong Yidong
2008-11-18 23:41                         ` Dan Nicolaescu
2008-11-18 23:50                           ` Juanma Barranquero
2008-11-19  0:14                             ` Dan Nicolaescu
2008-11-19  1:48                               ` Chong Yidong
2008-11-19  8:26                                 ` Juanma Barranquero
2008-11-19 12:52                               ` Richard M. Stallman
2008-11-18 23:37                       ` Juanma Barranquero
2008-11-19  2:01                         ` Stefan Monnier
2008-11-19  8:39                           ` Juanma Barranquero
2008-11-19 13:27                           ` Dan Nicolaescu
2008-11-19 22:45                           ` Juri Linkov
2008-11-19 22:58                             ` Tom Tromey
2008-11-20  2:18                             ` Stefan Monnier
2008-11-22 19:08                               ` Juri Linkov
2008-11-22 19:40                                 ` Dan Nicolaescu
2008-11-22 19:51                                   ` Juri Linkov
2008-11-22 20:20                                     ` Dan Nicolaescu
2008-11-22 22:03                                       ` Juanma Barranquero
2008-11-23  3:34                                       ` Miles Bader
2008-11-23  5:27                                         ` Stefan Monnier
2008-11-23  5:36                                           ` Juanma Barranquero
2008-11-23  5:58                                             ` Stefan Monnier
2008-11-23  8:10                                           ` Dan Nicolaescu
2008-11-23 10:45                                             ` Juri Linkov [this message]
2008-11-23 12:10                                               ` Dan Nicolaescu
2008-11-23 12:41                                                 ` Juanma Barranquero
2008-11-23 17:16                                                   ` Dan Nicolaescu
2008-11-23 17:45                                                     ` Juanma Barranquero
2008-11-23 21:21                                                       ` Dan Nicolaescu
2008-11-24  2:14                                                         ` Stephen J. Turnbull
2008-11-24  3:06                                               ` Dan Nicolaescu
2008-11-24  5:35                                                 ` Chong Yidong
2008-11-22  4:03                             ` Kevin Rodgers
2008-11-19  4:07                         ` Stephen J. Turnbull
2008-11-13 19:04               ` Tom Tromey
2008-11-13 19:23           ` Tom Tromey
2008-11-13 19:55             ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ljvayb18.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=tromey@redhat.com \
    --cc=tv.raman.tv@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).