emacs初始化和更新emacs包 [英] emacs initialization and updating emacs packages
问题描述
我通过将特定路径加载到更新的emacs(workgroups2)包中,可能是我的.emacs文件中最重要的emacs包规则。所以,每当一个新版本发布,升级时,我必须编辑我的emacs文件(这是下面的第一行)。
以下是相关部分我的emacs文件如何加载,而不添加特定路径?让我知道你有什么其他建议,谢谢!
要清楚我们正在考虑的一行:(add-to-list'load -path〜/ .emacs.d / elpa / workgroups2-20130915.1509)
(add -to-list'load-path〜/ .emacs.d / elpa / workgroups2-20130915.1509)
(require'workgroups2)
(setq package-enable-at-startup nil)
(package-initialize)
(desktop-save-mode nil);保存所有打开的文件(或禁用它)
(setq wg-prefix-key(kbdCc w)
wg-restore-associated-buffers t;还原在此工作组中打开的所有缓冲区
wg-use-default-session-file t;关闭emacs --daemon
wg-default-session-file〜/ .emacs.d / emacs_def.wg
wg -use-faces nil
wg-morph-on nil);动画关闭
;;键盘快捷键 - 加载,保存,切换
(全局设置密钥(kbd< pause>)'wg-reload-session)
(全局设置密钥(kbdCS- ; wg-save-session)
(全局设置密钥(kbdsz)'wg-switch-to-workgroup)
(全局设置密钥(kbd s- /)'wg-switch-to-previous-workgroup)
(workgroups-mode 1);激活工作组
编辑:如果我注释掉这行,这是什么调试器给我:
调试器输入 - Lisp错误:(文件错误无法打开加载文件工作组2)
require(workgroups2)
eval-buffer(#< buffer * load *> nil/home/d2b2/.emacs.d/init.elnil t);读缓冲区位置6014
load-with-code-conversion(/ home / d2b2 / .emacs.d / init.el/home/d2b2/.emacs.d/init.eltt)
load(/ home / d2b2 / .emacs.d / inittt)
#[0^ H \205\262 ^ @ \306 = \203 ^ Q ^ @ \\ \\ 307 ^ H \310Q \202; ^ @ \311 = \204 ^^^ @ \307 ^ H \312Q \202; ^ @ \313\307\314\315 #\203 * ^ @ \316\202; ^ @#\313\307\314\317 \203:^ @ ^ \320\\\
B R\321\202; ^ @ \316\ $
command-line()
normal-top-level()
编辑:现在注释两行,我们有以下错误:
调试器输入 - Lisp错误:(错误:END:在位置186缺少行)
信号(错误(:END:在位置186缺少行)
错误(:END :在位置%s缺少的行186
org-flag-drawer(t)
org-cycle-hide-drawers(all)
org-set-startup-visibility()
org-mode()
desktop-restore-file-buffer(/ home / d2b2 / .todo.todonil)
#[nil^ H \236A\206 ^ H ^ @ \305\ [desktop-buffer-major-mode desktop-buffer-mode-handlers desktop-buffer-file-name desktop-buffer-name desktop-buffer-misc deskt $
desktop- create-buffer(206/home/d2b2/.todo.todoorg-mode(workgroups-mode)1(nil nil)nil((buffer-file-coding-system)未定义的unix)(truncate-lines。t)))
eval-buffer(#< buffer * load *> nil/home/d2b2/.emacs.desktopnil t);在缓冲位置读取813
加载代码转换(/ home / d2b2 / .emacs.desktop/home/d2b2/.emacs.desktoptt)
load(/ home /d2b2/.emacs.desktopttt)
desktop-read()
#[nil\304\211 ^ X \235\203 ^ O ^ @ \305 ^ H \^ Q \306 ^ R)\\\
\205 ^ Z ^ @ \307 \210\310\211 ^ S \207[key command-line-args desktop-save-模式禁止启动屏幕--no-desktop$
run-hooks(after-init-hook)
command-line()
normal-top-level()
确保包目录-list
包含您的路径elpa 〜/ .emacs.d / elpa
。
然后 package.el
初始化一些包,它将包的名称添加到
package-activated-list
并自动将包$目录
(例如〜/ .emacs.d / elpa / workgroups2-20130915.1509)推送到 load-path
。
对我来说像往常一样工作,我不会手动添加任何特定的软件包。
我的配置中 package-enable-at-startup
的值为 t
。
package-enable-at-startup doc:
是否在Emacs启动时激活已安装的软件包...如果
值 package-enable-at-startup
为零,您可以随时键入 Mx
激活包系统。
package-initialize
(require'workgroups2)
在配置中的包初始化之前,尝试将其移动到下面。 p>
I am violating probably the most essential emacs package rule in my .emacs file by loading a specific path to an emacs (workgroups2) package which gets updated. So, everytime a new version is released and when I upgrade I have to edit my emacs file (this is the first line below).
The following is the relevant section of my emacs file. How can I load this without adding a specific path? Let me know what other suggestions you have and thanks!
To be clear the line we are considering is: (add-to-list 'load-path "~/.emacs.d/elpa/workgroups2-20130915.1509")
(add-to-list 'load-path "~/.emacs.d/elpa/workgroups2-20130915.1509")
(require 'workgroups2)
(setq package-enable-at-startup nil)
(package-initialize)
(desktop-save-mode nil) ; save all opened files (or disable it)
(setq wg-prefix-key (kbd "C-c w")
wg-restore-associated-buffers t ; restore all buffers opened in this WG?
wg-use-default-session-file t ; turn off for "emacs --daemon"
wg-default-session-file "~/.emacs.d/emacs_def.wg"
wg-use-faces nil
wg-morph-on nil) ; animation off
;; Keyboard shortcuts - load, save, switch
(global-set-key (kbd "<pause>") 'wg-reload-session)
(global-set-key (kbd "C-S-<pause>") 'wg-save-session)
(global-set-key (kbd "s-z") 'wg-switch-to-workgroup)
(global-set-key (kbd "s-/") 'wg-switch-to-previous-workgroup)
(workgroups-mode 1) ; Activate workgroups
EDIT: If I comment out that line, this is what the debugger gives me:
Debugger entered--Lisp error: (file-error "Cannot open load file" "workgroups2")
require(workgroups2)
eval-buffer(#<buffer *load*> nil "/home/d2b2/.emacs.d/init.el" nil t) ; Reading at buffer position 6014
load-with-code-conversion("/home/d2b2/.emacs.d/init.el" "/home/d2b2/.emacs.d/init.el" t t)
load("/home/d2b2/.emacs.d/init" t t)
#[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313\307\314\317#\203:^@\320\nB^R\321\202;^@\316\$
command-line()
normal-top-level()
EDIT: Now commenting out both lines we have the following errors:
Debugger entered--Lisp error: (error ":END: line missing at position 186")
signal(error (":END: line missing at position 186"))
error(":END: line missing at position %s" 186)
org-flag-drawer(t)
org-cycle-hide-drawers(all)
org-set-startup-visibility()
org-mode()
desktop-restore-file-buffer("/home/d2b2/.todo" ".todo" nil)
#[nil "^H \236A\206^H^@\305\n^K\f#\207" [desktop-buffer-major-mode desktop-buffer-mode-handlers desktop-buffer-file-name desktop-buffer-name desktop-buffer-misc deskt$
desktop-create-buffer(206 "/home/d2b2/.todo" ".todo" org-mode (workgroups-mode) 1 (nil nil) nil nil ((buffer-file-coding-system . undecided-unix) (truncate-lines . t)))
eval-buffer(#<buffer *load*> nil "/home/d2b2/.emacs.desktop" nil t) ; Reading at buffer position 813
load-with-code-conversion("/home/d2b2/.emacs.desktop" "/home/d2b2/.emacs.desktop" t t)
load("/home/d2b2/.emacs.desktop" t t t)
desktop-read()
#[nil "\304\211^X \235\203^O^@\305^H \"^Q\306^R)\n\205^Z^@\307 \210\310\211^S\207" [key command-line-args desktop-save-mode inhibit-startup-screen "--no-desktop"$
run-hooks(after-init-hook)
command-line()
normal-top-level()
Make sure, that package-directory-list
includes your path to elpa ~/.emacs.d/elpa
.
Then package.el
initializes some package, it adds name of package to
package-activated-list
and pushes package directory
(e.g. ~/.emacs.d/elpa/workgroups2-20130915.1509) to load-path
automatically.
For me it works as usual, I don't add any specific pathes for packages manually.
The value of package-enable-at-startup
is t
in my config.
package-enable-at-startup doc:
"Whether to activate installed packages when Emacs starts...If the
value of package-enable-at-startup
is nil, you can type M-x
package-initialize
to activate the package system at any time."
(require 'workgroups2)
is before package initialization in your config, try to move it below.
这篇关于emacs初始化和更新emacs包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!