From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: 2QdxY4RzWzUUiLuE@potatochowder.com Newsgroups: gmane.emacs.help Subject: Re: ~/.emacs vs ~/.emacs.d/init.el. Date: Sun, 13 Dec 2020 08:52:48 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26320"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 13 15:53:29 2020 Return-path: Envelope-to: geh-help-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 1koSka-0006jh-Ta for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Dec 2020 15:53:28 +0100 Original-Received: from localhost ([::1]:38434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koSkZ-0007Hk-WD for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Dec 2020 09:53:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1koSk8-0007Hc-NG for help-gnu-emacs@gnu.org; Sun, 13 Dec 2020 09:53:00 -0500 Original-Received: from www458.your-server.de ([136.243.165.62]:49180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1koSk6-0000yQ-Ht for help-gnu-emacs@gnu.org; Sun, 13 Dec 2020 09:53:00 -0500 Original-Received: from sslproxy01.your-server.de ([78.46.139.224]) by www458.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1koSk4-000Cgs-9J for help-gnu-emacs@gnu.org; Sun, 13 Dec 2020 15:52:56 +0100 Original-Received: from [172.58.59.50] (helo=localhost) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1koSk3-000BcB-Kg for help-gnu-emacs@gnu.org; Sun, 13 Dec 2020 15:52:55 +0100 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com X-Virus-Scanned: Clear (ClamAV 0.102.4/26015/Sat Dec 12 15:34:39 2020) Received-SPF: pass client-ip=136.243.165.62; envelope-from=2QdxY4RzWzUUiLuE@potatochowder.com; helo=www458.your-server.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126311 Archived-At: On 2020-12-13 at 22:38:08 +0800, Hongyi Zhao wrote: > On Sun, Dec 13, 2020 at 9:59 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > > > On 2020-12-13 at 21:50:37 +0800, > > Hongyi Zhao wrote: > > > > > On Sun, Dec 13, 2020 at 6:09 PM Yuri Khan wrote: > > > > > > > > On Sun, 13 Dec 2020 at 16:00, Hongyi Zhao wrote: > > > > > > > > > As far as the initialization file is concerned, which is more > > > > > preferable,~/.emacs or ~/.emacs.d/init.el? > > > > > > > > If you are choosing between these two, ~/.emacs.d/init.el is > > > > preferable. Because then you can put the whole .emacs.d into version > > > > control separately from your home directory. > > > > > > > > However keep in mind that Emacs 27 adds support for XDG-style > > > > configuration directory, ~/.config/emacs/, which gives you the same > > > > abilities as ~/.emacs.d with an added benefit of less clutter in your > > > > home directory. > > > > > > I've tried the following based on your above notes, but it seems that > > > emacs doesn't pick up the initialization file located under > > > ~/.config/emacs/ automatically. > > > > > > $ mv .emacs.d/init.el ~/.config/emacs/ > > > > > > Any hints for this problem? > > > > Try removing or renaming ~/.emacs.d, the existence of which might be > > fooling emacs into *not* searching for ~/.config/emacs. For reference, > > see: > > > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html > > > > Currently, the ~/.emacs.d directory is used by emacs to store many of > the user data as shown below: > > $ ls ~/.emacs.d/ > auto-save-list cnfonts eaf elpa init.el network-security.data rime url > > So, if I removed/deleted this folder, then where should I put the > emacs' user data? Presumably, ~/.config/emacs is an alternative to ~/.emacs.d, so you would move all of that user data from ~/.emacs.d to ~/.config/emacs. The net result would have been the same if you had renamed ~/.emacs.d to ~/.config/emacs instead of separating the init file from the other user data.