Org-mode mailing list
 help / color / mirror / Atom feed
From: "Cheong Yiu Fung" <cheongyiufung@gmail.com>
To: Emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] ox-odt.el: quote output file name
Date: Fri, 20 Nov 2020 17:03:25 +0800
Message-ID: <f675d54f-fe76-4dd7-aac4-8908c628e85d@www.fastmail.com> (raw)

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

Hello,

Here's a patch to quote output file name following the fashion of input file name as used in `org-odt-convert'. It avoids conversion errors in the underlying shell commands.

Yiufung

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-odt.el-quote-output-file-name.patch --]
[-- Type: text/x-patch; name="0001-ox-odt.el-quote-output-file-name.patch", Size: 1032 bytes --]

From e77284cc511afc9d3e9ad68c9b36f9f69bcad413 Mon Sep 17 00:00:00 2001
From: Cheong Yiu Fung <cheongyiufung@gmail.com>
Date: Fri, 20 Nov 2020 16:43:53 +0800
Subject: [PATCH] ox-odt.el: quote output file name

* lisp/ox-odt.el (org-odt-do-convert): Add `shell-quote-argument'
around output file name.

TINYCHANGE
---
 lisp/ox-odt.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 01c0e6a90..59fe369e9 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -4240,9 +4240,9 @@ Return output file's name."
 			   `((?i . ,(shell-quote-argument in-file))
 			     (?I . ,(browse-url-file-url in-file))
 			     (?f . ,out-fmt)
-			     (?o . ,out-file)
+			     (?o . ,(shell-quote-argument out-file))
 			     (?O . ,(browse-url-file-url out-file))
-			     (?d . , (shell-quote-argument out-dir))
+			     (?d . ,(shell-quote-argument out-dir))
 			     (?D . ,(browse-url-file-url out-dir))
 			     (?x . ,extra-options)))))
     (when (file-exists-p out-file)
-- 
2.29.2


             reply	other threads:[~2020-11-21  6:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  9:03 Cheong Yiu Fung [this message]
2020-11-23  3:28 ` Kyle Meyer
2020-11-20  9:28 Cheong Yiu Fung

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://orgmode.org

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

  git send-email \
    --in-reply-to=f675d54f-fe76-4dd7-aac4-8908c628e85d@www.fastmail.com \
    --to=cheongyiufung@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

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git