Home About
macOS , Emacs , Wnn , Browser

Emacs EWW を試す

EWWというブラウザが Emacs には随分前からあるらしく、それを試すことにした。

eww with images

Emacs 29.1 のインストール

古めの Emacs は入れてあるのですが、 どうせなら最新を使おうということで、 emacs 29.1 を入れました。 環境は macOS Ventura 13.6.3 です。

過去の emacs インストール関連のエントリー

どうせなら新しい emacs で試そう。

https://www.gnu.org/software/emacs/download.htmlから emacs-29.1.tar.xz を選択してダウンロード。

$ xz -dv emacs-29.1.tar.xz
$ tar xf emacs-29.1.tar
$ cd emacs-29.1
$ ./autogen.sh

ここでエラー発生。autoconf がいるらしい。

Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65) ... missing

autoconf を homebrew なしでインストールするのは難しそうなので、ついにあきらめて homebrew を入れた。 (だったら、もはやソースから入れるとか面倒なことはしないで brew install emacs すればいいだけという話もある。)

$ brew install autoconf

再び do autogen.sh:

$ ./autogen.sh 
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65) ... ok
Your system has the required tools.
Running 'autoreconf -fi -I m4' ...
You can now run './configure'.

今度はエラーにならなかった。

いつも make install しても配置されなかったけど、 事前に autogen.sh したから その問題がなくなっているのではないかと期待して --prefix 指定して先に進む。

$ ./configure --prefix=$HOME/.local/emacs --without-x --without-mailutils --without-gnutls
$ make install

やはり、指定した $HOME/.loca/emacs には配置されない。

とはいえ ./nextstep/Emacs.app に成果物はできているので、これを手動で $HOME/.loca/Emacs.app に配置。

emacs とタイプしてターミナルから起動できるように $HOME/.bashrc に追記。

alias emacs="$HOME/.local/Emacs.app/Contents/MacOS/Emacs -nw"

EWW を試す

これを読もう:

使い方は emacs を起動して M-x して eww すればよい。 もし、現在のバッファのカーソル位置にURLが記述されていれば・・・たとえば、

https://osima.jp/

のようなテキストが入力してあるところにカーソルがある状態で M-x して eww すれば https://osima.jp/ をデフォルトに指定してくれる、次のように。

Enter URL or keywords (default https://osima.jp/):

エンターキーを入力して先に進む:

Package tls is deprecated

とミニバッファにメッセージが出て止まった。

よくわからないけれど、gnutls とか入れればいけるんじゃないか? シェルに戻り brew コマンドで gnutls を入れる。

$ brew install gnutls

そして emacs に戻り再度同じことをすると、 今度は次のようにあたらしいバッファに https://osima.jp/ を読み込まれてレンダリングされて表示された。

eww

これは便利。
冒頭の画像のようにターミナルで動く emacs ではなく、GUIでうごく emacs であれば、画像も表示される。

いままでこれなしで過ごしてきたとはね。

Liked some of this entry? Buy me a coffee, please.