0

UPD:我的操作系统是 Win7 64 位

尝试使用 M- 跳转到符号的定义时出现以下错误。

Searching for program: permission denied, unzip

谷歌在这个问题上对我帮助不大。有人可以指出我正确的方向吗?

这是我与clojure相关的配置部分:

;; clojure

(require 'clojure-mode)

(add-hook 'clojure-mode-hook
          (lambda ()
            (setq buffer-save-without-query t)))

;;command to align let statements
;;To use: M-x align-cljlet
(require 'align-cljlet)

(setq auto-mode-alist (append '(("\\.cljs$" . clojure-mode))
                              auto-mode-alist))

(dolist (x '(scheme emacs-lisp lisp clojure))
  (add-hook (intern (concat (symbol-name x) "-mode-hook")) 'rainbow-delimiters-mode))


;; nrepl

(require 'nrepl )

(defun live-windows-hide-eol ()
 "Do not show ^M in files containing mixed UNIX and DOS line endings."
 (interactive)
 (setq buffer-display-table (make-display-table))
 (aset buffer-display-table ?\^M []))


(when (eq system-type 'windows-nt)
  (add-hook 'nrepl-mode-hook 'live-windows-hide-eol ))

(add-hook 'nrepl-interaction-mode-hook
          (lambda ()
            (nrepl-turn-on-eldoc-mode)))

(add-hook 'nrepl-mode-hook
          (lambda ()
            (nrepl-turn-on-eldoc-mode)))


(setq nrepl-popup-stacktraces nil)
(setq nrepl-popup-stacktraces-in-repl nil)
(add-to-list 'same-window-buffer-names "*nrepl*")

;;Auto Complete
(require 'ac-nrepl )
(add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
(add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
(add-hook 'clojure-nrepl-mode-hook 'ac-nrepl-setup)

(eval-after-load "auto-complete"
  '(add-to-list 'ac-modes 'nrepl-mode))

;; specify the print length to be 100 to stop infinite sequences killing things.
(defun live-nrepl-set-print-length ()
  (nrepl-send-string-sync "(set! *print-length* 100)" "clojure.core"))

(add-hook 'nrepl-connected-hook 'live-nrepl-set-print-length)

;;; Windows M-. navigation fix
;(defun nrepl-jump-to-def (var)
;  "Jump to the definition of the var at point."
;  (let ((form (format "((clojure.core/juxt
;                         (comp (fn [s] (if (clojure.core/re-find #\"[Ww]indows\" (System/getProperty \"os.name\"))
;                                           (.replace s \"file:/\" \"file:\")
;                                           s))
;                               clojure.core/str
;                               clojure.java.io/resource :file)
;                         (comp clojure.core/str clojure.java.io/file :file) :line)
;                        (clojure.core/meta (clojure.core/ns-resolve '%s '%s)))"
;                      (nrepl-current-ns) var)))
;    (nrepl-send-string form
;                       (nrepl-jump-to-def-handler (current-buffer))
;                       (nrepl-current-ns)
;                       (nrepl-current-tooling-session))))

(setq nrepl-port "4555")
4

1 回答 1

3

问题很可能是您没有unzip安装。

如果您有 7-Zip,请将其在“程序文件”下的目录添加到您的 PATH 环境变量中。当我这样做并重新启动 Emacs 时,它会自动将其识别为unzip替代并正确配置自身(即变量archive-zip-extract设置为("7z" "x" "-so"))。

理想情况下,应该可以使用 Java 自己的jar程序来实现这一点,但显然它不支持将单个文件提取到标准输出,这是 Emacs 弧模式的工作方式。

于 2013-10-01T15:34:48.517 回答