我在我的init.el
里添加了自定义custom-file
的设置,如下
(setq custom-file (expand-file-name "custom.el" dotspacemacs-directory))
(load custom-file)
自从升级到25.1之后每当要安装新的package的时候emacs都会在我的init.el
后面
加入下面的code (我把package列表用...
代替了):
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(...))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
请问大家有没有遇到这样的情况?我用的是spacemacs的master版本,不是develop版本,
会不会与这个有关?
是不是你没有custom.el,建立一个custom.el把下面的那些内容移动过去,就不会再生成了。
我已经设置了custom-file
,custom的设置也是会更新到这个文件里的。不过更新的25.1后有一部分的custom信息,比如package-selected-packages
会被添加回init.el,其余的信息依然会更新到我的custom.el文件里。
你这个可能是因为package.el那边的问题。在init.el加一句
;; (package-initialize)
我查了一下,这行code已经在"~/.emacs.d/init.el"
里存在了。spacemacs的用户自定义的init.el存放在"~/.spacemacs.d/init.el"
里。我还要再加一遍吗?不过我先试试看吧,虽然这个情况时有时无,不好reproduce。
我也有这情况,好像是在paradox-list-packages中升级包后出现的。
我是在.emacs 下面开头总是出现[quote=“jiegec, post:5, topic:1262”]
;; (package-initialize)
[/quote]
好像是在home变量目录下的.emacs里没有这句所以一直添加 我添加后就没在重复了
hjking
2016 年10 月 8 日 02:14
11
我也有这个问题,还以为是emacs 25更新带来的
解决了,custom-file
变量应该在dotspacemcs/user-init
里设置:
opened 10:03AM - 17 Oct 16 UTC
closed 10:28AM - 17 Oct 16 UTC
Question
- Forum -
I store the code generated by Custom in a dedicated file `"custom.el"` to keep m… y spacemacs config tidy, at the end of `dotspacemacs/user-config`:
``` elisp
(defun dotspacemacs/user-config ()
(setq custom-file (expand-file-name "custom.el" dotspacemacs-directory))
(load custom-file))
```
However since I upgrade my Emacs to 25.1 and each time I install new packages, there is a specific portion of custom information spawning in my `".spacemacs"` or `"init.el"`, like (I removed the comment lines):
``` elisp
(custom-set-variables
'(package-selected-packages
(quote
(NEW-PACKAGES OLD-PACKAGES...))))
(custom-set-faces
)
```
where `NEW-PACKAGES` are the new packages that I installed this time.
In my `"custom.el"` there is also a similar part for `package-selected-packages` containing only `OLD-PACKAGES`, and other parts of the custom code.
How do I let `package-selected-packages` be updated in `"custom.el"` instead of spawning in my config file?