From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: OT: version control of .el files in NT Emacs Date: Sat, 10 Sep 2016 14:52:37 +0200 Message-ID: <87r38rzzl6.fsf@wanadoo.es> References: <87k2emxpon.fsf@gmail.com> <871t0u0zau.fsf@wanadoo.es> <87k2ely8v7.fsf@gmail.com> <87wpilyu31.fsf@wanadoo.es> <871t0stkqu.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473514765 12543 195.159.176.226 (10 Sep 2016 13:39:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Sep 2016 13:39:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 10 15:39:21 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biiV6-0002dw-Ba for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Sep 2016 15:39:20 +0200 Original-Received: from localhost ([::1]:34583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biiV4-0000sq-Cj for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Sep 2016 09:39:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bihmT-0002tP-PZ for help-gnu-emacs@gnu.org; Sat, 10 Sep 2016 08:53:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bihmN-00016u-Sy for help-gnu-emacs@gnu.org; Sat, 10 Sep 2016 08:53:12 -0400 Original-Received: from [195.159.176.226] (port=42407 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bihmN-00016U-MQ for help-gnu-emacs@gnu.org; Sat, 10 Sep 2016 08:53:07 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bihm9-0004dL-8A for help-gnu-emacs@gnu.org; Sat, 10 Sep 2016 14:52:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 61 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:REv/SZbi17jYNQVodYxDjRvdQZg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Sat, 10 Sep 2016 09:38:45 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111325 Archived-At: Sivaram Neelakantan writes: >> You probably noticed that you need to adjust the load-path. A robust way >> of doing that is to put in your_el_repo/emacs.el : >> >> (add-to-list 'load-path (file-name-directory load-file-name)) >> >> It is also is useful to put this >> >> (setq user-init-file load-file-name) >> >> at the beginning of your emacs.el file in your_el_repo. Look up the >> docstring for the user-init-file variable to see why. >> > > How does this help? Because I have just 2 lines in the $HOME/.emacs If you always use absolute paths and don't plan to change them, not much, other than noise. The lines I suggested makes possible to move your files to another directory requiring only a change to $HOME/.emacs. And by not setting user-init-file some features will try to inspect/modify $HOME/.emacs instead of your_el_repo/emacs.el. > (setq user-emacs-directory "c:/gnu/initfiles/.emacs.d/" ) > (load-file "c:/gnu/initfiles/.emacs") > > And in the c:/gnu/initfiles/.emacs file I hard coded paths like > > (load-file "c:/gnu/initfiles/.text_config.el") Prepending those files with a dot is not a good idea. The dot means that the files are hidden on most GNU/Linux file browsers and might confuse some tools on windows, that expect file names to obey the name.extension format. Besides, load-file is an interactive function that calls `load'. With my suggested adjustment to load-path you can simply use (load "text_config.el") or simply (load "text_config") which will also work if you ever decide to byte-compile your config files. > I get it that .sh_history, .smex_history and other .history* > files used/created by various packages will be still created in > $HOME/.emacs but those are fairly transient stuff aren't they? Yes, I don't care about those either. One thing I do is to use a separate file for customizations: (setq custom-file (concat (file-name-directory load-file-name) "customizations.el")) (load custom-file 't) If you use custom themes you probably want to set custom-theme-directory too.