Ver código fonte

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.
Pierre Téchoueyres 7 anos atrás
pai
commit
d956ae0431
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      lisp/ox.el

+ 5 - 0
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)