emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] features request for Emacs Initialization
@ 2009-12-01  8:19 bluedian
  2009-12-05  5:33 ` Eric Schulte
  0 siblings, 1 reply; 6+ messages in thread
From: bluedian @ 2009-12-01  8:19 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Thanks for org-babel, my configuration file are now in org form and it's pretty
easy to manage and document them. I was looking for that kind of things since a
long time !

I will find interesting to have two more things (perhaps it's already there) :

1) When the org configuration file aren't changed, a way to automatically load
their tangled version (bytecompiled ?) in order to improve the initialization
time of Emacs.

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.

For instance, the code block :
  #+srcname: Name_Code_Block
  #+begin_src emacs-lisp 
   ;; code lisp ....  
   (desktop-save-mode 1) ;; for instance
  #+end_src

could be tangled in something like  

  ;; generated by org-babel-tangle
  ;; [[file:~/TEST.org::*foo][foo]]
  (message "starting Name_Code_Block")
  ;; code lisp ....  
  (desktop-save-mode 1) ;; for instance
  (message "ending Name_Code_Block")
  ;; foo ends here

Regards,
BlueDian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] features request for Emacs Initialization
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2009-12-05  5:33 UTC (permalink / raw)
  To: bluedian; +Cc: emacs-orgmode

bluedian <bluedian@gmail.com> writes:

> Hi,
>
> Thanks for org-babel, my configuration file are now in org form and it's pretty
> easy to manage and document them. I was looking for that kind of things since a
> long time !
>
> I will find interesting to have two more things (perhaps it's already there) :
>
> 1) When the org configuration file aren't changed, a way to automatically load
> their tangled version (bytecompiled ?) in order to improve the initialization
> time of Emacs.
>

Hmm, maybe we should byte-compile elisp files by default when they are
tangled out of org-babel documents.  Although I can't think of any off
the top of my head I image there are going to be cases when it would not
be appropriate to byte-compile tangled elisp files.

I'll add this feature as a task in our development list.

>
> 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
limited a set of functionality.  Maybe there is a more general feature
lying behind this request that would be more widely applicable?

Thanks for the suggestions -- Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] features request for Emacs Initialization
  2009-12-05  5:33 ` Eric Schulte
@ 2009-12-07  7:31   ` bluedian
  2009-12-07 16:06     ` Jonathan Arkell
  0 siblings, 1 reply; 6+ messages in thread
From: bluedian @ 2009-12-07  7:31 UTC (permalink / raw)
  To: emacs-orgmode

Thanks for your reply.


Eric Schulte <schulte.eric <at> 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 limited
> a set of functionality. Maybe there is a more general feature lying behind
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [babel] features request for Emacs Initialization
  2009-12-07  7:31   ` bluedian
@ 2009-12-07 16:06     ` Jonathan Arkell
  2009-12-08  8:28       ` Sébastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Arkell @ 2009-12-07 16:06 UTC (permalink / raw)
  To: bluedian, emacs-orgmode@gnu.org


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

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" <blue.dian@gmail.com> wrote:

Thanks for your reply.


Eric Schulte <schulte.eric <at> 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 limited
> a set of functionality. Maybe there is a more general feature lying behind
> 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 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: 3292 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [babel] features request for Emacs Initialization
  2009-12-07 16:06     ` Jonathan Arkell
@ 2009-12-08  8:28       ` Sébastien Vauban
  2009-12-08 17:18         ` Jonathan Arkell
  0 siblings, 1 reply; 6+ messages in thread
From: Sébastien Vauban @ 2009-12-08  8:28 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Jonathan,

Jonathan Arkell wrote:
> On 2009/12/7 12:31 AM, "bluedian" <blue.dian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [babel] features request for Emacs Initialization
  2009-12-08  8:28       ` Sébastien Vauban
@ 2009-12-08 17:18         ` Jonathan Arkell
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Arkell @ 2009-12-08 17:18 UTC (permalink / raw)
  To: Sébastien Vauban, emacs-orgmode@gnu.org


[-- 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-08 17:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).