From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Arkell Subject: Re: Re: [babel] features request for Emacs Initialization Date: Tue, 8 Dec 2009 12:18:00 -0500 Message-ID: References: <87skblamzw.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0427162633==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NI3ht-000159-9I for emacs-orgmode@gnu.org; Tue, 08 Dec 2009 12:18:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NI3hn-0000yb-Cr for emacs-orgmode@gnu.org; Tue, 08 Dec 2009 12:18:35 -0500 Received: from [199.232.76.173] (port=48168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI3hm-0000yP-Tr for emacs-orgmode@gnu.org; Tue, 08 Dec 2009 12:18:30 -0500 Received: from brewer.cmass.criticalmass.com ([207.61.21.2]:8190) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NI3hm-0000fu-Mg for emacs-orgmode@gnu.org; Tue, 08 Dec 2009 12:18:30 -0500 In-Reply-To: <87skblamzw.fsf@mundaneum.com> Content-Language: en List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?iso-8859-1?Q?S=E9bastien_Vauban?= , "emacs-orgmode@gnu.org" --===============0427162633== Content-Language: en Content-Type: multipart/alternative; boundary="_000_C743D8581FAAjonathanacriticalmasscom_" --_000_C743D8581FAAjonathanacriticalmasscom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Doh. Thanks for catching that mistake. On 2009/12/8 1:28 AM, "S=E9bastien Vauban" wro= te: Hi Jonathan, Jonathan Arkell wrote: > On 2009/12/7 12:31 AM, "bluedian" wrote: >> >> For now, I use this basic snippet when defining emacs code block in my >> configuration files, JDL-Debug is a flag I put to true when I want to de= bug >> my Emacs configuration. >> >> # -*- mode: snippet -*- >> # name: code org for emacs configuration blocks >> # key: cemacs >> # -- >> #+srcname: $1 >> #+begin_src emacs-lisp >> (if JDL-Debug >> (message "start $1")) >> $2 >> (if JDL-Debug >> (message "End $1")) >> #+end_src > > Why not use a macro? That is one of the great things about lisp: > > (defmacro JDL-Debug (section &rest code) > `(if JDL-Ddebuging > (progn > (message (concat "start " ,section)) > ,code > (message (concat "end " ,section))))) > > (I haven't tested it, but that should work.) Not the same semantics, here: you don't execute the code unless the debug f= lag is set to `t'. In his case, the debug flag just adds (or not) messages in t= he echo area. Apart from that little difference, yes, I guess using macros is an excellen= t idea. Best regards, Seb -- S=E9bastien 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 ________________________________ The information contained in this message is confidential. It is intended t= o be read only by the individual or entity named above or their designee. I= f the reader of this message is not the intended recipient, you are hereby = notified that any distribution of this message, in any form, is strictly pr= ohibited. If you have received this message in error, please immediately no= tify the sender and delete or destroy any copy of this message. --_000_C743D8581FAAjonathanacriticalmasscom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: [Orgmode] Re: [babel] features request for Emacs Initialization<= /title> </head> <body> <font face=3D"Calibri, Verdana, Helvetica, Arial"><span style=3D"font-size:= 11pt">Doh.<br> <br> Thanks for catching that mistake.<br> <br> <br> On 2009/12/8 1:28 AM, "S=E9bastien Vauban" <<a href=3D"wxhgmqz= gwmuf@spammotel.com">wxhgmqzgwmuf@spammotel.com</a>> wrote:<br> <br> </span></font> <blockquote><font face=3D"Calibri, Verdana, Helvetica, Arial"><span style= =3D"font-size:11pt">Hi Jonathan,<br> <br> Jonathan Arkell wrote:<br> > On 2009/12/7 12:31 AM, "bluedian" <<a href=3D"blue.dian@g= mail.com">blue.dian@gmail.com</a>> wrote:<br> >><br> >> For now, I use this basic snippet when defining emacs code block i= n my<br> >> configuration files, JDL-Debug is a flag I put to true when I want= to debug<br> >> my Emacs configuration.<br> >><br> >> # -*- mode: snippet -*-<br> >> # name: code org for emacs configuration blocks<br> >> # key: cemacs<br> >> # --<br> >> #+srcname: $1<br> >> #+begin_src emacs-lisp<br> >> (if JDL-Debug<br> >>  (message "start $1"))<br> >> $2<br> >> (if JDL-Debug<br> >>  (message "End $1"))<br> >> #+end_src<br> ><br> > Why not use a macro?  That is one of the great things about lisp:= <br> ><br> > (defmacro JDL-Debug (section &rest code)<br> >   `(if JDL-Ddebuging<br> >      (progn<br> >        (message (concat "start= " ,section))<br> >        ,code<br> >        (message (concat "end &= quot; ,section)))))<br> ><br> > (I haven't tested it, but that should work.)<br> <br> Not the same semantics, here: you don't execute the code unless the debug f= lag<br> is set to `t'. In his case, the debug flag just adds (or not) messages in t= he<br> echo area.<br> <br> Apart from that little difference, yes, I guess using macros is an excellen= t<br> idea.<br> <br> Best regards,<br>   Seb<br> <br> --<br> S=E9bastien Vauban<br> <br> <br> <br> _______________________________________________<br> Emacs-orgmode mailing list<br> Please use `Reply All' to send replies to the list.<br> <a href=3D"Emacs-orgmode@gnu.org">Emacs-orgmode@gnu.org</a><br> <a href=3D"http://lists.gnu.org/mailman/listinfo/emacs-orgmode">http://list= s.gnu.org/mailman/listinfo/emacs-orgmode</a><br> <br> </span></font></blockquote> <br> <hr> <font face=3D"Arial" color=3D"Gray" size=3D"1">The information contained in= this message is confidential. It is intended to be read only by the indivi= dual or entity named above or their designee. If the reader of this message= is not the intended recipient, you are hereby notified that any distribution of this message, in any form, is str= ictly prohibited. If you have received this message in error, please immedi= ately notify the sender and delete or destroy any copy of this message.<br> </font> </body> </html> --_000_C743D8581FAAjonathanacriticalmasscom_-- --===============0427162633== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0427162633==--