From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Easily go to some frequently accessed heading (narrowed to region) Date: Sat, 05 Feb 2011 12:57:59 -0500 Message-ID: <8762sy749k.fsf@norang.ca> References: <4d487c86.5043ec0a.55ad.ffffaf99@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=51719 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlmOZ-0003Br-Vy for emacs-orgmode@gnu.org; Sat, 05 Feb 2011 12:58:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlmOZ-0005uD-7H for emacs-orgmode@gnu.org; Sat, 05 Feb 2011 12:58:04 -0500 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:46553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlmOZ-0005u3-4N for emacs-orgmode@gnu.org; Sat, 05 Feb 2011 12:58:03 -0500 In-Reply-To: <4d487c86.5043ec0a.55ad.ffffaf99@mx.google.com> (Darlan Cavalcante Moreira's message of "Tue, 01 Feb 2011 18:34:58 -0300") 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: Darlan Cavalcante Moreira Cc: Orgmode Mailing List Darlan Cavalcante Moreira writes: > Hello, > > I have a main .org file where I put almost everything. There is a > "Projects" headline where each subheading is a different project. During > the day I need to go to the Projects headline and open one of the its > subheadings when I want and add/read something in that project. I know I > can use a capture template to add something to one of the projects, but > that does not work (or does it?) when I just want to read or modify > something. > > Does anyone has some function to easily jump to a specific headline as well > as narrowing to that headline? What I have in mind is some function that > switches to a specific headline, call org-tree-to-indirect-buffer and > rename the buffer to the headline title (if the buffer already exists just > switch to it). In this way I could bind keys to easily go to the most > common projects. The holy grail would be something similar to the agenda > that would present me with the different projects. Hi Darlan, I'm a little late into this discussion but I used to use a function to clock in specific tasks based on id. Just generate a unique id for the task you want and it should be trivial to map it to a key to jump directly to that task. Just use org-id-goto with the id of the task and narrow as required. Below is my function to clock in a task by id. --8<---------------cut here---------------start------------->8--- (defun bh/clock-in-task-by-id (id) "Clock in a task by id" (save-restriction (widen) (org-with-point-at (org-id-find id 'marker) (org-clock-in nil)))) --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- * Some Project ** Some Task :PROPERTIES: :ID: w003j861fue0 :END: * Next project --8<---------------cut here---------------end--------------->8--- M-x org-id-goto w003j861fue0 RET I just hardcoded the IDs into my define key functions to get to the task required. --8<---------------cut here---------------start------------->8--- (global-set-key (kbd " m") 'bh/clock-in-read-mail-and-news-task) (global-set-key (kbd " o") 'bh/clock-in-organization-task) (defun bh/clock-in-organization-task () (interactive) (bh/clock-in-task-by-id "437c2cde-fbf0-491f-92ba-51bae487b338")) (defun bh/clock-in-read-mail-and-news-task () (interactive) (bh/clock-in-task-by-id "85c2e69b-6f37-4236-8896-4f7dd86047c1")) --8<---------------cut here---------------end--------------->8--- HTH, Bernt