emacs,nrepl,M-。 (nrepl-jump):搜索程序:权限被拒绝,解压缩

时间:2013-10-01 12:34:42

标签: emacs clojure file-permissions nrepl

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

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

Searching for program: permission denied, unzip

Google对这个问题没什么帮助。有人能指出我正确的方向吗?

这是我的配置与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")

1 个答案:

答案 0 :(得分:3)

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

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

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