Skip to content

Instantly share code, notes, and snippets.

@toctan
Last active December 23, 2015 02:49
Show Gist options
  • Save toctan/6569170 to your computer and use it in GitHub Desktop.
Save toctan/6569170 to your computer and use it in GitHub Desktop.
Use emacsclient to open TextMate URL On Linux
[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
#!/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