all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Let `package-install-selected-packages' install packages without asking for confirmation.
Date: Fri, 16 Jul 2021 22:01:48 +0800	[thread overview]
Message-ID: <CAGP6POJke_YAvXBmXObNESUr0jMoLTBVew+s9_2uTSmoYrMVqQ@mail.gmail.com> (raw)

I use the following init file:

```
;https://emacs.stackexchange.com/questions/34180/how-can-i-script-emacs-to-install-packages-from-list
;https://stackoverflow.com/questions/10092322/how-to-automatically-install-emacs-packages-by-specifying-a-list-of-package-name
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

(setq package-selected-packages
      '(company
        async))
(package-install-selected-packages)


(unless package-archive-contents
  (package-refresh-contents))
(package-install-selected-packages t)
```

But when I start Emacs, it still asks me to confirm the installation
of the packages. See the following info shown in minibuffer:

Packages to install: 2 (company async), proceed? (y or n)

As you can see, I've set the `(package-install-selected-packages t)'
option. So, how to let `package-install-selected-packages' install
packages without asking for confirmation.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



             reply	other threads:[~2021-07-16 14:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 14:01 Hongyi Zhao [this message]
2021-07-16 14:22 ` Let `package-install-selected-packages' install packages without asking for confirmation Arthur Miller
2021-07-16 14:41   ` Hongyi Zhao
2021-07-26  0:08   ` Rudolf Adamkovič

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=CAGP6POJke_YAvXBmXObNESUr0jMoLTBVew+s9_2uTSmoYrMVqQ@mail.gmail.com \
    --to=hongyi.zhao@gmail.com \
    --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.