Help us understand the problem. What is going on with this article?

explorerの右クリックメニューからemacsでファイルを開く

More than 1 year has passed since last update.

WindowsのExplorerの右クリックメニューからファイルやフォルダemacsでを開きたい。
Explorerのshell:sendtoフォルダにemacsのショートカットを作れば、右クリックの”送る”メニューにemacsが追加されるが、メニューをたどるのが面倒。

レジストリに右クリックメニューの設定を追加。

open_with_emacs.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\open_emacs]
@="emacs(&E)"
"Icon"="C:\\emacs\\bin\\emacsclientw.exe"

[HKEY_CLASSES_ROOT\*\shell\open_emacs\command]
@="C:\\emacs\\bin\\emacsclientw.exe -n -a C:\\emacs\\bin\\runemacs.exe \"%1\""

; [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\open_emacs]
; @="emacs(&E)"
; "Icon"="C:\\emacs\\bin\\emacsclientw.exe"

; [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\open_emacs\command]
; @="C:\\emacs\\bin\\emacsclientw.exe -n -a C:\\emacs\\bin\\runemacs.exe \"%1\""

[HKEY_CLASSES_ROOT\Folder\shell\open_emacs]
@="emacs(&E)"
"Icon"="C:\\emacs\\bin\\emacsclientw.exe"

[HKEY_CLASSES_ROOT\Folder\shell\open_emacs\command]
@="C:\\emacs\\bin\\emacsclientw.exe -n -a C:\\emacs\\bin\\runemacs.exe \"%1\""

[HKEY_CLASSES_ROOT\Directory\Background\shell\open_emacs]
@="emacs(&E)"
"Icon"="C:\\emacs\\bin\\emacsclientw.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\open_emacs\command]
@="C:\\emacs\\bin\\emacsclientw.exe -n -a C:\\emacs\\bin\\runemacs.exe \"%V/\""

設定を例えばopen_with_emacs.regファイルに保存し、emacsのパスを適切に編集して、そのファイルをダブルクリックすればレジストリに追加される。

emacs上でサーバーを動かしておく。

init.el
(server-start)

menu.png

参考
エクスプローラーの右クリックメニューをカスタマイズする
サーバーとしてのEmacsの使用

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away