[Orgmode] Re: Easily go to some frequently accessed heading (narrowed to region)

2011-02-05 Thread Bernt Hansen
Darlan Cavalcante Moreira darc...@gmail.com 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 f9 m) 'bh/clock-in-read-mail-and-news-task)
(global-set-key (kbd f9 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

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Easily go to some frequently accessed heading (narrowed to region)

2011-02-03 Thread Sébastien Vauban
Hi Alan,

Alan E. Davis wrote:
 I adapted something from Sacha Chua: a file with links to my most
 frequently accessed links.  I too have been seeking some way to make
 this automatic, but even as it is, it works great.

 I call the file Pointers.org.

 It is just an org-mode file, each headline is a  link.

 Then, in my init file (.emacs) is the following:

 ,
 | (defun pointers ()
 |   (interactive)
 |   (find-file ~/org/Pointers.org))
 | (define-key global-map \C-c0 'pointers)
 `

 It's not too hard to install a new link at the top of the file.  I guess
 it would also be easy to write a function or use a capture template to
 do this.

It could be interesting to look at Emacs bookmarks (C-x r l), and maybe see
how to come up with an org-bookmarks that would take the best of both worlds.
Just an idea...

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode