Last active
December 23, 2015 02:49
-
-
Save toctan/6569170 to your computer and use it in GitHub Desktop.
Use emacsclient to open TextMate URL On Linux
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
[Desktop Entry] | |
Name=Emacs Client | |
GenericName=Text Editor | |
Comment=Edit text | |
MimeType=x-scheme-handler/txmt;x-scheme-handler/emacs | |
Exec=/bin/emacsclient.rb %u | |
Icon=emacs | |
Type=Application | |
Terminal=false | |
Categories=Development;TextEditor; | |
StartupWMClass=Emacs | |
NoDisplay=true |
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
#!/usr/bin/env ruby | |
ARGV[0].gsub('%2F', '/').match /\/{2}(\/[^?&]*)(&line=(\d+))?(&column=*(\d+))?/ do |m| | |
file = m[1] | |
line = m[3] || 1 | |
column = m[5] || 1 | |
`/usr/bin/emacsclient +#{line}:#{column} #{file}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment