emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: [babel] features request for Emacs Initialization


From: Jonathan Arkell
Subject: Re: [Orgmode] Re: [babel] features request for Emacs Initialization
Date: Tue, 8 Dec 2009 12:18:00 -0500

Doh.

Thanks for catching that mistake.


On 2009/12/8 1:28 AM, "Sébastien Vauban" <address@hidden> wrote:

Hi Jonathan,

Jonathan Arkell wrote:
> On 2009/12/7 12:31 AM, "bluedian" <address@hidden> 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 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
>
> 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 flag
is set to `t'. In his case, the debug flag just adds (or not) messages in the
echo area.

Apart from that little difference, yes, I guess using macros is an excellent
idea.

Best regards,
  Seb

--
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



The information contained in this message is confidential. It is intended to be read only by the individual 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 strictly prohibited. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message.

reply via email to

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