unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* OT: version control of .el files in NT Emacs
@ 2016-09-08 17:32 Sivaram Neelakantan
  2016-09-08 20:05 ` John Mastro
  2016-09-08 23:03 ` Óscar Fuentes
  0 siblings, 2 replies; 11+ messages in thread
From: Sivaram Neelakantan @ 2016-09-08 17:32 UTC (permalink / raw)
  To: help-gnu-emacs

What's the best way to back up/version control my .Emacs and .el files
that are bog deep in some userprofile folder like

c:/Users/ADMIN/AppData/Roaming

I have git and cygwin installed.  Ideally, I'd like to replicate the
changes into C:/Sivaram/repos everytime I tinker with the files in the
HOME.

I could do a shell script and cp the files over and add it to the
other repo but that's a drag and I'm likely to forget to do it
regularly.

sivaram
-- 




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-08 17:32 OT: version control of .el files in NT Emacs Sivaram Neelakantan
@ 2016-09-08 20:05 ` John Mastro
  2016-09-08 23:03 ` Óscar Fuentes
  1 sibling, 0 replies; 11+ messages in thread
From: John Mastro @ 2016-09-08 20:05 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org; +Cc: Sivaram Neelakantan

Sivaram Neelakantan <nsivaram.net@gmail.com> wrote:
>
> What's the best way to back up/version control my .Emacs and .el files
> that are bog deep in some userprofile folder like
>
> c:/Users/ADMIN/AppData/Roaming
>
> I have git and cygwin installed.  Ideally, I'd like to replicate the
> changes into C:/Sivaram/repos everytime I tinker with the files in the
> HOME.
>
> I could do a shell script and cp the files over and add it to the
> other repo but that's a drag and I'm likely to forget to do it
> regularly.

Why not work with the files in the repos themselves? In other words, do
they really need to be in two different places?

If c:/Users/ADMIN isn't an appropriate place to keep a git repository,
you could override HOME to e.g. c:/Sivaram, and then create
c:/Sivaram/.emacs.d as a git repository.

        John



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-08 17:32 OT: version control of .el files in NT Emacs Sivaram Neelakantan
  2016-09-08 20:05 ` John Mastro
@ 2016-09-08 23:03 ` Óscar Fuentes
  2016-09-09  4:50   ` Sivaram Neelakantan
  1 sibling, 1 reply; 11+ messages in thread
From: Óscar Fuentes @ 2016-09-08 23:03 UTC (permalink / raw)
  To: help-gnu-emacs

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

> What's the best way to back up/version control my .Emacs and .el files
> that are bog deep in some userprofile folder like
>
> c:/Users/ADMIN/AppData/Roaming
>
> I have git and cygwin installed.  Ideally, I'd like to replicate the
> changes into C:/Sivaram/repos everytime I tinker with the files in the
> HOME.
>
> I could do a shell script and cp the files over and add it to the
> other repo but that's a drag and I'm likely to forget to do it
> regularly.

In HOME put an .emacs file with a single line:

(load "c:/Sivaram/repos/your_el_repo/emacs.el")

where your_el_repo contains your Emacs-related files and emacs.el
contains whatever you now have in %HOME%/.emacs.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-08 23:03 ` Óscar Fuentes
@ 2016-09-09  4:50   ` Sivaram Neelakantan
  2016-09-09  7:38     ` tomas
  2016-09-09 15:24     ` Óscar Fuentes
  0 siblings, 2 replies; 11+ messages in thread
From: Sivaram Neelakantan @ 2016-09-09  4:50 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Sep 09 2016,Óscar Fuentes wrote:

> Sivaram Neelakantan <nsivaram.net@gmail.com> writes:
>

[snipped 12 lines]

>
> In HOME put an .emacs file with a single line:
>
> (load "c:/Sivaram/repos/your_el_repo/emacs.el")
>
> where your_el_repo contains your Emacs-related files and emacs.el
> contains whatever you now have in %HOME%/.emacs.

dammit, that makes me look so stupid. It's exactly what I want.
Thanks for the simple idea.


sivaram
-- 




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-09  4:50   ` Sivaram Neelakantan
@ 2016-09-09  7:38     ` tomas
  2016-09-09 14:53       ` Sivaram Neelakantan
  2016-09-09 15:24     ` Óscar Fuentes
  1 sibling, 1 reply; 11+ messages in thread
From: tomas @ 2016-09-09  7:38 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Sep 09, 2016 at 10:20:36AM +0530, Sivaram Neelakantan wrote:

[...]

> dammit, that makes me look so stupid. It's exactly what I want.
> Thanks for the simple idea.

"Better look stupid and get smarter each day than look smart and
 get stupider each day"

(now I'm looking smart, am I? ;-)

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlfSZvMACgkQBcgs9XrR2kYcvgCfcNOBybvDxUUIv/ugxR2Ft+Bm
N/IAn24qlcIIpOZrX+aVtEpTif1Azf5f
=1nmY
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-09  7:38     ` tomas
@ 2016-09-09 14:53       ` Sivaram Neelakantan
  0 siblings, 0 replies; 11+ messages in thread
From: Sivaram Neelakantan @ 2016-09-09 14:53 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Sep 09 2016,tomas@tuxteam.de nil wrote:

> On Fri, Sep 09, 2016 at 10:20:36AM +0530, Sivaram Neelakantan wrote:
>
> [...]
>
>> dammit, that makes me look so stupid. It's exactly what I want.
>> Thanks for the simple idea.
>
> "Better look stupid and get smarter each day than look smart and
>  get stupider each day"

ermmm...this..is actually a thing?  :)


[snipped 7 lines]


sivaram
-- 




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-09  4:50   ` Sivaram Neelakantan
  2016-09-09  7:38     ` tomas
@ 2016-09-09 15:24     ` Óscar Fuentes
  2016-09-10  4:57       ` Sivaram Neelakantan
  1 sibling, 1 reply; 11+ messages in thread
From: Óscar Fuentes @ 2016-09-09 15:24 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Sivaram Neelakantan

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

>> In HOME put an .emacs file with a single line:
>>
>> (load "c:/Sivaram/repos/your_el_repo/emacs.el")
>>
>> where your_el_repo contains your Emacs-related files and emacs.el
>> contains whatever you now have in %HOME%/.emacs.
>
> dammit, that makes me look so stupid.

I don't think so.

> It's exactly what I want. Thanks for the simple idea.

You're welcome.

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.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-09 15:24     ` Óscar Fuentes
@ 2016-09-10  4:57       ` Sivaram Neelakantan
  2016-09-10 12:52         ` Óscar Fuentes
  0 siblings, 1 reply; 11+ messages in thread
