From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Arkell Subject: Re: Re: [babel] features request for Emacs Initialization Date: Mon, 7 Dec 2009 11:06:03 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1837066375==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHg6g-0007pc-7m for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 11:06:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHg6b-0007nK-4e for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 11:06:37 -0500 Received: from [199.232.76.173] (port=38384 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHg6Z-0007mi-T7 for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 11:06:32 -0500 Received: from brewer.cmass.criticalmass.com ([207.61.21.2]:40929) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHg6a-0005Gy-0l for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 11:06:32 -0500 In-Reply-To: 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: bluedian , "emacs-orgmode@gnu.org" --===============1837066375== Content-Language: en Content-Type: multipart/alternative; boundary="_000_C74275FB1F58jonathanacriticalmasscom_" --_000_C74275FB1F58jonathanacriticalmasscom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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.) On 2009/12/7 12:31 AM, "bluedian" wrote: Thanks for your reply. Eric Schulte gmail.com> writes: > > 2) When in debugging mode (a variable, like "stater-kit-org-babel-debug= -lisp > > put to t), could a trace be generated by the tangling process in order = to > > trace the execution of the configuration file (simple trace like the > > generation of a message at the start and end of each emacs lisp block).= That > > could be a good help for rapidly finding an error. > > Hmm, I feel like this would require too much code in org-babel for too li= mited > a set of functionality. Maybe there is a more general feature lying behin= d > this request that would be more widely applicable? I understand. 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 debug= 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 _______________________________________________ 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_C74275FB1F58jonathanacriticalmasscom_ 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">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 = 220; ,section))<br>        ,code<br>        (message (concat “end ̶= 0; ,section)))))<br> <br> (I haven’t tested it, but that should work.)<br> <br> <br> <br> On 2009/12/7 12:31 AM, "bluedian" <<a href=3D"blue.dian@gmail.= com">blue.dian@gmail.com</a>> wrote:<br> <br> </span></font> <blockquote><font face=3D"Calibri, Verdana, Helvetica, Arial"><span style= =3D"font-size:11pt">Thanks for your reply.<br> <br> <br> Eric Schulte <schulte.eric <at> gmail.com> writes:<br> <br> > > 2) When in debugging mode (a variable, like "stater-kit-org-= babel-debug-lisp<br> > > put to t), could a trace be generated by the tangling process in = order to<br> > > trace the execution of the configuration file (simple trace like = the<br> > > generation of a message at the start and end of each emacs lisp b= lock). That<br> > > could be a good help for rapidly finding an error. ><br> <br> > Hmm, I feel like this would require too much code in org-babel for too= limited<br> > a set of functionality. Maybe there is a more general feature lying be= hind<br> > this request that would be more widely applicable?<br> <br> I understand.<br> <br> For now, I use this basic snippet when defining emacs code block in my<br> configuration files, JDL-Debug is a flag I put to true when I want to debug= my<br> 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> <br> <br> <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_C74275FB1F58jonathanacriticalmasscom_-- --===============1837066375== 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 --===============1837066375==--