简体   繁体   English

Emacs包,全局安装,与本地安装elpa

[英]Emacs packages, installing globally versus locally with elpa

I run linux and use different user names to segment different activities. 我运行linux并使用不同的用户名来分割不同的活动。 Using elpa, there are some packages that I would like to install so that they get loaded no matter who the user, there are packages that I would like to be loaded for only one user. 使用elpa,有一些我想要安装的软件包,无论用户是谁,都有加载,我只想为一个用户加载软件包。

Org-mode for example is something I would want to be loaded by every user. 例如Org-mode是我想要被每个用户加载的东西。 C++ related packages I might want for user client1, but not ruby packages. 我可能想要的用户client1的C ++相关包,但不是ruby包。 I might want ruby related packages for user client2, but not C++ packages. 我可能想要用户client2的ruby相关包,但不是C ++包。 There might be a new package for C++ programming that I do not want to include in serious work but want to play with using user experimental. 可能有一个新的C ++编程包,我不想包含在认真的工作中但想要使用用户实验。

It used to be that global stuff you put in site lisp and local stuff you put someplace in ~, but that doesn't seem to work with elpa. 它曾经是你放在网站lisp中的全局内容和你放在某处的本地内容〜但是这似乎不适用于elpa。

package.el looks for installed packages along the package-directory-list path (additionally to package-user-dir which is where packages get installed). package.el在package-directory-list路径中查找已安装的软件包(另外还有package-user-dir ,它是安装软件包的地方)。

So I'd recommend you arrange to have a "global" user. 所以我建议你安排一个“全球”用户。 And then change all other users to include 然后更改所有其他用户以包含

(require 'package)
(push "/home/globaluser/.emacs.d/elpa" package-directory-list)

in their ~/.emacs . 在他们的~/.emacs This way, any package that you want to install for all users should be installed by globaluser . 这样,您要为所有用户安装的任何程序包都应由globaluser安装。

BTW, another way to attack the vector is to distinguish "installed" and "enabled". BTW,另一种攻击向量的方法是区分“已安装”和“已启用”。 Ie always install your packages globally, and then have each user tweak its package-load-list in order to disable specific packages. 即始终全局安装您的软件包,然后让每个用户调整其package-load-list以禁用特定软件包。

Finally any package whose mere installation&enabling (where "enabling" means to load the package's own -autoloads.el) ends up interfering with normal work is a bug (in my book), so yet another solution is to just install and enable all packages globally. 最后,任何仅仅安装和启用(其中“启用”意味着加载软件包自己的-autoloads.el)的软件包最终会干扰正常工作是一个错误(在我的书中),所以另一个解决方案是只在全局安装和启用所有软件包。 And if the C++-using-user gets annoyed by some ruby-related packages, then file a bug report to the maintainer of the ruby-related package. 如果C ++ - using-user被一些与ruby相关的包烦恼,那么就向ruby相关包的维护者提交一个bug报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM