From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#42388: 27.0.91; Manual is inconsistent about default init file location Date: Thu, 16 Jul 2020 19:00:04 +0200 Message-ID: References: <87sgdrrc5z.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30137"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42388@debbugs.gnu.org To: "Jorge P. de Morais Neto" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 16 19:01:24 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jw7G8-0007kc-I3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jul 2020 19:01:24 +0200 Original-Received: from localhost ([::1]:48680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jw7G7-0008LK-9c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jul 2020 13:01:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jw7Fn-0008L4-Co for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2020 13:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jw7Fm-0005Dp-Cg for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2020 13:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jw7Fm-0002Jz-AC for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2020 13:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jul 2020 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42388 X-GNU-PR-Package: emacs Original-Received: via spool by 42388-submit@debbugs.gnu.org id=B42388.15949188168860 (code B ref 42388); Thu, 16 Jul 2020 17:01:02 +0000 Original-Received: (at 42388) by debbugs.gnu.org; 16 Jul 2020 17:00:16 +0000 Original-Received: from localhost ([127.0.0.1]:55868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jw7F2-0002Ip-FO for submit@debbugs.gnu.org; Thu, 16 Jul 2020 13:00:16 -0400 Original-Received: from mail-wr1-f46.google.com ([209.85.221.46]:35107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jw7F0-0002Ia-Sc for 42388@debbugs.gnu.org; Thu, 16 Jul 2020 13:00:16 -0400 Original-Received: by mail-wr1-f46.google.com with SMTP id z2so7853380wrp.2 for <42388@debbugs.gnu.org>; Thu, 16 Jul 2020 10:00:14 -0700 (PDT) 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=FJx0bZDBu0GoYK4Inxqk3QEYdX8ioI0vl7TtFRslaj4=; b=vJJuV6ULrouaBfH3NPM3nWG0cShUxOP41dBTEhqnszXD8O33tpXihHQ9Pk2SDGF6QM Y6B2Vjmw6T/eaxFM0cMX/d5QvEyCyN6qZuzlABPujxA6coH8MxXGdtUQ0T8p4kmNUVi3 PIrvKFHYYgmpzBS/jGchEVD5cWD0dS/tHg3qx5okVoPWk8linaXqTX2BJ9uou/RBmOUg BZ/AMRqZ7LLeutrL8sX7Y/dUJwwq5L1a5ehmfaDDFAkFHjEZWcqh4i9OUifYOVRxrp/i WKU2r9TND1ue62EIR4B1u4nZcaOJ8O2JbiEs422rnHyhjLQ1xbUVZhlo0LOyt8Q+7cB5 7dAA== 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=FJx0bZDBu0GoYK4Inxqk3QEYdX8ioI0vl7TtFRslaj4=; b=JkVCcYd8Uq3K1gopSNlFZw8SlsZLrLJPHi7ke7LfOJ1rDeann0udK45osLa+H2Mpek Ac5La+eBMYmv8NwoLNk4GPY1CHg//OQl4Dw7g/vzu6OQbyE4gkd46JUykdbtXNwEEo01 wOARx30krS/hDOWs3xi6TNg2LQ8Corfi8UUSMKbIr+/jp+tH8myKxCi+tuKW9/UeWFmE yA5H/VOVW6Wsj5KoFZiuUqv/CVnkFXMFz9DBGpNHHVbAS/eXJmZdd+hOEdTlqFpPBkTO hYx6IZHKAHwNvQS679ye74CtyL50DCP8ntK+G6AO4QrQj7ptTeK69IO2KlVOtgVEITbC UH6A== X-Gm-Message-State: AOAM530HGvfHc6YYpfiJDyoJXFAfDJRnDj3IfwZDqjlW0jup6GXxxkyI Y+Eeq0Yizxipq+utCIIAs9mb/kFU X-Google-Smtp-Source: ABdhPJyDbmh7UIsVXTzkgtQbr8Fk7rbGbIBTRxS+w15xLmPWbuedtWDwXJj88WOM8Cl0utiGP+icJw== X-Received: by 2002:a05:6000:1107:: with SMTP id z7mr5805065wrw.355.1594918807890; Thu, 16 Jul 2020 10:00:07 -0700 (PDT) Original-Received: from rpluim-mac (vav06-1-78-207-202-134.fbx.proxad.net. [78.207.202.134]) by smtp.gmail.com with ESMTPSA id n125sm10052850wme.30.2020.07.16.10.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:00:07 -0700 (PDT) In-Reply-To: <87sgdrrc5z.fsf@disroot.org> (Jorge P. de Morais Neto's message of "Thu, 16 Jul 2020 07:23:36 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183088 Archived-At: >>>>> On Thu, 16 Jul 2020 07:23:36 -0300, "Jorge P. de Morais Neto" said: Jorge> The manual at [[info:emacs#Find Init]] says: Jorge> Emacs can also look in an XDG-compatible location for =E2= =80=98init.el=E2=80=99, Jorge> the default is the directory =E2=80=98~/.config/emacs=E2=80= =99. This can be Jorge> overriden by setting =E2=80=98XDG_CONFIG_HOME=E2=80=99 in yo= ur environment, its Jorge> value replaces =E2=80=98~/.config=E2=80=99 in the name of th= e default XDG init file. Jorge> However =E2=80=98~/.emacs.d=E2=80=99 and =E2=80=98~/.emacs= =E2=80=99 are always preferred if they Jorge> exist, which means that you must delete or rename them in or= der to Jorge> use the XDG location. Jorge> However, at [[info:emacs#Init File]] it says: Jorge> When Emacs is started, it normally tries to load a Lisp prog= ram from Jorge> an =E2=80=9Cinitialization file=E2=80=9D, or =E2=80=9Cinit f= ile=E2=80=9D for short. This file, if Jorge> it exists, specifies how to initialize Emacs for you. If th= e file Jorge> =E2=80=98~/.config/emacs/init.el=E2=80=99 exists, it is used= as the init file; Jorge> otherwise Emacs may look at =E2=80=98~/.emacs.el=E2=80=99, = =E2=80=98~/.emacs=E2=80=99, Jorge> =E2=80=98~/.emacs.d/init.el=E2=80=99, or other locations. *= Note Find Init::. Jorge> So [[info:emacs#Find Init]] says that `~/.emacs.d' and `~/.emacs= ' are Jorge> preferred, while [[info:emacs#Init File]] says that Jorge> `~/.config/emacs/init.el' is preferred. Yes, that is indeed inconsistent, I missed that part of the manual when flipping the XDG preference. I thought this would be a simple change, but as ever the rabbit hole was deep. Based on testing '~/.emacs.el' is preferred to '~/.emacs', is that expected? Anyway, I came up with the following: diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 719e09e861..00c8ee4f98 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2252,10 +2252,13 @@ Init File When Emacs is started, it normally tries to load a Lisp program from an @dfn{initialization file}, or @dfn{init file} for short. This file, if it exists, specifies how to initialize Emacs for you. -If the file @file{~/.config/emacs/init.el} exists, it is used as the -init file; otherwise Emacs may look at @file{~/.emacs.el}, -@file{~/.emacs}, @file{~/.emacs.d/init.el}, or other locations. -@xref{Find Init}. +Traditionally, file @file{~/.emacs} is used as the init file, although +Emacs also looks at @file{~/.emacs.el}, @file{~/.emacs.d/init.el}, +@file{~/.config/emacs/init.el}, or other locations. @xref{Find Init}. + +You may find it convenient to have all your Emacs configuration in one +directory, in which case you should use @file{~/.emacs.d/init.el} or +the XDG-compatible @file{~/.config/emacs/init.el}. =20 You can use the command line switch @samp{-q} to prevent loading your init file, and @samp{-u} (or @samp{--user}) to specify a @@ -2661,23 +2664,21 @@ Find Init @subsection How Emacs Finds Your Init File =20 Emacs normally finds your init file in a location under your home -directory. @xref{Init File}. By default this location is -@file{~/.emacs.d/init.el} where @file{~/} stands for your home directory. -This default can be overridden as described below. +directory. @xref{Init File}. =20 -Emacs looks for your init file -using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or -@file{~/.emacs.d/init.el}; you can choose to use any one of these -names. (Note that only the locations directly in your home directory -have a leading dot in the location's basename.) + Emacs looks for your init file using the filenames @file{~/.emacs.el}, +@file{~/.emacs}, or @file{~/.emacs.d/init.el} in that order; you can +choose to use any one of these names. (Note that only the locations +directly in your home directory have a leading dot in the location's +basename.) =20 Emacs can also look in an XDG-compatible location for @file{init.el}, the default is the directory @file{~/.config/emacs}. This can be overriden by setting @env{XDG_CONFIG_HOME} in your environment, its value replaces @file{~/.config} in the name of the default XDG init -file. However @file{~/.emacs.d} and @file{~/.emacs} are always -preferred if they exist, which means that you must delete or rename -them in order to use the XDG location. +file. However @file{~/.emacs.d}, @file{~/.emacs}, and +@file{~/.emacs.el} are always preferred if they exist, which means +that you must delete or rename them in order to use the XDG location. =20 Note also that if neither the XDG location nor @file{~/.emacs.d} exist, then Emacs will create @file{~/.emacs.d} (and therefore use it