From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Adding Easy Templates Date: Wed, 23 May 2012 15:35:23 +0200 Message-ID: References: <87d35vxcuc.wl%ded-law@ddoherty.net> <688B6FE9-3E38-4159-8528-AE68B4E9FB14@gmail.com> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXBiy-0002X2-62 for emacs-orgmode@gnu.org; Wed, 23 May 2012 09:35:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXBir-00029S-O6 for emacs-orgmode@gnu.org; Wed, 23 May 2012 09:35:35 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:59734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXBir-00028z-FS for emacs-orgmode@gnu.org; Wed, 23 May 2012 09:35:29 -0400 Received: by eaan1 with SMTP id n1so2117246eaa.0 for ; Wed, 23 May 2012 06:35:27 -0700 (PDT) In-Reply-To: <688B6FE9-3E38-4159-8528-AE68B4E9FB14@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: "Daniel E. Doherty" , Org-mode List On May 23, 2012, at 3:28 PM, Carsten Dominik wrote: > Hi Daniel, >=20 > you need to quote the entire form, i.e. the progn; >=20 > (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")))) >=20 > This is because the entire form is stored for execution after loading = org - but in your case it was > evaluated immediately... .... so what happens is that the result of the second add-to-list command = (that result is the extended list) is stored and then evaluated after = org.el is loaded. So at that point in time, Emacs tries to evaluate (("j" ...... Which is of cause not valid because the first element in that list `("j" = ...' is not a function. - Carsten >=20 > - Carsten >=20 > On May 23, 2012, at 3:10 PM, Daniel E. Doherty wrote: >=20 >> All, >>=20 >> 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: >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> (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"))))) >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> Which yeilds: >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> Debugger entered--Lisp error: (invalid-function (("j" "#+begin_quote >> ||Dr|Cr| >> |- >> |?|$|| >> |||$| >> #+end_quote"))) >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >>=20 >>=20 >> I have also tried this: >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> (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")))) >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> 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. >>=20 >> Any help? >>=20 >> Thanks. >>=20 >> Dan Doherty >>=20 >=20 > - Carsten >=20 >=20 >=20 - Carsten