emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jonathan Arkell <jonathana@criticalmass.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Re: [babel] features request for Emacs Initialization
Date: Tue, 8 Dec 2009 12:18:00 -0500	[thread overview]
Message-ID: <C743D858.1FAA%jonathana@criticalmass.com> (raw)
In-Reply-To: <87skblamzw.fsf@mundaneum.com>


[-- Attachment #1.1: Type: text/plain, Size: 2003 bytes --]

Doh.

Thanks for catching that mistake.


On 2009/12/8 1:28 AM, "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com> wrote:

Hi Jonathan,

Jonathan Arkell wrote:
> On 2009/12/7 12:31 AM, "bluedian" <blue.dian@gmail.com> 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.
Emacs-orgmode@gnu.org
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.

[-- Attachment #1.2: Type: text/html, Size: 3267 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

      reply	other threads:[~2009-12-08 17:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01  8:19 [babel] features request for Emacs Initialization bluedian
2009-12-05  5:33 ` Eric Schulte
2009-12-07  7:31   ` bluedian
2009-12-07 16:06     ` Jonathan Arkell
2009-12-08  8:28       ` Sébastien Vauban
2009-12-08 17:18         ` Jonathan Arkell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C743D858.1FAA%jonathana@criticalmass.com \
    --to=jonathana@criticalmass.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).