I am trying to add Emacs in Windows 10 to a context menu (RMB), so that I right-click on a file and have an option to open a file in Emacs. I understand there exists "Open With" but in my case this doesn't work due to a little more complicated case.
Here's the reason: I run EmacsClient instead of Emacs, which utilises a server (service) in background. Consequently, core mods are loaded at startup and residue in memory to speed up opening application and only front user settings are used to open a window. For this, I created a shortcut to run Emacs as follows
"C:\Program Files\Emacs\emacs-29.4\bin\emacsclientw.exe" -c -a ""
If I add EmacsClinet in Open With, it only executes emacsclientw.exe without additional options -c and -a "", which are important.
I tried following some suggestions using Windows registry but they don't t work. Here's what I did so far
- Added a new key in
Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\calledEmacsand set its(Defalut)value toOpen with &Emacs - Added an additional value
Iconand set its value to a path to the existing icon:C:\Program Files\Emacs\emacs-29.4\bin\runemacs.exe - Added a new key in
Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Emacscalledcommandand set its(Default)value to"C:\Program Files\Emacs\emacs-29.4\bin\emacsclientw.exe" -c -a "" - I closed
regeditand restarted Windows Explorer.
At this point, I expected to have an additional entry under RMB, such as Open With EmacsClient, but it's not there. I did also restart a computer, but this also did not help. I read if entries in registry are incorrect, Windows does not show it under RMB. Could someone help what I am doing wrong? Thanks