From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: A couple of locate-user-emacs-file questions Date: Fri, 21 Jun 2013 00:35:46 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1371767832 20733 80.91.229.3 (20 Jun 2013 22:37:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Jun 2013 22:37:12 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 21 00:37:13 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UpnTc-0007T3-Nw for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 00:37:12 +0200 Original-Received: from localhost ([::1]:58418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpnTc-0003XD-AT for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 18:37:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpnSu-0002Hp-ND for emacs-devel@gnu.org; Thu, 20 Jun 2013 18:36:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpnSt-0000r3-NP for emacs-devel@gnu.org; Thu, 20 Jun 2013 18:36:28 -0400 Original-Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:46302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpnSt-0000qx-GD for emacs-devel@gnu.org; Thu, 20 Jun 2013 18:36:27 -0400 Original-Received: by mail-ea0-f174.google.com with SMTP id o10so4206480eaj.5 for ; Thu, 20 Jun 2013 15:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=IO+0PtYHGkFm7SinpcKePYCxXmG8f2EFutGkX7mN4NY=; b=drVDBZ0+nUg4MjQtMxWFgHyiqInqG4n5mtSWL4o/4qhPGJJlxNe0ljY5lmBMdqO1xh 4FAQ6BhVZT2CCw9LxvlRMY9biU9nc9QStYl3+Is+fh9IaOamF1LQMIAWmT5qd9wMbmKG +oqqDE0HkSQz+365jfc7PvbaURJEPlIedhmaGitocVVant451qdqAEhMxnD7lxXB8QXo CjFeUYgppGT89FCriQVJY+YMRlepqxuc6Wir/RG0KSgoNhPsTjyT9G+cel2SnxoPqzHE 9i4xj/AzXF+6sDCrbayBpjfC3lAUEkKd7PqAYNFNBPxDuP+f2upe/ImbGsSvVv+Txlq+ Oi0Q== X-Received: by 10.15.102.68 with SMTP id bq44mr9699776eeb.89.1371767786646; Thu, 20 Jun 2013 15:36:26 -0700 (PDT) Original-Received: by 10.14.142.4 with HTTP; Thu, 20 Jun 2013 15:35:46 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160791 Archived-At: On Thu, Jun 20, 2013 at 10:14 PM, Stefan Monnier 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