From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: [PATCH 2/2] org-odt: Check for zip early during export (was Re: org-odt on Windows 7) Date: Fri, 22 Jul 2011 20:11:46 +0530 Message-ID: <81sjpyfkd1.fsf@gmail.com> References: <20110709094721.r9w76inbs0c0k0o4@webmail.unina.it> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkGvY-00043N-Sf for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 10:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkGvX-0000Zg-Mg for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 10:42:08 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:56605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkGvX-0000ZY-KC for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 10:42:07 -0400 Received: by ywm39 with SMTP id 39so1423613ywm.0 for ; Fri, 22 Jul 2011 07:42:07 -0700 (PDT) In-Reply-To: <20110709094721.r9w76inbs0c0k0o4@webmail.unina.it> (sebastian titz's message of "Sat, 09 Jul 2011 09:47:21 +0200") 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain sebastian.titz@unina.it writes: > Hello, > > I tried the new org-odt exporter in org-mode 7.6 running emacs 23.3 > on Windows 7 with (org-export-as-odt). It stops before generating an > output with the error message: Searching for program: no such file or > directory, zip. I guess it is caused by not having a command line > version of zip in Windows. The simple patch below tries to check for availability of zip very early in the export. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0002-org-odt-Check-for-zip-early-during-export.patch Content-Description: 0002-org-odt-Check-for-zip-early-during-export.patch >From 043a85d0826eb9a6a1e28792b8a701c74ff18623 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 22 Jul 2011 16:54:40 +0530 Subject: [PATCH 2/2] org-odt: Check for zip early during export * contrib/lisp/org-odt.el (org-odt-init-outfile): Abort export if zip utility is not available. --- contrib/lisp/org-odt.el | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index c1c5b7f..b7e5a70 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -1226,6 +1226,10 @@ MAY-INLINE-P allows inlining it as an image." (apply 'org-lparse-format-tags tag text prefix suffix args))) (defun org-odt-init-outfile (filename) + (unless (executable-find "zip") + ;; Not at all OSes ship with zip by default + (error "Executable \"zip\" needed for creating OpenDocument files. Aborting.")) + (let* ((outdir (make-temp-file org-export-odt-tmpdir-prefix t)) (mimetype-file (expand-file-name "mimetype" outdir)) (content-file (expand-file-name "content.xml" outdir)) -- 1.7.2.3 --=-=-= Content-Type: text/plain > > Is there a way to use org-odt under windows? > > Best, > > Sebastian > > > -- --=-=-=--