help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Modular Configuration: the preferable way.


From: Arthur Miller
Subject: Re: Emacs Modular Configuration: the preferable way.
Date: Tue, 22 Jun 2021 09:52:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

>> In some functions it matters if you end filename with
>> a slash or not when you work with directories.
>
> I can imagine the situation but if it should do different
> things depending on if it is a directory or a regular file, it
> is better for these functions themselves to determine what it
> is, and not rely on the user of the function to insert a slash
> to denote a directory...
>
>>> Or what do you think one should do to put together for
>>> example the complete path
>>> ~/.emacs.d/emacs-init/erc/erc-iterate.el ?
>>
>> I pasted you an example from my init file.
>
> All that can't possibly be less error prone than a simple
> string concat with `format', besides what errors exactly are
> we trying to avoid?

"All that" was far less than what you had :). I do think it is less error
prone.

It lets me type less of long paths, then if I was typing and concating
strings. As you see I have setup one directory, "etc", and everything is
relative to that one. Instead of typing and concating every file name
for every directory and file, I can use that parth as a variable. If i
decide to change that directory I don't need to do it in 20 different
places and re-type everything, I can just type it in one place. Even with
search-replace I think it is more error prone to have it the way you do,
than to have just one place to edit.

For me it is important to be able to clone my setup from git and just
generate init files without having to tweak much. Currently I am able to
actually do that on both my stationary gnu/linux computer and a Windows
laptop. Not hardcoding paths as you did is one part of that setup. Even
if you personally don't care about other OS:s then *nix, you may still
have different physical machines with slightly different setup, say some
simple Pi computer and more powerful desktop computer which might have
different capabilities and your Emacs init doing differnt things at
startup, with different paths, hardware etc.

I don't know, just how I am using my computer(s), you may of course
setup your init file the way you prefer. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]