From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Frequently used files/headings Date: Thu, 6 May 2010 02:06:56 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9xoC-0001M6-M0 for emacs-orgmode@gnu.org; Thu, 06 May 2010 05:55:56 -0400 Received: from [140.186.70.92] (port=50120 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9xoB-0001K2-3a for emacs-orgmode@gnu.org; Thu, 06 May 2010 05:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9xo9-000665-Ai for emacs-orgmode@gnu.org; Thu, 06 May 2010 05:55:54 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:35363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9vAh-0000Z7-Jg for emacs-orgmode@gnu.org; Thu, 06 May 2010 03:07:00 -0400 Received: by wyb33 with SMTP id 33so2144411wyb.0 for ; Thu, 06 May 2010 00:06:57 -0700 (PDT) In-Reply-To: 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 On Thu, Apr 29, 2010 at 10:47 AM, Nathan Neff wrote= : > Currently, I'm using org-id-get-create to generate a unique ID > for headings that I frequently go to in org-mode. > > * Foo > :PROPERTIES: > :ID: F3B14102-A66D-408C-8833-1F9CF7E5047C > :END: > > Then, I copy the newly created ID to the kill-ring, > and paste it into a block like this: > > (global-set-key (kbd " f") (lambda () "Goto Foo Org File" > =A0 =A0(interactive) > =A0 =A0(org-id-goto "F3B14102-A66D-408C-8833-1F9CF7E5047C"))) > > This will map F6-f to jump to Foo. > > I know that there are many ways to navigate org-files, but using the > ID is great because it requires only two keystrokes. > > This works pretty good, except I'd like to improve three things: > > 1) =A0I'd like to be able to see a menu of where I've mapped my shortcuts > 2) =A0I'd like to simplify the creation of these IDs and shortcut keys. > 3) =A0I have about 10 quick-keys now, so I have 30 lines of very similar = code > > I'm sensing an org-babel type approach where I could define an org-mode > table like this: > > | Name | Key =A0 =A0 =A0 | ID | > | Foo =A0 =A0| " f" =A0| 123456779 | > > Then, I could loop through the table, and for each row, I could > run this code: > > (global-set-key (kbd ) (lambda () > =A0 =A0(interactive) > =A0 =A0(org-id-goto ))) > I've made some progress on this, and I've defined a table like this: #+tblname:navigation-shortcuts | Foo Org File | | 733BD03F-0938-432F-B59A-BE235A2DE7E2 | | Bar Org File | | 123456 | I would like to map a function that iterates over the items in the table, and maps the keyboard string in column 2 to the ID in column 3. I tried something like this, but all I get is "Wrong type argument: integer-or-marker-p, (quote (second shortcut-def))" #+srcname: map-nav(navigation-shortcuts=3Dnavigation-shortcuts) #+begin_src emacs-lisp (defun map-navigation-shortcuts (shortcut-def) (global-set-key (kbd (second shortcut-def)) (lambda () "Goto Foo Org File" (interactive) (org-id-goto '(third shortcut-def))))) (mapcar #'map-navigation-shortcuts navigation-shortcuts) #+end_src Can anyone point out where I'm going wrong? Thanks, --Nate