emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <81sjpyfkd1.fsf@gmail.com> (raw)
In-Reply-To: <20110709094721.r9w76inbs0c0k0o4@webmail.unina.it> (sebastian titz's message of "Sat, 09 Jul 2011 09:47:21 +0200")

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

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.


[-- Attachment #2: 0002-org-odt-Check-for-zip-early-during-export.patch --]
[-- Type: text/plain, Size: 1103 bytes --]

From 043a85d0826eb9a6a1e28792b8a701c74ff18623 Mon Sep 17 00:00:00 2001
From: Jambunathan K <kjambunathan@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 87 bytes --]




>
> Is there a way to use org-odt under windows?
>
> Best,
>
> Sebastian
>
>
>

-- 

  parent reply	other threads:[~2011-07-22 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09  7:47 org-odt on Windows 7 sebastian.titz
2011-07-09 13:50 ` Bastien
2011-07-09 14:49   ` Sebastian
2011-07-09 15:26     ` Sebastien Vauban
2011-07-09 15:45     ` Bastien
2011-07-22 14:41 ` Jambunathan K [this message]
2011-07-22 15:49   ` [PATCH 2/2] org-odt: Check for zip early during export (was Re: org-odt on Windows 7) Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81sjpyfkd1.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).