LoginSignup
0
0

More than 3 years have passed since last update.

Windows10上のSpacemacsでunzipを使う(外部ライブラリへ定義ジャンプしたい)

Last updated at Posted at 2020-02-11

概要

Windows10上のSpacemacsで外部ライブラリに定義ジャンプ ( Space g gとか)しようとすると、以下のエラーが出る。

apply: Searching for program: No such file or directory, unzip

unzipなるものが見つからないと言われている。

この手のエラーは、Windowsに該当するパッケージをインストールすると、ふつうは解決する。実際によく似た質問もあった。
Emacs work with archive. What is the best package?

unzipをインストールしたのに見つからない

しかし、MSYS2で unzipをインストールしたのに C:\msys64\mingw64\bin 下に unzipがなかった。

MSYS2で確認してみると、確かにインストールされているはず。

$ pacman -Ss unzip
mingw32/mingw-w64-i686-perl 5.28.0-1
    A highly capable, feature-rich programming language (mingw-w64)
mingw32/mingw-w64-i686-quazip 0.8.1-1
    C++ wrapper for the Gilles Vollant's ZIP/UNZIP C package (mingw-w64)
mingw64/mingw-w64-x86_64-perl 5.28.0-1
    A highly capable, feature-rich programming language (mingw-w64)
mingw64/mingw-w64-x86_64-quazip 0.8.1-1
    C++ wrapper for the Gilles Vollant's ZIP/UNZIP C package (mingw-w64)
msys/unzip 6.0-2 (compression) [インストール済み]
    Unpacks .zip archives such as those made by PKZIP

パッケージのインストール場所が違っていた

よく見るとpacmanの結果では msys/unzipと表示されている。

もしやと思って探すと C:\msys64\usr\bin下に unzipを見つけた。

Spacemacs側では C:\msys64\mingw64\binのほう (Hunspellとかが入っていた)を実行パスに加えていたので、 No such file or directoryと言われていた。

これを解決するため、Spacemacsに実行パス C:\msys64\usr\binも指定する。

.spacemacs ( Space f e d)の user-init()内に追記する。

(defun dotspacemacs/user-init ()
  "Initialization for user code:
This function is called immediately after `dotspacemacs/init', before layer
configuration.
It is mostly for variables that should be set before packages are loaded.
If you are unsure, try setting them in `dotspacemacs/user-config' first."

  ;; MSYS2経由でインストールしたパッケージを使う
  (add-to-list 'exec-path "C:\\msys64\\mingw64\\bin")
  (add-to-list 'exec-path "C:\\msys64\\usr\\bin") ; unzipとか
  )

あまり関係ないが、「 exec-pathを追加しろよな!」という話をこちらで見つけて、改めて見直したことが解決の糸口となった。
How to get emacs Zip-Archive mode to work on Windows

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0