本文介绍了用MELPA自动安装emacs软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在em ems中声明一个我想在emacs中使用的所有软件包。我想知道它是否可能加载丢失的包装,例如MELPA当我启动emacs而不通过列表并标记我想安装的那些?

解决方案

新的回答:



虽然我的原始答案仍然有效,我现在使用方法是一个梦幻般的工具为了整洁的Emacs配置。事实上,当我写了我的原始答案时,我已经在使用它来进行干净的包装加载。



当时我忽略了一直读到,因此没有意识到它可以处理软件包安装另外:

加载 package.el 并初始化我的软件包仓库后,我的配置包含

 (if(not(package-installed-p'use-package))
(progn
(package-refresh-contents)
(package-install'use-包)))

(require'use-package)

许多这样的片段:

  ;;;展开区域
(使用包扩展区域
:确保展开区域
:bind(C- =。呃/展开区域))

如果您发现此信息有用,请给予Jordon一个upvote。



原来的答案:



看看和,它们共同解决这个问题。



从Cask网站:

之后,您需要在Emacs配置中添加如下内容:

 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 




code $为elisp依赖定义了一个特定于doman的语言。要安装软件包,您需要:

 (源melpa)

(取决于自动完成)
(依赖于 )
(依赖于f)
(取决于flycheck)
(依赖于helm)
(依赖于magit)
(取决于弹出)
(依赖于抛物线)
(依赖于s)
(依赖于smartparens)
(取决于yasnippet)

请注意,这不会进入您的Emacs配置文件,而是进入〜/ .emacs.d / Cask



托盘使用交互式安装的软件包更新Cask文件,例如通过 M-x package-list-packages ,因此您不必手动维护上述文件。


I want to declare all packages that I want to use in emacs in a init.el file. I wonder if its possible to load the missing packages with e.g. MELPA when I startup emacs without going through the list and mark the ones I want to install?

解决方案

New answer:

While my original answer is still valid, I now use the method suggested by Jordon. use-package is a fantastic tool for tidy Emacs configurations. In fact, I was already using it for clean package loading when I wrote my original answer.

At that time, I neglected to read all the way to the bottom of its README, and therefore didn't realize that it could handle package installation as well:

After loading package.el and initializing my package repositories, my configuration contains

(if (not (package-installed-p 'use-package))
    (progn
      (package-refresh-contents)
      (package-install 'use-package)))

(require 'use-package)

and subsequently many snippets like this:

;;; Expand-region
(use-package expand-region
  :ensure expand-region
  :bind ("C-=" . er/expand-region))

If you find this information useful, please give Jordon an upvote.

Original answer:

Have a look at Cask and Pallet, which work together to solve this problem.

From the Cask website:

After installing Cask, you'll need to add something like this to your Emacs configuration:

(require 'cask)
(cask-initialize)

Cask defines a doman-specific language for elisp dependencies. For installing packages, you'll need something like what is outlined here:

(source melpa)

(depends-on "auto-complete")
(depends-on "dash")
(depends-on "f")
(depends-on "flycheck")
(depends-on "helm")
(depends-on "magit")
(depends-on "popup")
(depends-on "projectile")
(depends-on "s")
(depends-on "smartparens")
(depends-on "yasnippet")

Note that this does not go into your Emacs config file, but rather into ~/.emacs.d/Cask.

Pallet updates the Cask file with packages installed interactively, e.g. via M-x package-list-packages, so you don't have to manually maintain the above file.

这篇关于用MELPA自动安装emacs软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:52
查看更多