emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [OT] Requiring packages which may be missing?
@ 2017-04-24  8:53 Loris Bennett
  2017-04-24 10:16 ` Adam Porter
  2017-04-24 14:01 ` Tim Cross
  0 siblings, 2 replies; 5+ messages in thread
From: Loris Bennett @ 2017-04-24  8:53 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

This is more of a general emacs question.

I often use the same .emacs on various machines which may not have all
the packages I normally load.  To get around this I use the Fabrice
Niessen's 'try-require' function taken from

  http://www.mygooglest.com/fni/dot-emacs.html

Due to some recent  problems, I wanted to look at the  way I load things
and wondered how others deal with missing packages.

Cheers,

Loris

PS: I mainly use Emacs 25, but would be interested in Emacs 24
compatibility.

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin         Email loris.bennett@fu-berlin.de

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

* Re: [OT] Requiring packages which may be missing?
  2017-04-24  8:53 [OT] Requiring packages which may be missing? Loris Bennett
@ 2017-04-24 10:16 ` Adam Porter
  2017-04-24 14:09   ` Tim Cross
  2017-04-24 14:01 ` Tim Cross
  1 sibling, 1 reply; 5+ messages in thread
From: Adam Porter @ 2017-04-24 10:16 UTC (permalink / raw)
  To: emacs-orgmode

I find that the best way is to store the entire ~/.emacs.d directory
(including the /elpa subdirectory) in a git repository.  This makes it
easy to keep your entire config in sync between machines, and it means
you keep your init file in sync with the versions of packages.
Otherwise you may find that when you install your init file on a new
machine and install the same packages, you get newer versions that have
breaking changes, and it usually happens when you don't have time to fix
it.

If for some reason you don't want to do that, the use-package macro
makes it easy to install packages, like:

(use-package org
  :ensure t)

That will install org using the package system, if it's not already installed.

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

* Re: [OT] Requiring packages which may be missing?
  2017-04-24  8:53 [OT] Requiring packages which may be missing? Loris Bennett
  2017-04-24 10:16 ` Adam Porter
@ 2017-04-24 14:01 ` Tim Cross
  1 sibling, 0 replies; 5+ messages in thread
From: Tim Cross @ 2017-04-24 14:01 UTC (permalink / raw)
  To: Loris Bennett; +Cc: emacs-orgmode


Have a look at the use-package package. I have found it makes this much
easier. There are some complications associated with using it and
org-mode, due mainly to emacs being bundled with one version and another
vesion being available in both the gnus and org-mode elpa
repos. However, once you have that bit sorted, the rest really makes
managing your packages easier.

One of the nice things about use-package is that it includes the :ensure
keyword, which tells emacs to ensure that the package has been
installed. So you emacs init file ends up being essentially a lot of
use-package stanzas that are easy to maintain and ensure all the
packages are loaded. I keep my emacs init file on github and when I run
emacs on a different system, all I need to do is clone the repo and
start emacs. The first run will be a little slow as emacs installs all
the packages I need, but after that, it is fast - in fact, use-package
has options which can speed up emacs startup by delaying loading of
package (it sets up autoloads for you). I also find managing my
configuration much cleaner.

Yes, I am definitely a convert. There are wrinkles - it isn't magic and
you will go through some trial an error, but I've been using it for a
while now and am very happy with how much easier managing my init.el and
all my elpa packages is.

HTH

Tim

Loris Bennett writes:

> Hi,
>
> This is more of a general emacs question.
>
> I often use the same .emacs on various machines which may not have all
> the packages I normally load.  To get around this I use the Fabrice
> Niessen's 'try-require' function taken from
>
>   http://www.mygooglest.com/fni/dot-emacs.html
>
> Due to some recent  problems, I wanted to look at the  way I load things
> and wondered how others deal with missing packages.
>
> Cheers,
>
> Loris
>
> PS: I mainly use Emacs 25, but would be interested in Emacs 24
> compatibility.


-- 
---
Tim Cross

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

* Re: [OT] Requiring packages which may be missing?
  2017-04-24 10:16 ` Adam Porter
@ 2017-04-24 14:09   ` Tim Cross
  2017-04-24 23:07     ` Adam Porter
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Cross @ 2017-04-24 14:09 UTC (permalink / raw)
  To: Adam Porter; +Cc: emacs-orgmode


You do need to be careful when sharing your .emacs.d between machines to
ensure you use something like gitignore to exclude things you may not
want to share across systems (such as auto-save files, various command
history files etc). I've found the use of use-package and init.el in a
git repo the best combination.

With respect to packages changing, you can use the options in elpa to
pin a package to a specific version. The use-package macro also support
this.

Tim

Adam Porter writes:

> I find that the best way is to store the entire ~/.emacs.d directory
> (including the /elpa subdirectory) in a git repository.  This makes it
> easy to keep your entire config in sync between machines, and it means
> you keep your init file in sync with the versions of packages.
> Otherwise you may find that when you install your init file on a new
> machine and install the same packages, you get newer versions that have
> breaking changes, and it usually happens when you don't have time to fix
> it.
>
> If for some reason you don't want to do that, the use-package macro
> makes it easy to install packages, like:
>
> (use-package org
>   :ensure t)
>
> That will install org using the package system, if it's not already installed.


-- 
---
Tim Cross

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

* Re: [OT] Requiring packages which may be missing?
  2017-04-24 14:09   ` Tim Cross
@ 2017-04-24 23:07     ` Adam Porter
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Porter @ 2017-04-24 23:07 UTC (permalink / raw)
  To: emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> You do need to be careful when sharing your .emacs.d between machines to
> ensure you use something like gitignore to exclude things you may not
> want to share across systems (such as auto-save files, various command
> history files etc).

Yes, that's a good point.  You should either exclude/ignore them, or
just never commit them.

> With respect to packages changing, you can use the options in elpa to
> pin a package to a specific version. The use-package macro also support
> this.

Note that you can't install old versions of packages with package.el.
Once a newer version is available, the old version is deleted from
MELPA.  You'd need to use a different tool, like Quelpa.

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

end of thread, other threads:[~2017-04-24 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-24  8:53 [OT] Requiring packages which may be missing? Loris Bennett
2017-04-24 10:16 ` Adam Porter
2017-04-24 14:09   ` Tim Cross
2017-04-24 23:07     ` Adam Porter
2017-04-24 14:01 ` Tim Cross

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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