emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James TD Smith <ahktenzero@mohorovi.cc>
To: emacs-orgmode@gnu.org
Subject: org-protocol firefox keybinding
Date: Sat, 17 Oct 2009 21:28:17 +0100	[thread overview]
Message-ID: <20091017202817.GG72276@yog-sothoth.mohorovi.cc> (raw)

I was cleaning out my Firefox tabs, using org-protocol to drop links into my org
buffers, when it occured to me that having keybindings for the store link and
remember functions would be quicker than clicking on the bookmarklets. I use a
Firefox plugin called keyconfig which lets you change the keybindings and add
new ones, so after a bit of Javascript hacking I managed to get some keybindings
working. Here's how to do it:

Install keyconfig from http://mozilla.dorando.at/keyconfig.xpi.

Open the keyconfig dialog by going to Tools and then Keyconfig.

Click the 'Add a new Key' button. Enter "Org store link" as the name.
Enter the following in the box with /* CODE */ in it:

--8<---------------cut here---------------start------------->8---
var orgProtoString = 'org-protocol://store-link://'+
  encodeURIComponent(gBrowser.currentURI.spec) + '/' +
  encodeURIComponent(gBrowser.contentWindow.title) + '/' +
  encodeURIComponent(window.getSelection());

gBrowser.loadURI(orgProtoString);
--8<---------------cut here---------------end--------------->8---

Click OK. You will then need to bind a key by clicking in the box next to the
'Apply' button and pressing whatever key combination you want. Click 'Apply' to
store the keybinding.

Repeat the steps, but call the next key "Org remember" and use the code below:

--8<---------------cut here---------------start------------->8---
var orgProtoString = 'org-protocol://remember://'+
  encodeURIComponent(gBrowser.currentURI.spec) + '/' +
  encodeURIComponent(gBrowser.contentWindow.title) + '/' +
  encodeURIComponent(window.getSelection());

gBrowser.loadURI(orgProtoString);
--8<---------------cut here---------------end--------------->8---

Click Close, then OK, and then restart Firefox. You should then be able to
access the org-protocol functions with your chosen keys.

I've added a section to the Worg page for org-protocol with the instructions.

James

--
|-<James TD Smith>-<email/ahktenzero@mohorovi.cc>-|

             reply	other threads:[~2009-10-17 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-17 20:28 James TD Smith [this message]
2009-10-18  6:37 ` org-protocol firefox keybinding Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091017202817.GG72276@yog-sothoth.mohorovi.cc \
    --to=ahktenzero@mohorovi.cc \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).