all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Default emacs init file location confusion
Date: Mon, 13 Jan 2020 08:53:47 +0100	[thread overview]
Message-ID: <m2pnfnvlkk.fsf@gmail.com> (raw)
In-Reply-To: <7f532a3b-a812-3088-936c-e15a35b58654@cs.ucla.edu> (Paul Eggert's message of "Fri, 10 Jan 2020 17:46:34 -0800")

>>>>> On Fri, 10 Jan 2020 17:46:34 -0800, Paul Eggert <eggert@cs.ucla.edu> said:

    Paul> On 1/10/20 8:57 AM, Eli Zaretskii wrote:
    >>> Iʼll 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 step in
    Paul> the wrong direction. Instead, I suggest that when Emacs starts up in a 
    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 ran
    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



  parent reply	other threads:[~2020-01-13  7:53 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  2:51 Default emacs init file location confusion Elias Mårtenson
2020-01-07  3:32 ` Eli Zaretskii
2020-01-07  3:40   ` Elias Mårtenson
2020-01-07  4:40     ` Eli Zaretskii
2020-01-07 14:43       ` Lawrence Liu
2020-01-07 15:26         ` Robert Pluim
2020-01-07 16:12           ` Eli Zaretskii
2020-01-07 16:25             ` Robert Pluim
2020-01-07 17:04               ` Eli Zaretskii
2020-01-07 17:11                 ` Elias Mårtenson
2020-01-07 17:21                   ` Eli Zaretskii
2020-01-07 17:33                     ` Elias Mårtenson
2020-01-07 17:37                       ` Eli Zaretskii
2020-01-08  5:28                         ` Mingde (Matthew) Zeng
2020-01-08  5:33                           ` Elias Mårtenson
2020-01-08  7:22                             ` Eli Zaretskii
2020-01-08 10:05                               ` Elias Mårtenson
     [not found]                               ` <m2eewajram.fsf@gmail.com>
2020-01-08 10:05                                 ` Eli Zaretskii
2020-01-08 10:13                                   ` Elias Mårtenson
2020-01-08 10:22                                   ` Robert Pluim
2020-01-08 10:49                                     ` Eli Zaretskii
2020-01-08 12:37                                       ` Robert Pluim
2020-01-08 13:51                                         ` Stefan Monnier
2020-01-08 15:58                                           ` Eli Zaretskii
2020-01-08 16:28                                             ` Stefan Monnier
2020-01-08 16:32                                               ` Eli Zaretskii
2020-01-08 16:41                                                 ` Mingde (Matthew) Zeng
2020-01-08 16:49                                                   ` Robert Pluim
2020-01-08 17:01                                                     ` Eli Zaretskii
2020-01-08 17:25                                                       ` Robert Pluim
2020-01-08 17:35                                                         ` Eli Zaretskii
2020-01-08 17:44                                                           ` Robert Pluim
2020-01-08 17:56                                                             ` Yuan Fu
2020-01-08 18:03                                                               ` Robert Pluim
2020-01-09  2:27                                                                 ` Yuan Fu
2020-01-08 18:07                                                             ` Eli Zaretskii
2020-01-08 18:12                                                               ` Robert Pluim
2020-01-08 18:19                                                                 ` Eli Zaretskii
2020-01-08 19:45                                                                   ` Stefan Monnier
2020-01-08 20:03                                                                     ` Eli Zaretskii
2020-01-10 16:57                                                     ` Eli Zaretskii
2020-01-11  1:46                                                       ` Paul Eggert
2020-01-11  7:58                                                         ` Eli Zaretskii
2020-01-11 15:43                                                         ` Drew Adams
2020-01-11 16:16                                                         ` Stefan Monnier
2020-01-11 18:08                                                           ` Eli Zaretskii
2020-01-13  7:53                                                         ` Robert Pluim [this message]
2020-01-13 14:36                                                           ` Robert Pluim
2020-01-13 15:27                                                             ` Colin Baxter
2020-01-13 15:37                                                               ` Robert Pluim
2020-01-13 15:58                                                                 ` Colin Baxter
2020-01-13 16:05                                                                   ` Robert Pluim
2020-01-13 16:42                                                                   ` Eli Zaretskii
2020-01-13 16:59                                                                     ` Colin Baxter
2020-01-13 17:06                                                                       ` Robert Pluim
2020-01-13 17:21                                                                         ` Colin Baxter
2020-01-13 16:15                                                             ` Eli Zaretskii
2020-01-13 16:39                                                               ` Robert Pluim
2020-01-14 14:00                                                                 ` Robert Pluim
2020-01-14 16:05                                                                   ` Eli Zaretskii
2020-01-15 13:03                                                                     ` Robert Pluim
2020-01-15 17:32                                                                       ` Eli Zaretskii
2020-01-16  7:35                                                                         ` Robert Pluim
2020-01-16 15:02                                                                           ` Eli Zaretskii
2020-01-16 15:08                                                                             ` Robert Pluim
2020-01-13 16:52                                                             ` Stefan Kangas
2020-01-13 16:17                                                           ` Eli Zaretskii
2020-01-13 16:29                                                             ` Robert Pluim
2020-01-08 23:26                                           ` chad
2020-01-08 23:32                                             ` Stefan Monnier
2020-01-09  3:34                                               ` Eli Zaretskii
2020-01-09  1:26                                             ` HaiJun Zhang
2020-01-09  5:07                                               ` 황병희
2020-01-08 11:03                                   ` Mario Lang
2020-01-08 15:56                                     ` Eli Zaretskii
2020-01-08  8:04                             ` Robert Pluim
2020-01-07 17:57                     ` Stefan Monnier
2020-01-07 18:08                       ` Stefan Monnier
2020-01-07 18:09                       ` Eli Zaretskii
2020-01-07 18:41                         ` Stefan Monnier
2020-01-07 18:57                           ` Yuan Fu
2020-01-07 19:15                             ` Greg Farough
2020-01-07 20:11                               ` Andrea Corallo
2020-01-07 18:53                         ` Yuan Fu
2020-01-07 17:12                 ` Yuan Fu
2020-01-07 17:26                   ` Elias Mårtenson
2020-01-07  3:46   ` Mingde (Matthew) Zeng
2020-01-07  3:50     ` Elias Mårtenson
2020-01-07  3:43 ` VanL
2020-01-07  3:51   ` Elias Mårtenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2pnfnvlkk.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.