emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox-odt.el: quote output file name
@ 2020-11-20  9:03 Cheong Yiu Fung
  2020-11-23  3:28 ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Cheong Yiu Fung @ 2020-11-20  9:03 UTC (permalink / raw)
  To: Emacs-orgmode

[-- 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ox-odt.el: quote output file name
@ 2020-11-20  9:28 Cheong Yiu Fung
  0 siblings, 0 replies; 3+ messages in thread
From: Cheong Yiu Fung @ 2020-11-20  9:28 UTC (permalink / raw)
  To: Emacs-orgmode

[-- 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ox-odt.el: quote output file name
  2020-11-20  9:03 [PATCH] ox-odt.el: quote output file name Cheong Yiu Fung
@ 2020-11-23  3:28 ` Kyle Meyer
  0 siblings, 0 replies; 3+ messages in thread
From: Kyle Meyer @ 2020-11-23  3:28 UTC (permalink / raw)
  To: Cheong Yiu Fung; +Cc: Emacs-orgmode

Cheong Yiu Fung writes:

> 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.
[...]

Thanks!  Applied (2d23d55ac)...

> ---
>  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))

...dropping this unrelated space change to the out-dir entry.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-23  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-20  9:03 [PATCH] ox-odt.el: quote output file name Cheong Yiu Fung
2020-11-23  3:28 ` Kyle Meyer
  -- strict thread matches above, loose matches on Subject: below --
2020-11-20  9:28 Cheong Yiu Fung

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).