LoginSignup
5
6

More than 5 years have passed since last update.

firefoxで表示しているページをemacsで表示する

Last updated at Posted at 2016-05-27

たとえばfirefoxでブラウジング中にemacsのコードの断片を見つけて、ちょっと試してみようと思ったときに、そのwebページをemacsで表示して、コードの部分を選択して、M-x eval-regionできれば簡単。
たとえばfirefoxでブラウジング中に誤って英語のサイトを開いてしまい、仕方なくemacs上でGoogle翻訳を使って読もうと思ったときに。

firefoxにadd on Open With をインストール。
open withの設定
名前 w3m
コマンド ....\emacs\bin\emacsclientw.exe linuxでもemacsclientのパスを設定
引数 -a emacs -n --eval "(w3m-goto-url \"%s\"))"

または
名前 eww
コマンド ....\emacs\bin\emacsclientw.exe
引数 -a emacs -n --eval "(eww \"%s\"))""

emacsの設定
ewwやemacs-w3mがなければインストール。
windowsの場合、w3m.exeのバイナリはCygwinのw3mパッケージにある。またはw3m for windowsにもある。

.emacs
(server-start)

firefoxの表示しているページで右クリック→アプリで開く→w3mまたはewwを選択。
emacs上にwebページが表示される。

逆にemacs-w3mで表示しているwebページを別のブラウザ(Firefox)で開くには、M (w3m-view-url-with-browse-url)をタイプ。
ewwでは& (eww-browse-with-external-browser)をタイプ。

5
6
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
5
6