From: Sivaram Neelakantan @ 2016-09-10  4:57 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Sep 09 2016,Óscar Fuentes wrote:


[snipped 17 lines]

> 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

(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")
(load-file "c:/gnu/initfiles/.ido_config.el")
(load-file "c:/gnu/initfiles/.ac_config.el")
(load-file "c:/gnu/initfiles/.r_ess_config.el")
(load-file "c:/gnu/initfiles/.cygwin_config.el")
(load-file "c:/gnu/initfiles/.uniq_config.el")
(load-file "c:/gnu/initfiles/.smex_config.el")

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?



sivaram
-- 




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-10  4:57       ` Sivaram Neelakantan
@ 2016-09-10 12:52         ` Óscar Fuentes
  2016-09-10 14:04           ` Sivaram Neelakantan
  0 siblings, 1 reply; 11+ messages in thread
From: Óscar Fuentes @ 2016-09-10 12:52 UTC (permalink / raw)
  To: help-gnu-emacs

Sivaram Neelakantan <nsivaram.net@gmail.com> 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.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-10 12:52         ` Óscar Fuentes
@ 2016-09-10 14:04           ` Sivaram Neelakantan
  2016-09-10 23:01             ` Óscar Fuentes
  0 siblings, 1 reply; 11+ messages in thread
From: Sivaram Neelakantan @ 2016-09-10 14:04 UTC (permalink / raw)
  To: help-gnu-emacs

On Sat, Sep 10 2016,Óscar Fuentes wrote:


[snipped 17 lines]

> 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.

OK, then I better fix that.


[snipped 8 lines]

> 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.

Yes the naming was deliberate with a . prefix.  I didn't want the
files to clutter my $HOME/ in my linux box, so I let it get hidden by
using a . prefix.  On Windows, so far, I haven't had any problems as
no other program looks for these kind of files

>
> 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.

Thanks for this.  I will relook at the load-path suggestion of yours.


[snipped 7 lines]

> 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)

Sorry, I'm lost here; could you please give an example of your set up and how
it helps.  I broke up my .emacs to manage the customisations for each
mode.  How would your example help?

>
> If you use custom themes you probably want to set custom-theme-directory
> too.

Right, will fix this too, as I see this

custom-theme-directory is a variable defined in `custom.el'.
Its value is "~/.emacs.d/"
Original value was 
"c:/gnu/initfiles/.emacs.d/"

Thanks

sivaram
-- 




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: OT: version control of .el files in NT Emacs
  2016-09-10 14:04           ` Sivaram Neelakantan
@ 2016-09-10 23:01             ` Óscar Fuentes
  0 siblings, 0 replies; 11+ messages in thread
From: Óscar Fuentes @ 2016-09-10 23:01 UTC (permalink / raw)
  To: help-gnu-emacs

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

>> 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)
>
> Sorry, I'm lost here; could you please give an example of your set up and how
> it helps.  I broke up my .emacs to manage the customisations for each
> mode.  How would your example help?

Do M-x customize

Change any value and then click on [State] and choose "Save for future
sessions". This will edit your $HOME/.emacs file (if you didn't set
`user-init-file') or your_el_repo/.emacs otherwise. I prefer to store
those customizations on its own file.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-10 23:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-08 17:32 OT: version control of .el files in NT Emacs Sivaram Neelakantan
2016-09-08 20:05 ` John Mastro
2016-09-08 23:03 ` Óscar Fuentes
2016-09-09  4:50   ` Sivaram Neelakantan
2016-09-09  7:38     ` tomas
2016-09-09 14:53       ` Sivaram Neelakantan
2016-09-09 15:24     ` Óscar Fuentes
2016-09-10  4:57       ` Sivaram Neelakantan
2016-09-10 12:52         ` Óscar Fuentes
2016-09-10 14:04           ` Sivaram Neelakantan
2016-09-10 23:01             ` Óscar Fuentes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).