* suggestion for portable emacs customizations
@ 2013-05-30 8:04 Luca Ferrari
2013-05-30 11:01 ` Dmitry Gutov
0 siblings, 1 reply; 4+ messages in thread
From: Luca Ferrari @ 2013-05-30 8:04 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
I'm beginning to have a lot of virtual machines where I have to run
emacs, and I would like to have them all configured the same way with
the same extensions (e.g., autocomplete) and configurations. Is there
a smart way to provide a kind of "distribution" so that I can ease and
automate the configuration of the multiple installations?
The first thing was thinking about was to set up a ~/.emacs directory
will all the lisp extensions and to raw copy it, but there could be a
smarter way...
Any idea?
Thanks,
Luca
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: suggestion for portable emacs customizations
[not found] <mailman.654.1369901061.22516.help-gnu-emacs@gnu.org>
@ 2013-05-30 8:42 ` Fabrice Niessen
0 siblings, 0 replies; 4+ messages in thread
From: Fabrice Niessen @ 2013-05-30 8:42 UTC (permalink / raw)
To: help-gnu-emacs-mXXj517/zsQ
Hi Luca,
Luca Ferrari wrote:
> I'm beginning to have a lot of virtual machines where I have to run
> emacs, and I would like to have them all configured the same way with
> the same extensions (e.g., autocomplete) and configurations. Is there
> a smart way to provide a kind of "distribution" so that I can ease and
> automate the configuration of the multiple installations?
> The first thing was thinking about was to set up a ~/.emacs directory
> will all the lisp extensions and to raw copy it, but there could be a
> smarter way...
> Any idea?
The approach I chose: have one (huge) Emacs config file [1], and as less
system-dependent customs as possible. So, I consider it OK to have "when
running-ms-windows" or such conditions, but I don't like "conds" with the
different machine names. At least, I try to avoid that as much as I can, and
abstract the differences between the machines.
Now, regarding the loading of packages, I choose to:
- put them in a distributed (versioning) system: SVN, Git or DropBox.
- replace explicit `require' calls by `try-require' calls which won't fail
(and stop processing the rest of your .emacs) if the package is not present.
--8<---------------cut here---------------start------------->8---
(defvar lvn/missing-packages nil
"List of packages that `try-require' can't find.")
;; require a feature/library if available; if not, fail silently
(defun try-require (feature)
"Attempt to load a library or module. Return true if the
library given as argument is successfully loaded. If not, instead
of an error, just add the package to a list of missing packages."
(let (lvn/time-start)
(condition-case err
(progn
(message "(info) Checking for `%s'..." feature)
(if (stringp feature)
(load-library feature)
(setq lvn/time-start (float-time))
(require feature))
(message "(info) Checking for `%s'... %s (loaded in %.2f s)"
feature
(locate-library (symbol-name feature))
(- (float-time) lvn/time-start))
t)
(file-error
(progn
(message "(info) Checking for `%s'... missing" feature)
(add-to-list 'lvn/missing-packages feature 'append))
nil))))
--8<---------------cut here---------------end--------------->8---
Best regards,
Fabrice Niessen
[1] Under a VCS, so that you can easily propagate your changes from one
machine to the others.
PS- If you're interested, here's a link to my .emacs file, provided as a
library (called "emacs-leuven"):
https://www.assembla.com/code/emacs-leuven/git/nodes/master/emacs-leuven.el
--
Fabrice Niessen
Leuven, Belgium
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: suggestion for portable emacs customizations
2013-05-30 8:04 Luca Ferrari
@ 2013-05-30 11:01 ` Dmitry Gutov
2013-05-30 12:29 ` Luca Ferrari
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Gutov @ 2013-05-30 11:01 UTC (permalink / raw)
To: Luca Ferrari; +Cc: help-gnu-emacs
Luca Ferrari <fluca1978@infinito.it> writes:
> I'm beginning to have a lot of virtual machines where I have to run
> emacs, and I would like to have them all configured the same way with
> the same extensions (e.g., autocomplete) and configurations. Is there
> a smart way to provide a kind of "distribution" so that I can ease and
> automate the configuration of the multiple installations?
> The first thing was thinking about was to set up a ~/.emacs directory
> will all the lisp extensions and to raw copy it, but there could be a
> smarter way...
> Any idea?
There are quite a few suggestions here:
http://www.reddit.com/r/emacs/comments/1d2qiv/how_to_make_an_emacs_configuration_that_based_on/
In short, use ELPA packages when you can (but don't check in the elpa
subdirectory), and use git submodules for the rest of the packages.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: suggestion for portable emacs customizations
2013-05-30 11:01 ` Dmitry Gutov
@ 2013-05-30 12:29 ` Luca Ferrari
0 siblings, 0 replies; 4+ messages in thread
From: Luca Ferrari @ 2013-05-30 12:29 UTC (permalink / raw)
To: help-gnu-emacs
On Thu, May 30, 2013 at 1:01 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
> There are quite a few suggestions here:
> http://www.reddit.com/r/emacs/comments/1d2qiv/how_to_make_an_emacs_configuration_that_based_on/
>
> In short, use ELPA packages when you can (but don't check in the elpa
> subdirectory), and use git submodules for the rest of the packages.
Thanks for the suggestions, as far as I see the best practice is to
use a shared repository (git) and ELPA to get packages.
I've already tried prelude, I'm going to try the other suggested
pre-built available on github.
Thanks,
Luca
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-30 12:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.654.1369901061.22516.help-gnu-emacs@gnu.org>
2013-05-30 8:42 ` suggestion for portable emacs customizations Fabrice Niessen
2013-05-30 8:04 Luca Ferrari
2013-05-30 11:01 ` Dmitry Gutov
2013-05-30 12:29 ` Luca Ferrari
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).