Created
November 29, 2020 22:44
-
-
Save AloisJanicek/942b93feb7ca3683ce666c913ce56672 to your computer and use it in GitHub Desktop.
Org-protocol setup with emacs inside WSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REGEDIT4 | |
[HKEY_CLASSES_ROOT\org-protocol] | |
@="URL:Org Protocol" | |
"URL Protocol"="" | |
[HKEY_CLASSES_ROOT\org-protocol\shell] | |
[HKEY_CLASSES_ROOT\org-protocol\shell\open] | |
[HKEY_CLASSES_ROOT\org-protocol\shell\open\command] | |
@="\"C:\\BIN\\org-protocol-to-wsl-helper.bat\" \"%1\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
@REM C:\BIN\org-protocol-to-wsl-helper.bat | |
@REM Genie example https://github.com/arkane-systems/genie | |
@REM wsl.exe genie -c "/usr/bin/bash --login emacsclient" %1 | |
@REM Default WSL distribution example | |
wsl.exe emacsclient %1 |
REM is short for REMARK. I believe it comes from the original Dartmouth BASIC. All of the microcomputer BASICs I used back in the 80s used it for comments, and since knowledge of BASIC was fairly widespread back then it made sense for Microsoft to use it for commenting batch files.
The @ just turns off echo for that line. Since your first line is @echo off
, you probably don't need it for the REM statements.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming you have working emacs setup on WSL.
If not, this blogpost called The Ultimate Emacs Hacking Tutorial in Windows 10 WSL 2 (archive.is) by DAMON CHAN is an excellent resource
org-protocol-to-wsl-helper.bat
asC:\BIN\org-protocol-to-wsl-helper.bat
org-protocol-to-wsl-emacs.reg
and run it (double-click) if you trust me. As you should not trust me, alternatively registerorg-protocol
protocol in Windows manually using tutorial from README of sprig/org-capture-extension(note:
@REM
are comments in.bat
files, weird, I know)