From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.help Subject: Re: Combine multiple (straight-)use-package commands into one. Date: Sun, 13 Jun 2021 12:22:00 +0200 Message-ID: <90b352da-bcc8-0599-3d30-1299231f14e9@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23176"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 To: Hongyi Zhao , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 13 12:22:54 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsNGX-0005ld-NE for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 12:22:53 +0200 Original-Received: from localhost ([::1]:53044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsNGW-0003bC-Os for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 06:22:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsNFn-0003Zj-SU for help-gnu-emacs@gnu.org; Sun, 13 Jun 2021 06:22:07 -0400 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsNFl-00062B-TN for help-gnu-emacs@gnu.org; Sun, 13 Jun 2021 06:22:07 -0400 Original-Received: by mail-wm1-x32d.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso11096803wmh.4 for ; Sun, 13 Jun 2021 03:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=Ack4+TB8QTyAFsMxCEW1DVekQxGqGrwhpGnSx3nHOxk=; b=OYRMPCuSWg8zH1VGmitxJ2ugC4L2NRSoOVJP7YgX/qVII6lCCKiJx7Fbvf6VpfB381 /ovHkNlI5iQ5S4SqrHODgNbt79TlDN8drnRZPWeScmwThhk46KiuWeyVQv5/JUZOCENG 3hTyRILVr+d3ql0VkOJa7sobdc7Pn9edJRN49REGR5b9XYR27BIUU/ruuY4roHOf29fg JmxOjLlDlRN5K25EBv+pHaYiH8QWPg/8vLX5n1W4/Tpy+8d5dqXEqbmoafEVEHPmNrSQ ya3OKvAcJeSrr9hZsB9HRJFPsC83CbWfD0dxPvGeVGcndrN1W8o47dTifP5xtmIR5D/Q 9zyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Ack4+TB8QTyAFsMxCEW1DVekQxGqGrwhpGnSx3nHOxk=; b=e9I4XVAQkH75xKkq6IJgmmlmudTzBpXMMnXHVsYGE/LZun0A9+/ievwD/caZFTA+bb k+zhw6KvE1Ywer28O0ZYeq7YC2gGRnn8EDoXX4Qy9a1Q2QQkmmDT6skyV9KfvzsNXJOR 5jixB0Ra5dBq2kcotyRQZTTTWoNbzGGv997G7iRc4Q4tZlv6tJyWX+lIOvxuWWo6Fq6H 8ULEqcBltLwcmYof/MghJ2zj8ZOicvqecWaoHNVAXmuBDJhR1xIISttOMuhvx76h6/73 HA/Y3Wpi+Pc8bgt9EJG3jClXOTXmcJOM9RwbDoQXdZJsrdQwlX20g/BMNVZld+pAXvWp 0zzA== X-Gm-Message-State: AOAM532zuSFECPZdj4USQF29jmZ9yPWBR86t6Fsvi8EUnqwfI3tVW9Gy QN5XV1Nirp0vue3IEWmEORFQKv1y8zB+Kycelts= X-Google-Smtp-Source: ABdhPJwlyGQGKCsdFJ5D21uQ0e12VHwZjLlQEgqXQHhAc2I6nlrhwWpfOdwVGew/fDPKIluJTku1JA== X-Received: by 2002:a05:600c:511d:: with SMTP id o29mr10513099wms.0.1623579722570; Sun, 13 Jun 2021 03:22:02 -0700 (PDT) Original-Received: from [192.168.2.110] (dslb-088-066-248-118.088.066.pools.vodafone-ip.de. [88.66.248.118]) by smtp.gmail.com with ESMTPSA id l3sm10741972wmh.2.2021.06.13.03.22.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Jun 2021 03:22:02 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=thibaut.verron@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130788 Archived-At: On 12/06/2021 16:57, Hongyi Zhao wrote: > On Sat, Jun 12, 2021 at 5:57 PM Hongyi Zhao wrote: >> On Ubuntu 20.04, according to the instruction >> [here](https://github.com/raxod502/straight.el/issues/786#issuecomment-859155336), >> I use the following settings in my Emacs init file: >> >> ``` >> ;;Bootstrap straight >> (defvar bootstrap-version) >> (let ((bootstrap-file >> (expand-file-name "straight/repos/straight.el/bootstrap.el" >> user-emacs-directory)) >> (bootstrap-version 5)) >> (unless (file-exists-p bootstrap-file) >> (with-current-buffer >> (url-retrieve-synchronously >> "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" >> 'silent 'inhibit-cookies) >> (goto-char (point-max)) >> (eval-print-last-sexp))) >> (load bootstrap-file nil 'nomessage)) >> >> ;; Install use-package via straight >> (straight-use-package 'use-package) >> >> ;; Setting this to `t' makes it so that you don't need to include the :straight >> ;; keyword in use-package declarations unless you want to add/extend the package >> ;; installation recipe. >> >> (setq straight-use-package-by-default t) ; straight's equivalent of >> `use-package-always-ensure'. >> ``` >> Now, I want to install multiple package hosted in recipe repositories >> (such as MELPA) as shown below with only one (straight-)use-package >> command, is it possible? >> ``` >> (use-package flycheck) >> (use-package lsp-mode) >> (use-package dash) >> (use-package posframe) >> (use-package s) >> (use-package ein) >> (use-package smartparens) >> (use-package valign) >> (use-package multi-term) >> ``` > Based on the code snippets at > , > I figured out the following solution with `straight-use-package' > command: > > (defvar package-list) > (setq package-list '( > flycheck lsp-mode dash posframe > s ein smartparens valign > multi-term > )) > > (mapc (lambda(package-name) > (straight-use-package package-name)) package-list) > > But I still don't know the corresponding implementation with > `use-package' command. I don't understand what you don't like about this code: as far as I know (straight-use-package 'foo) is strictly equivalent to (use-package foo :straight t), and with straight-use-package-by-default you don't need the :straight t. Why is it such a problem to have straight-use-package in this loop instead of use-package? One confusion which took me quite a long time to clear, is that despite the similar names, straight-use-package and use-package have very different purposes: straight-use-package is for installing the package (similar to package-install) while use-package is for grouping together everything related to a package (this includes installation, either by straight or package.el, but also initialization, configuration, bindings...). Could it be your problem as well? Best wishes, Thibaut