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: Don't concat directories to file names Date: Fri, 15 Jun 2007 10:33:47 -0400 Message-ID: References: <87wsy6cvip.fsf@uwakimon.sk.tsukuba.ac.jp> <87k5u5cydi.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181918056 26836 80.91.229.12 (15 Jun 2007 14:34:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jun 2007 14:34:16 +0000 (UTC) Cc: "Stephen J. Turnbull" , rms@gnu.org, emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 15 16:34:11 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HzCsJ-0003Zq-PQ for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 16:34:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzCsJ-00044L-3L for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 10:34:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HzCsG-00044G-Cd for emacs-devel@gnu.org; Fri, 15 Jun 2007 10:34:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HzCsE-00043J-0E for emacs-devel@gnu.org; Fri, 15 Jun 2007 10:34:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzCsD-00042t-OV for emacs-devel@gnu.org; Fri, 15 Jun 2007 10:34:01 -0400 Original-Received: from tomts48.bellnexxia.net ([209.226.175.192] helo=tomts48-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HzCsC-0006b5-Fp; Fri, 15 Jun 2007 10:34:00 -0400 Original-Received: from pastel.home ([70.55.143.156]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070615143348.TLBB1673.tomts16-srv.bellnexxia.net@pastel.home>; Fri, 15 Jun 2007 10:33:48 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id EC4737F83; Fri, 15 Jun 2007 10:33:47 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Fri\, 15 Jun 2007 13\:21\:37 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:72957 Archived-At: > Then the recently introduced `user-emacs-directory' should be renamed > to `user-init-directory', Indeed. Please: could someone do that? > The variable currently must end with a directory separator, but that could > be fixed. It should be fixed. We should be careful to make it work with or without a terminating / since it can be set by the user. If we systematically use it with expand-file-name, this will work automatically. > (defun user-emacs-file (name &optional new-name) If we rename the variable to user-init-directory, then the function should probably be called user-init-file. > "Convert NAME to an absolute per-user Emacs-specific path. > If \"~/NAME\" exists, or `user-emacs-directory' is nil, return \"~/NAME\". > Else, return \"`user-emacs-directory'/NEW-NAME\", or /NAME if NEW-NAME is nil." > (convert-standard-filename > (let ((at-home (expand-file-name name (concat "~" init-file-user)))) > (if (or (file-readable-p at-home) > (null user-emacs-directory)) > at-home > (or (file-accessible-directory-p (directory-file-name > user-emacs-directory)) > (progn (make-directory user-emacs-directory) t) ;; don't > catch errors > (expand-file-name (or new-name name) user-emacs-directory)))))) In most places that introduced the ~/.emacs.d thingy, they typically first check ~/.emacs.d/TOTO then ~/.TOTO and if neither is present return ~/.emacs.d/TOTO. Stefan