* 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
[parent not found: <mailman.654.1369901061.22516.help-gnu-emacs@gnu.org>]
* 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
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 --
2013-05-30 8:04 suggestion for portable emacs customizations Luca Ferrari
2013-05-30 11:01 ` Dmitry Gutov
2013-05-30 12:29 ` Luca Ferrari
[not found] <mailman.654.1369901061.22516.help-gnu-emacs@gnu.org>
2013-05-30 8:42 ` Fabrice Niessen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.