Question

UPD: My OS is Win7 64 bit

I'm getting the following error when trying to jump to symbol's definition with M-.

Searching for program: permission denied, unzip

Google doesn't help me much with that issue. Can somebody point me to the right direction?

here is the part of my config related to 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")
Was it helpful?

Solution

The problem is most likely that you don't have unzip installed.

If you have 7-Zip, add its directory under "Program Files" to your PATH environment variable. When I did that and restarted Emacs, it automatically recognized it as unzip alternative and configured itself correctly (i.e. the variable archive-zip-extract was set to ("7z" "x" "-so")).

Ideally, it should be possible to use Java's own jar program for this, but apparently it doesn't support extracting individual files to stdout which is the way Emacs' arc-mode works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top