emacs-devel
[Top][All Lists]
Advanced

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

Re: A couple of locate-user-emacs-file questions


From: Juanma Barranquero
Subject: Re: A couple of locate-user-emacs-file questions
Date: Fri, 21 Jun 2013 00:35:46 +0200

On Thu, Jun 20, 2013 at 10:14 PM, Stefan Monnier
<address@hidden> wrote:

> I don't.

Good. Committed as revno:113103.

> I think it should still not return nil but the "preferred name".

Then, it isn't really worth changing the interface. My "existing file
vs. nil" proposal is for cases like cmuscheme and shell, where the
resulting file is going to be passed to make-comint

      (apply 'make-comint-in-buffer "shell" buffer prog
             (if (file-exists-p startfile) startfile)

where the check for existence is repeated (because
locate-user-emacs-file already does it, but "discards" that info when
it returns ~/.emacs.d/newname unconditionally).

> I think the problem is that the function should have come with
> a `and-create-directory' argument instead, so the directory is only
> created when explicitly requested.

It's funny, because back when we were designing l-u-e-f, my original
proposal didn't create the dir. Tom Tromey said:

  IMO, if ~/.emacs.d does not exist, and it is what we prefer for the
  future, we should create it here.

I argued timidly against:

  I'm not sure. I think the user should be responsible of creating
  ~/.emacs.d/ if he wants it. Otherwise, if he doesn't want it, the only
  way to have the config files in ~/ would be to customize every *-file
  or *-directory option...

and you kind of agreed with Tom:

  I'm pretty sure I didn't create my ~/.emacs.d.  So the above doesn't seem to
  be what Emacs currently aims for.  It looks like this directory is created
  usually by the code which creates the ~/.emacs.d/auto-save-list directory.

and so did Eli:

  We already create that directory in recover-session, so Tom's
  suggestion makes a lot of sense to me.

Which I'm not bringing up to say "I told you so" (I really didn't ;-)
just to remember that we had some sort of consensus that automatic
creation was the better idea.

All in all, I think the and-create-directory arg idea wouldn't have
worked anyway, because most current packages that use l-u-e-f  assume
that the data file exists or can be created without error. So, to
avoid trouble, it would've been either to pass and-create-directory=t
to all such calls (defeating its very purpose) or change all these
packages to check for the directory's existence and/or create it. Not
a worth gain IMO.

   J



reply via email to

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