From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Define list of packages in ~/.emacs.d/init.el
Date: Wed, 29 Nov 2017 17:15:09 -0500 [thread overview]
Message-ID: <jwv609s4txp.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: 87k1ya9vi5.fsf@cgc-instruments.com
> (defvar required-packages
> '(auctex
> yasnippet)
> "a list of packages to ensure are installed at launch.")
Recent Emacsen use the variable `package-selected-packages` for that.
> ; method to check if all packages are installed
> (defun packages-installed-p ()
> (loop for p in required-packages
> when (not (package-installed-p p)) do (return nil)
> finally (return t)))
> ; if not all packages are installed, check one by one and install the missing ones.
> (unless (packages-installed-p)
> ; check for new packages (package versions)
> (message "%s" "Emacs is now refreshing its package database...")
> (package-refresh-contents)
> (message "%s" " done.")
> ; install the missing packages
> (dolist (p required-packages)
> (when (not (package-installed-p p))
> (package-install p))))
AFAIK current Emacsen do not provide this functionality. I'm opposed to
having such a thing fully automatic (because Emacs shouldn't initiate
a connection to the internet without some explicit user request), but
since many users seem to actively want such a misfeature, I think Emacs
should probably offer this functionality (disabled by default, and with
a suitable warning on the label).
So, I suggest you `M-x report-emacs-bug` and request this
optional functionality.
Stefan
next prev parent reply other threads:[~2017-11-29 22:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 14:48 Define list of packages in ~/.emacs.d/init.el Stephan Brauer
2017-11-28 17:13 ` Dan Čermák
2017-11-29 22:15 ` Stefan Monnier [this message]
2017-11-30 1:47 ` Alexis
2017-11-30 2:20 ` Emanuel Berg
2017-11-30 8:27 ` Stephan Brauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv609s4txp.fsf-monnier+gmane.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.