From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Default emacs init file location confusion Date: Mon, 13 Jan 2020 08:53:47 +0100 Message-ID: References: <837e23chdm.fsf@gnu.org> <834kx7cgmh.fsf@gnu.org> <87tv56bjop.fsf@gmail.com> <539DBEA2-E758-4CB0-B886-F908CF0525B6@gnu.org> <83pnfuaqj3.fsf@gnu.org> <83imllc3iq.fsf@gnu.org> <87eew9q4rt.fsf@windriver.com> <83tv538d0q.fsf@gnu.org> <7f532a3b-a812-3088-936c-e15a35b58654@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="240090"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 13 08:55:26 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iquYZ-000nKs-1x for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jan 2020 08:54:39 +0100 Original-Received: from localhost ([::1]:46832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iquYX-0000ug-GS for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jan 2020 02:54:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56382) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iquXo-0000LB-Lt for emacs-devel@gnu.org; Mon, 13 Jan 2020 02:53:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iquXn-0005SR-Jy for emacs-devel@gnu.org; Mon, 13 Jan 2020 02:53:52 -0500 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:35500) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iquXn-0005Pc-E7; Mon, 13 Jan 2020 02:53:51 -0500 Original-Received: by mail-wr1-x42f.google.com with SMTP id g17so7460011wro.2; Sun, 12 Jan 2020 23:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=6VG6QjYXyTl0FO44dFrToBTtkhO2doz/WmKXWpzg4LI=; b=gw4mKiScj/XeFZeLneoZYK9pKweEWgqjrk5WfU1wGKaesDimrwl4vP2up+60tLnL1Y XdIhsyXXkd4p/f6sCLqN9uaRlZ7Eee5RE/aFjlj4Qy/jLRzZHM48G9YRKECDjyUXh+Gi KELHgq1UDZ16Fh/2XuQ6G0hNZyN1hLl3dZ1k5cXDW8TtanWSLsUYM0lFa6yAipIJCHCF 8DXzBQyHhMkTzhU7xYQe7PCxIAmGSVoM580vMFqT2+eH8RTeRodQYoSV6bCL1jXLmHQP ZBS5fthVSeRWZrkR5/uIJfSWiKv18TDVG24myTdyKGwkHMEFhVCgmBMrQEuLIxRjkVxH X2Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=6VG6QjYXyTl0FO44dFrToBTtkhO2doz/WmKXWpzg4LI=; b=LcitL81ajBSBpEZ9XJfxFoJf08qPcgcDUtIOg1c3TpV6l1ZIvdB3O9RMr10gyPZKtt FjKv9/NRya2FChclbdbZGQ5v/6IUJYwLpecEzik48HkKmDBgFeE1mHy3A+LQSMfMaqk0 FBkbkFzSfMYiMploTGkZt711529hjoU3AZcBtMLkYH9dIiTMlLV/L6sBO6OdP//zrKll seIXrhzpla7yGRs8e4UKEh9/Jo2EYsEEXrclCTDe4fG1TIuK2raJ72gOGPvJhyCZ3gmr GUNoFhxF4BmxXKewB6qsZ/Y6SpxcYOyUDpHXte40rjya2i5M3mgd1m/Q2fANbJassqNV bwCQ== X-Gm-Message-State: APjAAAUtylvI1bJDn+boZ9x0MWA9JxMYehsAgcYZoP2KE4IjylGsLXbH pcmSPckFXZrsI5HSRV9eUZG8T49v X-Google-Smtp-Source: APXvYqxxK163dRoCkgYO4U1ICGzX46Iyy3nlG0dy6sYP1ycH/M7/tyo0+H6Mzk3Mtte8Dl3oDEI9vg== X-Received: by 2002:a5d:558d:: with SMTP id i13mr17087859wrv.364.1578902029448; Sun, 12 Jan 2020 23:53:49 -0800 (PST) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id h66sm14022267wme.41.2020.01.12.23.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 23:53:48 -0800 (PST) In-Reply-To: <7f532a3b-a812-3088-936c-e15a35b58654@cs.ucla.edu> (Paul Eggert's message of "Fri, 10 Jan 2020 17:46:34 -0800") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:244218 Archived-At: >>>>> On Fri, 10 Jan 2020 17:46:34 -0800, Paul Eggert = said: Paul> On 1/10/20 8:57 AM, Eli Zaretskii wrote: >>> I=CA=BCll see if I can test it soon, unless someone beats me to it. >> Any news with this? I'd like to have this in the repository ASAP, so >> that the pretest (which is expected soonish) will have it. Paul> Which version is "this"? It's kind of a long thread.... I think "this" is something like the following. ;; Return the name of the init file directory for Emacs, assuming ;; XDG-DIR is the XDG location and USER-NAME is the user name. If ;; USER-NAME is nil or "", use the current user. Prefer the XDG ;; location only if the .emacs.d location does not exist. (defun startup--xdg-or-homedot (xdg-dir user-name) (let ((emacs-d-dir (concat "~" user-name (if (eq system-type 'ms-dos) "/_emacs.d/" "/.emacs.d/")))) (cond ((or (file-exists-p emacs-d-dir) (if (eq system-type 'windows-nt) (if (file-directory-p (concat "~" user-name)) (directory-files (concat "~" user-name) nil "\\`[._]emacs\\(\\.elc?\\)?\\'")) (file-exists-p (concat "~" init-file-user (if (eq system-type 'ms-dos) "/_emacs" "/.emacs"))))) emacs-d-dir) ((file-exists-p xdg-dir) xdg-dir) (t emacs-d-dir)))) This requires an etc/NEWS update as well. Paul> If the idea is to go back to defaulting to .emacs.d, that's a ste= p in Paul> the wrong direction. Instead, I suggest that when Emacs starts up= in a=20 Paul> fresh home directory that lacks both .config/emacs and .emacs.d, = Emacs Paul> creates .config/emacs and sets up a symlink .emacs.d -> Paul> .config/emacs. This would avoid the specific problem that Elias r= an Paul> into, and is less likely to cause problems in environments where = user Paul> configurations live in '.config'. Paul> Partly I suggest this because it's what I've already been doing by Paul> hand: the symlink makes things more convenient for users who run a Paul> mixture of Emacs versions, as I do. I have no objection to symlinking, but Eli really wants to only use XDG if .emacs.d is non-existent. Robert