0

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\ called Emacs and set its (Defalut) value to Open with &Emacs
  • Added an additional value Icon and 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\Emacs called command and set its (Default) value to "C:\Program Files\Emacs\emacs-29.4\bin\emacsclientw.exe" -c -a ""
  • I closed regedit and 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

Celdor
  • 732

1 Answers1

1

The registry key you provided is for directories.

For files, you use its extension or the * to match any extension, which is what you want.

You mentioned you needed to add %V too so it knows what file you clicked. I thought %1 would also work, and not sure what %V stands for.

LPChip
  • 66,193