应该是指 dash
package,这个貌似很常用的一个库,很多包都有这个依赖
我和你一样,已经很久了。一直没去管。话说我的启动报错好多啊。。
求教如何解决啊,我安装了dash还是没用诶,在package-list-packages,和init.el里都试过了
emacs --debug-init
再跑一边,贴详细日志,不要截图。
有可能是你缓存的包版本信息是旧的,跟实际安装的不一样。
twlz0ne:
再跑一边,贴详细日志,不要截图。
每次都是在terminal下打开的,不知道怎么copy诶。。。只能截图
能复制了。。。
Debugger entered–Lisp error: (void-variable spacemacs//init-company-json-mode)
(flycheck-mode spacemacs//init-company-json-mode company-mode)
(lambda nil (flycheck-mode spacemacs//init-company-json-mode company-mode))()
eval-after-load(flycheck (flycheck-mode spacemacs//init-company-json-mode company-mode))
ztlevi-programming/post-init-flycheck()
funcall(ztlevi-programming/post-init-flycheck)
(condition-case err (funcall (intern (format “%S/post-init-%S” layer pkg-name))) ((debug quote error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format (concat “\nAn error occurred while post-configuring %S " “in layer %S (error: %s)\n”) pkg-name layer err))))
(if (not (configuration-layer//package-enabled-p pkg layer)) (spacemacs-buffer/message (format " -> ignored post-init (%S)…” layer)) (spacemacs-buffer/message (format " -> post-init (%S)…" layer)) (condition-case err (funcall (intern (format “%S/post-init-%S” layer pkg-name))) ((debug quote error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format (concat “\nAn error occurred while post-configuring %S " “in layer %S (error: %s)\n”) pkg-name layer err)))))
(progn (if (not (configuration-layer//package-enabled-p pkg layer)) (spacemacs-buffer/message (format " -> ignored post-init (%S)…” layer)) (spacemacs-buffer/message (format " -> post-init (%S)…" layer)) (condition-case err (funcall (intern (format “%S/post-init-%S” layer pkg-name))) ((debug quote error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format (concat “\nAn error occurred while post-configuring %S " “in layer %S (error: %s)\n”) pkg-name layer err))))))
(if (configuration-layer/layer-usedp layer) (progn (if (not (configuration-layer//package-enabled-p pkg layer)) (spacemacs-buffer/message (format " -> ignored post-init (%S)…” layer)) (spacemacs-buffer/message (format " -> post-init (%S)…" layer)) (condition-case err (funcall (intern (format “%S/post-init-%S” layer pkg-name))) ((debug quote error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format (concat “\nAn error occurred while post-configuring %S " “in layer %S (error: %s)\n”) pkg-name layer err)))))))
(lambda (layer) (if (configuration-layer/layer-usedp layer) (progn (if (not (configuration-layer//package-enabled-p pkg layer)) (spacemacs-buffer/message (format " -> ignored post-init (%S)…” layer)) (spacemacs-buffer/message (format " -> post-init (%S)…" layer)) (condition-case err (funcall (intern (format “%S/post-init-%S” layer pkg-name))) ((debug quote error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format … pkg-name layer err))))))))(ztlevi-programming)
mapc((lambda (layer) (if (configuration-layer/layer-usedp layer) (progn (if (not (configuration-layer//package-enabled-p pkg layer)) (spacemacs-buffer/message (format " -> ignored post-init (%S)…" layer)) (spacemacs-buffer/message (format " -> post-init (%S)…" layer)) (condition-case err (funcall (intern (format “%S/post-init-%S” layer pkg-name))) ((debug quote error) (configuration-layer//increment-error-count) (spacemacs-buffer/append (format … pkg-name layer err)))))))) (ztlevi-programming zilongshanren-programming c-c++ emacs-lisp typescript lua ruby python javascript html react yaml php))
(let* ((pkg-name (eieio-oref pkg (quote :name))) (owner (car (eieio-oref pkg (quote :owners))))) (spacemacs-buffer/message (format “Configuring %S…” pkg-name)) (mapc (function (lambda (layer) (if (configuration-layer/layer-usedp layer) (progn (if (not …) (spacemacs-buffer/message …) (spacemacs-buffer/message …) (condition-case err … …)))))) (eieio-oref pkg (quote :pre-layers))) (spacemacs-buffer/message (format " -> init (%S)…" owner)) (funcall (intern (format “%S/init-%S” owner pkg-name))) (mapc (function (lambda (layer) (if (configuration-layer/layer-usedp layer) (progn (if (not …) (spacemacs-buffer/message …) (spacemacs-buffer/message …) (condition-case err … …)))))) (eieio-oref pkg (quote :post-layers))))
configuration-layer//configure-package([eieio-class-tag–cfgl-package flycheck nil (syntax-checking) nil (ztlevi-programming zilongshanren-programming c-c++ emacs-lisp typescript lua ruby python javascript html react yaml php) elpa t nil nil nil nil])
(cond ((eq (quote dotfile) (car (eieio-oref pkg (quote :owners)))) (spacemacs-buffer/message (format “%S is configured in the dotfile.” pkg-name))) (t (configuration-layer//configure-package pkg)))
(cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format “%S ignored since it can be lazily installed.” pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg (quote :protected)))) (spacemacs-buffer/message (format “%S ignored since it has been excluded.” pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format “%S ignored since it has no owner layer.” pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format “%S is toggled off.” pkg-name))) (t (let ((dir (configuration-layer/get-location-directory pkg-name (eieio-oref pkg (quote :location)) (car (eieio-oref pkg …))))) (if dir (progn (add-to-list (quote load-path) dir)))) (if (memq (eieio-oref pkg (quote :location)) (quote (local site built-in))) nil (configuration-layer//activate-package pkg-name)) (cond ((eq (quote dotfile) (car (eieio-oref pkg (quote :owners)))) (spacemacs-buffer/message (format “%S is configured in the dotfile.” pkg-name))) (t (configuration-layer//configure-package pkg)))))
(let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format “%S ignored since it can be lazily installed.” pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg (quote :protected)))) (spacemacs-buffer/message (format “%S ignored since it has been excluded.” pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format “%S ignored since it has no owner layer.” pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format “%S is toggled off.” pkg-name))) (t (let ((dir (configuration-layer/get-location-directory pkg-name (eieio-oref pkg …) (car …)))) (if dir (progn (add-to-list (quote load-path) dir)))) (if (memq (eieio-oref pkg (quote :location)) (quote (local site built-in))) nil (configuration-layer//activate-package pkg-name)) (cond ((eq (quote dotfile) (car (eieio-oref pkg …))) (spacemacs-buffer/message (format “%S is configured in the dotfile.” pkg-name))) (t (configuration-layer//configure-package pkg))))))
(while --dolist-tail-- (setq pkg-name (car --dolist-tail–)) (spacemacs-buffer/loading-animation) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format “%S ignored since it can be lazily installed.” pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg (quote :protected)))) (spacemacs-buffer/message (format “%S ignored since it has been excluded.” pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format “%S ignored since it has no owner layer.” pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format “%S is toggled off.” pkg-name))) (t (let ((dir (configuration-layer/get-location-directory pkg-name … …))) (if dir (progn (add-to-list … dir)))) (if (memq (eieio-oref pkg (quote :location)) (quote (local site built-in))) nil (configuration-layer//activate-package pkg-name)) (cond ((eq (quote dotfile) (car …)) (spacemacs-buffer/message (format “%S is configured in the dotfile.” pkg-name))) (t (configuration-layer//configure-package pkg)))))) (setq --dolist-tail-- (cdr --dolist-tail–)))
(let ((–dolist-tail-- packages) pkg-name) (while --dolist-tail-- (setq pkg-name (car --dolist-tail–)) (spacemacs-buffer/loading-animation) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format “%S ignored since it can be lazily installed.” pkg-name))) ((and (eieio-oref pkg (quote :excluded)) (not (eieio-oref pkg …))) (spacemacs-buffer/message (format “%S ignored since it has been excluded.” pkg-name))) ((null (eieio-oref pkg (quote :owners))) (spacemacs-buffer/message (format “%S ignored since it has no owner layer.” pkg-name))) ((not (cfgl-package-enabledp pkg)) (spacemacs-buffer/message (format “%S is toggled off.” pkg-name))) (t (let ((dir …)) (if dir (progn …))) (if (memq (eieio-oref pkg …) (quote …)) nil (configuration-layer//activate-package pkg-name)) (cond ((eq … …) (spacemacs-buffer/message …)) (t (configuration-layer//configure-package pkg)))))) (setq --dolist-tail-- (cdr --dolist-tail–))))
configuration-layer//configure-packages-2((4clojure abbrev ac-ispell ace-jump-helm-line ace-jump-mode ace-link ace-window adaptive-wrap aggressive-indent all-the-icons all-the-icons-dired anaconda-mode ansi-colors archive-mode auto-compile auto-complete auto-dictionary auto-highlight-symbol auto-yasnippet avy bookmark bracketed-paste bundler cc-mode centered-buffer-mode centered-cursor chruby cider cider-eval-sexp-fu clang-format clean-aindent-mode clj-refactor clojure-mode clojure-snippets cmake-font-lock cmake-mode coffee-mode color-identifiers-mode column-enforce-mode comint company company-anaconda company-c-headers company-glsl company-quickhelp company-restclient company-statistics company-tern company-web conf-mode …))
configuration-layer//configure-packages((4clojure abbrev ac-ispell ace-jump-helm-line ace-jump-mode ace-link ace-window adaptive-wrap aggressive-indent all-the-icons all-the-icons-dired anaconda-mode ansi-colors archive-mode async auto-compile auto-complete auto-dictionary auto-highlight-symbol auto-yasnippet avy bind-key bind-map bookmark bracketed-paste bundler cc-mode centered-buffer-mode centered-cursor chruby cider cider-eval-sexp-fu clang-format clean-aindent-mode clj-refactor clojure-mode clojure-snippets cmake-font-lock cmake-mode coffee-mode color-identifiers-mode column-enforce-mode comint company company-anaconda company-c-headers company-glsl company-quickhelp company-restclient company-statistics …))
configuration-layer/sync()
(if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat “Your version of Emacs (%s) is too old. " “Spacemacs requires Emacs version %s or above.”) emacs-version spacemacs-emacs-min-version) (load-file (concat (file-name-directory load-file-name) “core/core-load-paths.el”)) (require (quote core-spacemacs)) (spacemacs/init) (configuration-layer/sync) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (require (quote server)) (if (server-running-p) nil (server-start)))
eval-buffer(#<buffer load > nil “/Users/ztlevi/.emacs.d/init.el” nil t) ; Reading at buffer position 1264
load-with-code-conversion(”/Users/ztlevi/.emacs.d/init.el" “/Users/ztlevi/.emacs.d/init.el” t t)
load("/Users/ztlevi/.emacs.d/init" t t)
#0 “\205\266 \306=\203\307\310Q\202? \311=\204\307\312Q\202?\313\307\314\315#\203*\316\202?\313\307\314\317#\203>\320\321\322!D\nB\323\202?\316\324\325\324\211#\210\324=\203e\326\327\330\307\331Q!”\325\324\211#\210\324=\203d\210\203\247\332!\333\232\203\247\334!\211\335P\336!\203\201\211\202\214\336!\203\213\202\214\314\262\203\245\337“\203\243\340\341#\210\342\343!\210\266\f?\205\264\314\325\344\324\211#)\262\207” [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos “~” “/_emacs” windows-nt “/.emacs” directory-files nil “^\.emacs\(\.elc?\)?$” “~/.emacs” “^_emacs\(\.elc?\)?$” initialization format-message “_emacs' init file is deprecated, please use
.emacs’” “~/_emacs” t load expand-file-name “init” file-name-as-directory “/.emacs.d” file-name-extension “elc” file-name-sans-extension “.el” file-exists-p file-newer-than-file-p message “Warning: %s is newer than %s” sit-for 1 “default”] 7
command-line()
normal-top-level()
最好还是到 spacemacs 的 issue tracker 看看有没有类似的问题,没有的话你提交一个。
排错没有什么技巧,就是看错误提示。你这里出错的是:
spacemacs//init-company-json-mode
在 ~/.emacs.d 里面找,看它有没有定义、在哪里调用。不一定是真正的错误原因所在,但是你把它解决了就可以向前一步。
ztlevi
2017 年3 月 25 日 04:00
10
好像是我自己的配置有问题,在这里:
(defun ztlevi-programming/post-init-flycheck()
(eval-after-load 'flycheck
(progn
;; use web-mode for .jsx files
(add-to-list 'auto-mode-alist '("\\.jsx$" . web-mode))
;; disable jshint since we prefer eslint checking
(setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers
'(javascript-jshint)))
;; use eslint with web-mode for jsx files
(flycheck-add-mode 'javascript-eslint 'web-mode)
;; customize flycheck temp file prefix
(setq-default flycheck-temp-prefix ".flycheck")
;; disable json-jsonlist checking for json files
(setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers
'(json-jsonlist)))
;; https://github.com/purcell/exec-path-from-shell
;; only need exec-path-from-shell on OSX
;; this hopefully sets up path and other vars better
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
;; for better jsx syntax-highlighting in web-mode
;; - courtesy of Patrick @halbtuerke
(defadvice web-mode-highlight-part (around tweak-jsx activate)
(if (equal web-mode-content-type "jsx")
(let ((web-mode-enable-part-face nil))
ad-do-it)
ad-do-it))
;; c++
(add-hook 'c++-mode-hook (lambda () (setq flycheck-gcc-language-standard "c++11")))
;; Enable for other modes
(add-hook 'c++-mode-hook 'flycheck-mode)
(add-hook 'web-mode-hook 'flycheck-mode)
;; (add-hook 'json-mode-hook 'flycheck-mode)
))
)
去掉这个配置就不会报错了,然后把(add-hook json-mode-hook ‘flycheck-mode)去掉,就变成下面的报错了。
Debugger entered–Lisp error: (void-variable turn-on-evil-matchit-mode)
(flycheck-mode turn-on-evil-matchit-mode emmet-mode drupal-mode-bootstrap spacemacs//init-company-web-mode spacemacs//init-company-vars-web-mode company-mode)
(lambda nil (flycheck-mode turn-on-evil-matchit-mode emmet-mode drupal-mode-bootstrap spacemacs//init-company-web-mode spacemacs//init-company-vars-web-mode company-mode))()
eval-after-load(flycheck (flycheck-mode turn-on-evil-matchit-mode emmet-mode drupal-mode-bootstrap spacemacs//init-company-web-mode spacemacs//init-company-vars-web-mode company-mode))
ztlevi-programming/post-init-flycheck()
funcall(ztlevi-programming/post-init-flycheck)
ztlevi
2017 年3 月 25 日 15:09
11
求教下下面这段代码应该放在那里
;; c++
(add-hook 'c++-mode-hook (lambda () (setq flycheck-gcc-language-standard "c++11")))
;; Enable for other modes
(add-hook 'c++-mode-hook 'flycheck-mode)
(add-hook 'web-mode-hook 'flycheck-mode)
;; (add-hook 'json-mode-hook 'flycheck-mode)
))
我放在ztlevi-programming layer里的config.el,并没有生效,post-init-flycheck里也不行,只有init.el里才可以。。求教为什么啊,。。
ztlevi
2017 年3 月 26 日 17:04
13
twlz0ne:
的了解一下它的加
对对,我一开始没注意这个,后面发现应该是放到config.el或者package.el里面都行,测试的时候we b-mode启动有问题,所以一直不成功,但其实json-mode和c+±mode都成功了。
我先在的web-mode 启动不了,启动时候弹出错误。
对于web-mode,我把(add-hook 'web-mode-hook 'flycheck-mode)
加到intel.el里面是可以在启动web-mode(虽然是无法启动的)的时候默认启动flycheck-mode的,但是加到自己配置的layer的config.el里就不行了,我看了一下emacs启动时候的调用,init.el是在一开始就调用了,文档里说:dotspacemacs/user-init is called immediately after dotspacemacs/init, before layer configuration. 求教为什么我写在dotspacemacs/user-init()里面的(add-hook 'web-mode-hook 'flycheck-mode)
生效了呢。。
谢谢啦
ztlevi
2017 年3 月 26 日 18:30
14
不好意思啊,搞了半天web-mode的问题,重启了一下机子就没有了。。。。mac不怎么重启,除非实在想要重启。。rip