From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Use .emacs.d in savehist.el Date: Sun, 30 Oct 2005 09:03:30 +0900 Message-ID: References: <87u0f69ae6.fsf-monnier+emacs@gnu.org> Reply-To: snogglethorpe@gmail.com, miles@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1130630683 26045 80.91.229.2 (30 Oct 2005 00:04:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2005 00:04:43 +0000 (UTC) Cc: ihs_4664@yahoo.com, emacs-devel@gnu.org, rms@gnu.org, miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 30 02:04:32 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EW0gU-0003MY-4W for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2005 02:04:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EW0gS-0002Vv-45 for ged-emacs-devel@m.gmane.org; Sat, 29 Oct 2005 20:04:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EW0fm-0002VR-9R for emacs-devel@gnu.org; Sat, 29 Oct 2005 20:03:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EW0fk-0002Ui-12 for emacs-devel@gnu.org; Sat, 29 Oct 2005 20:03:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EW0fi-0002UP-Vl for emacs-devel@gnu.org; Sat, 29 Oct 2005 20:03:39 -0400 Original-Received: from [64.233.184.198] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EW0fi-0004MJ-9f for emacs-devel@gnu.org; Sat, 29 Oct 2005 20:03:38 -0400 Original-Received: by wproxy.gmail.com with SMTP id 36so342220wra for ; Sat, 29 Oct 2005 17:03:30 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mfm6PDXoapIyyUPeXBCJ9CCGBqGd4dGlXpZXDNz7pE7Hj2gUpF8XTwd3S64i1OyysZwyFP1v22Lubik0lz6nSYpo57h4TEUrmJygIuf7jCh76Oq6yNcDY3zspaOR7smCw3LPAv4NVDItOUQlpnYbMGkoyLgCxpYheJvYEGM1/+g= Original-Received: by 10.54.148.2 with SMTP id v2mr452957wrd; Sat, 29 Oct 2005 17:03:30 -0700 (PDT) Original-Received: by 10.54.157.10 with HTTP; Sat, 29 Oct 2005 17:03:30 -0700 (PDT) Original-To: "Kim F. Storm" In-Reply-To: Content-Disposition: inline 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:45116 Archived-At: 2005/10/30, Kim F. Storm : > I like this too, but functionality should be: > If DOTFILE non-nil and ~/DOTFILE exists, use ~/DOTFILE, else [as above]. > Otherwise, some old DOTFILE will suddenly "disappear" if the user later c= reates .emacs.d Good point; this rule should apply to implicitly specified dotfile name too of course. Here's an implementation that seems to get the details right (it probably ought to check that "~/.emacs.d" is actually a directory, rather than seeing if merely exists or not): (defvar user-customization-file-dir "~/.emacs.d") (defun user-customization-file-name (base &optional dotfile) (unless dotfile (setq dotfile (concat "." base))) (setq dotfile (expand-file-name dotfile "~")) (if (or (file-exists-p dotfile) =09 (not (file-exists-p user-customization-file-dir))) dotfile (expand-file-name base user-customization-file-dir))) -miles -- Do not taunt Happy Fun Ball.