Bazaar: how put files from different locations in

2019-06-14 14:29发布

问题:

I'm new to bazaar and would like to give it a try by storing my Emacs configuration files in one repository.

These files consist of a .emacs file in my home directory (on unixish systems) and a couple of Emacs Lisp source files in /usr/local/share/emacs/site-lisp

I'd really like to have one repo because some changes in my .emacs file go together with changes in other files.

What I couldn't work out from the manual is how to get these files together. The "bzr init" takes recursively all files from the current directory; for my situation this would mean to create the repo in the root directory...

What do you recommend? Try working with symbolic links? Is there a way to associate a revision from one repo to one from another repo, so that easier solution of having two separate repos could be a way to go?

There is an additional challenge: on a Windows machine, these Emacs files sit on completely different locations. How to treat that?

I have some perforce experience: there the solution is easy: you can just define a view that maps repo files to an arbitrary location on your hard disk.

回答1:

This is more of a bzr question, but I can give you an Emacs answer.

The "new" way to structure your Emacs setup is to have a directory ~/.emacs.d and put everything under there. Rename your .emacs file to ~/.emacs.d/init.el and it will be found automatically. Next, create a ~/.emacs.d/lisp directory (actually you can name the dir whatever you want, but lisp is pretty standard), and move or copy the files the /usr/local/share/emacs/site-lisp files to that dir (and byte-compile them if you want to). Finally, put (add-to-list 'load-path "~/.emacs.d/lisp") at the top of your ~/.emacs/init.el file.

Now everything is under one tree, so bzr init it as usual. This setup will work on Windows also since Emacs understands ~ on there as well.