emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Adding Easy Templates


From: Carsten Dominik
Subject: Re: [O] Adding Easy Templates
Date: Wed, 23 May 2012 15:28:28 +0200

Hi Daniel,

you need to quote the entire form, i.e. the progn;

 (eval-after-load 'org
   '(progn
     (add-to-list 'org-structure-template-alist
                  '("m" "#+begin_src emacs-lisp\n?\n#+end_src"))
     (add-to-list 'org-structure-template-alist
                  '("j" 
"#+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote"))))

This is because the entire form is stored for execution after loading org - but 
in your case it was
evaluated immediately...

- Carsten

On May 23, 2012, at 3:10 PM, Daniel E. Doherty wrote:

> All,
> 
> I really like the Easy Template facility, and would like to add some of
> my own.  However, I am having trouble with the elisp syntax.  I would
> like to add a couple in my init file, but am having no luck.  Here is
> what I have now:
> =========================
>  (eval-after-load 'org
>    (progn
>      (add-to-list 'org-structure-template-alist
>                   (list '("m" "#+begin_src emacs-lisp\n?\n#+end_src")))
>      (add-to-list 'org-structure-template-alist
>                   (list '("j" 
> "#+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote")))))
> =========================
> Which yeilds:
> =========================
> Debugger entered--Lisp error: (invalid-function (("j" "#+begin_quote
> ||Dr|Cr|
> |-
> |?|$||
> |||$|
> #+end_quote")))
> =========================
> 
> 
> I have also tried this:
> =========================
>  (eval-after-load 'org
>    (progn
>      (add-to-list 'org-structure-template-alist
>                   '("m" "#+begin_src emacs-lisp\n?\n#+end_src"))
>      (add-to-list 'org-structure-template-alist
>                   '("j" 
> "#+begin_quote\n||Dr|Cr|\n|-\n|?|$||\n|||$|\n#+end_quote"))))
> =========================
> Which spits out a similar error.  I am quoting the list, so I don't
> understand why elisp is interpteting it as a function.  In the first
> case, I even quote it twice.
> 
> Any help?
> 
> Thanks.
> 
> Dan Doherty
> 

- Carsten






reply via email to

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