From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: org-protocol firefox keybinding Date: Sat, 17 Oct 2009 21:28:17 +0100 Message-ID: <20091017202817.GG72276@yog-sothoth.mohorovi.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzFt8-0002V5-QQ for emacs-orgmode@gnu.org; Sat, 17 Oct 2009 16:28:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzFt4-0002RR-Bv for emacs-orgmode@gnu.org; Sat, 17 Oct 2009 16:28:30 -0400 Received: from [199.232.76.173] (port=59469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzFt4-0002RG-2K for emacs-orgmode@gnu.org; Sat, 17 Oct 2009 16:28:26 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:49390 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MzFt3-00046c-BA for emacs-orgmode@gnu.org; Sat, 17 Oct 2009 16:28:25 -0400 Received: from yog-sothoth.mohorovi.cc (localhost [127.0.0.1]) by yog-sothoth.mohorovi.cc (8.14.2/8.14.2) with ESMTP id n9HKSKYw092815 for ; Sat, 17 Oct 2009 21:28:20 +0100 (BST) (envelope-from ahktenzero@mohorovi.cc) Received: (from ahktenzero@localhost) by yog-sothoth.mohorovi.cc (8.14.2/8.14.2/Submit) id n9HKSHLa092814 for emacs-orgmode@gnu.org; Sat, 17 Oct 2009 21:28:17 +0100 (BST) (envelope-from ahktenzero@mohorovi.cc) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 -- |---|