Re: [O] Feature request: two-letter combination for org-capture

2011-06-07 Thread Darlan Cavalcante Moreira

Thank you Sebastien,
This works perfectly.

--
Darlan

At Tue, 07 Jun 2011 23:53:59 +0200,
"Sebastien Vauban"  wrote:
> 
> Hi Darlan,
> 
> Darlan Cavalcante Moreira wrote:
> > A nice feature of the org-agenda is the possibility to define two letter
> > combinations for the custom commands. From the manual I could not see how to
> > do this with org-capture and I'm guessing it is not possible right now.
> 
> It already is... See an example below, with the helper function I defined for
> myself...
> 
> #+begin_src emacs-lisp
>   (defun my/org-capture-template (keys description file headline)
> "Create template for captured elements."
> `(,keys ,description entry
> (file+headline ,file ,headline)
> "* %^{Title}
>:PROPERTIES:
>:Created: %:date-timestamp-inactive
>:END:
> %?
> %i
> 
> From %a"
> :empty-lines 1))
> #+end_src
> 
> ... for avoiding repetitive skeleton:
> 
> #+begin_src emacs-lisp
>   (setq org-capture-templates
> `(;; notes
>   ("N" "Templates adding notes")
>   ,(my/org-capture-template
> "Ne" "Emacs" "~/Public/Notes-on-Emacs.txt" "Notes")
>  ;; [...]
>   ,(my/org-capture-template
> "No" "Org" "~/Public/Notes-on-Org.txt" "Notes")))
> #+end_src
> 
> Best regards,
>   Seb
> 
> -- 
> Sebastien Vauban
> 
> 



Re: [O] Feature request: two-letter combination for org-capture

2011-06-07 Thread Sebastien Vauban
Hi Darlan,

Darlan Cavalcante Moreira wrote:
> A nice feature of the org-agenda is the possibility to define two letter
> combinations for the custom commands. From the manual I could not see how to
> do this with org-capture and I'm guessing it is not possible right now.

It already is... See an example below, with the helper function I defined for
myself...

#+begin_src emacs-lisp
  (defun my/org-capture-template (keys description file headline)
"Create template for captured elements."
`(,keys ,description entry
(file+headline ,file ,headline)
"* %^{Title}
   :PROPERTIES:
   :Created: %:date-timestamp-inactive
   :END:
%?
%i

>From %a"
:empty-lines 1))
#+end_src

... for avoiding repetitive skeleton:

#+begin_src emacs-lisp
  (setq org-capture-templates
`(;; notes
  ("N" "Templates adding notes")
  ,(my/org-capture-template
"Ne" "Emacs" "~/Public/Notes-on-Emacs.txt" "Notes")
 ;; [...]
  ,(my/org-capture-template
"No" "Org" "~/Public/Notes-on-Org.txt" "Notes")))
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban




[O] Feature request: two-letter combination for org-capture

2011-06-07 Thread Darlan Cavalcante Moreira

Hello list,

A nice feature of the org-agenda is the possibility to define two letter
combinations for the custom commands. From the manual I could not see how
to do this with org-capture and I'm guessing it is not possible right now.

Of course one can always define a single letter template for each
situation, but the same goes for the org-agenda and two-letter templates
can help a lot with the organization (also finding good letter choices).


Some use-case scenarios I can imagine:
 - Add todo items to specific projects (I know you can refile the note
   during the capture process, but this would be faster). All of the
   letters "t" and a project specific letter
 - Add a contact to a specific category: people using org-contacts could
   define different templates for work contacts and personal contacts, for
   instance.
 - Add a line to a specific table: Suppose you use tables in org to
   organize your expenses, but you have multiple tables, one for each kind
   of expense. You would be able to add one expense to a specific table
   (I'm not sure if refile from the capture buffer even works in this
   case).
 - Etc.


--
Darlan Cavalcante