From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: Where does org-mode elisp hacking go? Date: Thu, 14 Mar 2013 10:52:03 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6050de8626e904d7df799e Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG4pW-00054R-IG for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 05:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UG4pQ-00034Q-VS for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 05:52:10 -0400 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:50229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG4pQ-00033p-Mp for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 05:52:04 -0400 Received: by mail-ea0-f176.google.com with SMTP id h10so894838eaj.21 for ; Thu, 14 Mar 2013 02:52:03 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Charles Berry Cc: Org Mode Mailing List , Eric Schulte --047d7b6050de8626e904d7df799e Content-Type: text/plain; charset=ISO-8859-1 Hi, if I have a project based on org which require some special settings (not only in lisp) I use a babel block and execute it after loading the file. I did this e.g. to set my Java environment correct If I remember correctly, we discussed once an autoload feature for org-babel, but security concerns overruled that idea. If some autoload feature should ever land in the repro, one would have to make sure that the code can't be manipulated e.g. by an external editor. This would come close to creating org-babel-viruses ;) One possible idea which jumps just to my mind, how about a combination of a babel blocks and org-encrypt? Encrypted babel blocks with a certain tag could be considered save for execution immediately after the user authentication during loading a certain buffer. I guess most of the functionality (tag, encryption, block-execution) is there already, it just would need some glue to put it together and a hook into opening of org-mode files Hmmm..... I think I put Eric CC :) Other then this I have a .init.el which simply loads many other lisp files, one of them is init_org.el If you frighten that emacs start-up might be to much delayed you might want to check the daemon / emcasclient feature of emacs. All the best Torsten On 13 March 2013 23:38, Charles Berry wrote: > Lawrence Bottorff gmail.com> writes: > > > > > > > > I see on the org-hacks.html page lots of interesting elisp code. > > > If I wanted to use some of this (lots of this) it seems wrong to shove it > > all in my .emacs file. My first guess would be to put what I want into > > separate .el files, go to my .org file and do a load-file on the .el file > > of hacks. But I really loath doing something that's not "best practice." > > What's the best practice for enabling org-mode elisp hacks? And what if > > I want to use just one hack for one project? With usual elisp-ing you can > > simply evaluate region. Is that possible in conjunction with a .org > file? > > > Yes. But you might like to look at > > http://orgmode.org/worg/org-contrib/babel/intro.html#sec-8-2-1 > > which discusses "Emacs Initialization with Babel" for a comprehensive > approach. > > For a single project, you can but a src_block in the master that loads > whatever is needed or use a file local variables block to load up the > requisites. > See: Specifying File Variables in the emacs manual. > > > > --047d7b6050de8626e904d7df799e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

if I have a project based on org which re= quire some special settings (not only in lisp) I use a babel block and exec= ute it after loading the file. I did this e.g. to set my Java environment c= orrect

If I remember correctly, we discussed once an autoload = feature for org-babel, but security concerns overruled that idea.
If some autoload feature should ever land in the repro, one would have= to make sure that the code can't be manipulated e.g. by an external ed= itor. This would come close to creating org-babel-viruses ;)

One possible idea which jumps just to my mind, how about a c= ombination of a babel blocks and org-encrypt?
Encrypted babel blocks with a certain tag could be considered save for= execution immediately after the user authentication during loading a certa= in buffer. I guess most of the functionality (tag, encryption, block-execut= ion) is there already, it just would need some glue to put it together and = a hook into opening of org-mode files =A0=A0

Hmmm..... I think I put Eric CC :)=A0

Other then this I have a .init.el which si= mply loads many other lisp files, one of them is init_org.el
If you=A0frighten=A0that emacs=A0start-up=A0might be to much delayed you mi= ght want to check the daemon / emcasclient feature of emacs.

All the best=A0
Torsten




On 13 March 2013 23:38, Charles Berry <ccberry@ucsd= .edu> wrote:
Lawr= ence Bottorff <galaxybeinglambda <at> gmail.com> writes:

>
>

> I see on the org-hacks.html page lots of interesting elisp code.

> If I wanted to use some of this (lots of this) it seems wrong to shove= it
> all in my .emacs file. My first guess would be to put what I want into=
> separate .el files, go to my .org file and do a load-file on the .el f= ile
> of hacks. But I really loath doing something that's not "best= practice."
> What's the best practice for enabling org-mode elisp hacks? And wh= at if
> I want to use just one hack for one project? With usual elisp-ing you = can
> simply evaluate region. Is that possible in conjunction with a .org fi= le?=A0


Yes. But you might like to look at

=A0 =A0http://orgmode.org/worg/org-contrib/babel/intro.ht= ml#sec-8-2-1

which discusses "Emacs Initialization with Babel" for a comprehen= sive approach.

For a single project, you can but a src_block in the master that loads
whatever is needed or use a file local variables block to load up the requi= sites.
See: Specifying File Variables in the emacs manual.




--047d7b6050de8626e904d7df799e--