From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [babel] features request for Emacs Initialization Date: Tue, 08 Dec 2009 09:28:03 +0100 Message-ID: <87skblamzw.fsf@mundaneum.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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 excellent idea. Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode