all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [RFC] Self-configuring Org-mode files
@ 2010-12-10  7:09 Thomas S. Dye
  2010-12-10 16:04 ` Jeff Horn
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2010-12-10  7:09 UTC (permalink / raw)
  To: emacs-orgmode list


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

Aloha all,

I'm eager to learn how to build a self-configuring Org-mode file.

I think Org-mode is uniquely positioned to produce reproducible  
research documents, but frankly speaking, the author of a reproducible  
Org-mode research document would be foolish to release it.   The  
probability that it would run out-of-the-box on a reader's computer is  
quite a bit less than 1.  Multiply this fraction by the number of  
potential readers and the probability that the author will receive one  
or more emails entitled something like "Your reproducible research  
isn't reproducible" rapidly approaches 1.

A desire to produce reproducible research with Org-mode shouldn't  
reduce to an open-ended commitment to solve configuration problems on  
users' computers around the world.  An Org-mode file that reliably  
self-configures might solve this problem.

Based on the kind comments of several list members, I've come up with  
what I hope are the rudiments of such a self-configuring Org-mode  
file.  I'm requesting your comments because I believe, individually  
and collectively, you know way more about this than I do.

1) At the end of the Org-mode file are some instructions saying  
something like "To use this document, first
evaluate this code block", as suggested by Dan Davison:

# Local variables:
# eval:(sbe "essential-document-config")
# End:

2) the source code block "essential-document-config" would consist of  
noweb calls to Library of Babel functions:

#+source: essential-document-config
#+begin_src emacs-lisp :noweb yes
  <<lob-set-this-variable(x=t)>>
<<lob-set-that-variable(x=nil)>>
#+end_src

3) The Library of Babel would be populated with little functions, each  
of which sets a single variable in a buffer-local way (as suggested  
several times to me on the list):

#+source: lob-set-this-variable
#+begin_src emacs-lisp :var x=nil
(set (make-local-variable 'this-variable) x)
#+end_src

4) A super-function in the Library of Babel would set the buffer-local  
instance of every relevant Org-mode variable to its default state:

#+source: lob-set-local-defaults
#+begin_src emacs-lisp
...
#+end_src

5) The Org-mode community would be responsible for populating the  
Library of Babel with the relevant little functions--whenever a new  
configuration variable is introduced, then a little function for it  
would be deposited in the Library of Babel.  The name of the  
configuration function would be part of the variable's docstring.

6) The author of a reproducible Org-mode document could reasonably  
expect to produce a document that self-configures on computers around  
the world, in a way that is safe and effective.  The author would call  
the super-function, then add noweb calls to little functions until the  
reproducible research document works as expected.

I'm happy for any comments, positive or negative.

All the best,
Tom


[-- Attachment #1.2: Type: text/html, Size: 4241 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] 4+ messages in thread

* Re: [RFC] Self-configuring Org-mode files
  2010-12-10  7:09 [RFC] Self-configuring Org-mode files Thomas S. Dye
@ 2010-12-10 16:04 ` Jeff Horn
  2010-12-10 16:13   ` Erik Iverson
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Horn @ 2010-12-10 16:04 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode list

On Fri, Dec 10, 2010 at 2:09 AM, Thomas S. Dye <tsd@tsdye.com> wrote:
> 4) A super-function in the Library of Babel would set the buffer-local
> instance of every relevant Org-mode variable to its default state:
> #+source: lob-set-local-defaults
> #+begin_src emacs-lisp
> ...
> #+end_src

Would this function save the current state of each variable it changes
for restoration after the user exits the buffer?

-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jhorn@gmu.edu
jrhorn424@gmail.com

http://www.failuretorefrain.com/jeff/

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

* Re: [RFC] Self-configuring Org-mode files
  2010-12-10 16:04 ` Jeff Horn
@ 2010-12-10 16:13   ` Erik Iverson
  2010-12-10 16:20     ` Jeff Horn
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Iverson @ 2010-12-10 16:13 UTC (permalink / raw)
  To: Jeff Horn; +Cc: emacs-orgmode list



Jeff Horn wrote:
> On Fri, Dec 10, 2010 at 2:09 AM, Thomas S. Dye <tsd@tsdye.com> wrote:
>> 4) A super-function in the Library of Babel would set the buffer-local
>> instance of every relevant Org-mode variable to its default state:
>> #+source: lob-set-local-defaults
>> #+begin_src emacs-lisp
>> ...
>> #+end_src
> 
> Would this function save the current state of each variable it changes
> for restoration after the user exits the buffer?
> 
Perhaps I'm mis-understanding, but Thomas' suggestion is to set the
variables *buffer-local*, not global, so once the buffer is killed,
so are the buffer-local versions of the variables.

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

* Re: [RFC] Self-configuring Org-mode files
  2010-12-10 16:13   ` Erik Iverson
@ 2010-12-10 16:20     ` Jeff Horn
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Horn @ 2010-12-10 16:20 UTC (permalink / raw)
  To: Erik Iverson; +Cc: emacs-orgmode list

Hah! You're right. Sorry for noise.

On Fri, Dec 10, 2010 at 11:13 AM, Erik Iverson <eriki@ccbr.umn.edu> wrote:
>
>
> Jeff Horn wrote:
>>
>> On Fri, Dec 10, 2010 at 2:09 AM, Thomas S. Dye <tsd@tsdye.com> wrote:
>>>
>>> 4) A super-function in the Library of Babel would set the buffer-local
>>> instance of every relevant Org-mode variable to its default state:
>>> #+source: lob-set-local-defaults
>>> #+begin_src emacs-lisp
>>> ...
>>> #+end_src
>>
>> Would this function save the current state of each variable it changes
>> for restoration after the user exits the buffer?
>>
> Perhaps I'm mis-understanding, but Thomas' suggestion is to set the
> variables *buffer-local*, not global, so once the buffer is killed,
> so are the buffer-local versions of the variables.
>
>



-- 
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University

(704) 271-4797
jhorn@gmu.edu
jrhorn424@gmail.com

http://www.failuretorefrain.com/jeff/

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

end of thread, other threads:[~2010-12-10 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-10  7:09 [RFC] Self-configuring Org-mode files Thomas S. Dye
2010-12-10 16:04 ` Jeff Horn
2010-12-10 16:13   ` Erik Iverson
2010-12-10 16:20     ` Jeff Horn

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.