summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Téchoueyres <pierre.techoueyres@free.fr>2018-06-02 10:02:03 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-10-03 18:44:34 +0200
commitd956ae04318fdede3e2b7a93dac2a11d13dd0a5e (patch)
treebf6809377b8d99c05cc1c4022272fa6914a29e49
parent1b81d6e07bc5ac78fe68674c0269c7dacd6b543f (diff)
downloadorg-mode-d956ae04318fdede3e2b7a93dac2a11d13dd0a5e.tar.gz
Add new :coding parameter to #+include keyword
* lisp/ox.el (org-export-expand-include-keyword): Add new parameter `:coding' for specify the file encoding whith the `#+include:' keyword. This allow to use something like: #+include: "./myfile" :coding cp850-dos when your Org file is encoded in utf-8 for example.
-rw-r--r--lisp/ox.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/ox.el b/lisp/ox.el
index 45c9415..7b10cde 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3282,6 +3282,11 @@ storing and resolving footnotes. It is created automatically."
(let* ((value (org-element-property :value element))
(ind (current-indentation))
location
+ (coding-system-for-read
+ (or (and (string-match ":coding +\\(\\S-+\\)>" value)
+ (prog1 (intern (match-string 1 value))
+ (setq value (replace-match "" nil nil value))))
+ coding-system-for-read))
(file
(and (string-match
"^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" value)