unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: A couple of locate-user-emacs-file questions
Date: Fri, 21 Jun 2013 00:35:46 +0200	[thread overview]
Message-ID: <CAAeL0ST6dpw4zhVnKCKWD35_OPYhPAnmBEiw09yZDoTKhW_X7w@mail.gmail.com> (raw)
In-Reply-To: <jwvvc58h7a8.fsf-monnier+emacs@gnu.org>

On Thu, Jun 20, 2013 at 10:14 PM, Stefan Monnier
<monnier@iro.umontreal.ca> 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	other threads:[~2013-06-20 22:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  2:09 A couple of locate-user-emacs-file questions Juanma Barranquero
2013-06-20 20:14 ` Stefan Monnier
2013-06-20 22:35   ` Juanma Barranquero [this message]
2013-06-21  1:46     ` Stefan Monnier

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=CAAeL0ST6dpw4zhVnKCKWD35_OPYhPAnmBEiw09yZDoTKhW_X7w@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).