From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: A couple of locate-user-emacs-file questions Date: Thu, 20 Jun 2013 16:14:36 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371759283 32110 80.91.229.3 (20 Jun 2013 20:14:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Jun 2013 20:14:43 +0000 (UTC) Cc: Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 20 22:14:43 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 1UplFj-00061s-9U for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 22:14:43 +0200 Original-Received: from localhost ([::1]:44561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UplFi-0001Vy-Kd for ged-emacs-devel@m.gmane.org; Thu, 20 Jun 2013 16:14:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UplFe-0001QW-Tf for emacs-devel@gnu.org; Thu, 20 Jun 2013 16:14:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UplFe-0006CM-1V for emacs-devel@gnu.org; Thu, 20 Jun 2013 16:14:38 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:5597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UplFd-0006CI-Tk for emacs-devel@gnu.org; Thu, 20 Jun 2013 16:14:37 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="16825948" Original-Received: from 69-165-149-114.dsl.teksavvy.com (HELO pastel.home) ([69.165.149.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 20 Jun 2013 16:14:32 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id DE9C0630ED; Thu, 20 Jun 2013 16:14:36 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Thu, 20 Jun 2013 04:09:37 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:160776 Archived-At: > is mildly incompatible, in the sense that some external tool *could* > potentially depend on the session file being in $HOME; but that seems > unlikely. Does anyone see a problem with it? I don't. > And speaking of `locate-user-emacs-file', there are a couple of cases > (in cmuscheme.el and shell.el, both related to passing a filename to > comint only if the file does really exist) that could benefit from it, > if there was a way to tell it to check for OLDNAME and NEWNAME, but > return nil (and not create `user-emacs-directory') if neither file > exists. Something like this (diff -b to ignore irrelevant indentation > changes): I think it should still not return nil but the "preferred name". > On one hand, seems like a bit overengineered; on the other hand, a > function called *locate*-user-emacs-file should be able to tell > whether it did, in fact, locate it without causing side effects... 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. Stefan