emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Sebastien Vauban
Subject: Re: [O] Feature request: two-letter combination for org-capture
Date: Tue, 07 Jun 2011 23:53:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]