From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noorul Islam K M Subject: Re: org batch job using emacsclient? Date: Mon, 16 Nov 2009 16:37:47 +0530 Message-ID: <87r5ryram4.fsf@noorul.maa.corp.collab.net> References: <4A2B8DB1-1A56-40CA-B972-E44C16F9DD1E@nf.mpg.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9zRe-0000ej-Ql for emacs-orgmode@gnu.org; Mon, 16 Nov 2009 06:08:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9zRZ-0000bF-TM for emacs-orgmode@gnu.org; Mon, 16 Nov 2009 06:08:30 -0500 Received: from [199.232.76.173] (port=37569 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9zRZ-0000b3-OC for emacs-orgmode@gnu.org; Mon, 16 Nov 2009 06:08:25 -0500 Received: from mail-yw0-f194.google.com ([209.85.211.194]:38880) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9zRY-0002Lh-RN for emacs-orgmode@gnu.org; Mon, 16 Nov 2009 06:08:25 -0500 Received: by ywh32 with SMTP id 32so6097885ywh.14 for ; Mon, 16 Nov 2009 03:08:23 -0800 (PST) In-Reply-To: <4A2B8DB1-1A56-40CA-B972-E44C16F9DD1E@nf.mpg.de> (Stefan Vollmar's message of "Mon, 16 Nov 2009 09:51:38 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Stefan Vollmar Cc: emacs-orgmode Mode Stefan Vollmar writes: > Hello, > > we are currently setting up some org-templates for simple web pages (e.g. CV information for members of our institute). So far this seems to work surprisingly well - even for users who use editors other than Emacs (yes, we need to try harder...). We have created a web service so users can upload an org-file and get a preview of the generated HTML page. > > In a python script we use (a recipe from this very useful list): > > [...] > cmd = emacs \ > + " -Q --batch" > + " --eval \"(add-to-list 'load-path \\\"" + ORGLIB + "\\\")\"" \ > + " --eval \"(require 'org)\"" \ > + " --eval \"(require 'org-exp)\"" \ > + " --eval \"(setq org-export-headline-levels 2)\"" \ > + " --visit=\"" + orgfile + "\"" \ > + " --funcall org-export-as-html" > > However, even on a modern system (SunFire T5140, Solaris 10) generating the HTML output with Emacs 23.1 and the latest org-version takes several seconds (which is disappointing). To improve performance, we want to switch to emacsclient but we are not sure how to adapt the above code to do this. Our first attempt: > > cmd = emacsclient + " --eval " \ > + " \"(add-to-list 'load-path \\\"" + ORGLIB + "\\\")\"" \ > + " \"(require 'org)\"" \ > + " \"(require 'org-exp)\"" \ > + " \"(setq org-export-headline-levels 2)\"" \ > + " \"(load-file \\\"" + orgfile + "\\\")\"" \ > + " \"(org-export-as-html)\"" > > did not work. > Any help is appreciated. You are using option -Q with emacs command. That itself should give you the maximum performance. I don't think that you will get any performace improvement if you use emacsclient. Thanks Noorul