[英]Any way to prevent emacs package manager from loading a single package on startup?
Basically, I share a single .emacs.d across several machines and have one package that I only want on my home machine (org-journal). 基本上,我在多台计算机上共享一个.emacs.d,并且只有一个软件包需要在我的家用计算机上使用(org-journal)。 I like using the package manager to keep this up to date, but it loads the package on every machine which causes some interference to a normal work flow. 我喜欢使用软件包管理器来保持最新状态,但是它将软件包加载到每台机器上,这会对正常的工作流程造成一些干扰。
Is there a way to get the package manager to skip loading this one package but load all others? 有没有一种方法可以使程序包管理器跳过加载该程序包而仅加载其他所有程序包?
ETA: I tried only loading it on my desktop via ETA:我尝试仅通过以下方式将其加载到桌面上
(when (string-equal (system-name) "will-desktop")
(require 'org-journal))
but that didn't work because using (package-initialize)
early on in my init.el automatically loads it. 但这没有用,因为在我的init.el早期使用(package-initialize)
会自动加载它。
See the package-load-list
variable. 请参阅package-load-list
变量。
The default value is (all)
, and the docstring says that all
affects only packages not specified by other elements, so by my reading, you could simply add the following to inhibit org-journal
: 默认值为(all)
,并且文档字符串说all
仅影响其他元素未指定的包,因此,按我的阅读,您可以简单地添加以下内容以禁止org-journal
:
(setq package-load-list '((org-journal nil) all))
If you're forcibly initialising the package manager in your init file, make sure you make this change beforehand. 如果您要在初始化文件中强制初始化程序包管理器,请确保事先进行此更改。
Edit: Tested and updated/fixed. 编辑:经过测试和更新/修复。 add-to-list
was wrong, as the variable isn't already defined at that point. add-to-list
错误,因为此时尚未定义变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.