diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-25 16:53:30 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-25 16:53:30 +0200 |
commit | 4832a432f0228ceeb94091b3c70e50a0240802dd (patch) | |
tree | 1ab4741a46dcbb281e52ff4e656678e13d2957dc | |
parent | b886ebbc8924916c1e36df00639b3208a1c155a2 (diff) | |
download | org-mode-4832a432f0228ceeb94091b3c70e50a0240802dd.tar.gz |
ox-ascii: Add missing ASCII and UTF-8 conversion functions
* lisp/ox-ascii.el (org-ascii-convert-region-to-ascii):
(org-ascii-convert-region-to-utf8): New functions.
* doc/org-manual.org (Export in Foreign Buffers): Document new
functions.
Reported-by: Alexander Adolf <alexander.adolf@condition-alpha.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00294.html>
-rw-r--r-- | doc/org-manual.org | 10 | ||||
-rw-r--r-- | lisp/ox-ascii.el | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org index e4dc945..75ac808 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -15238,6 +15238,16 @@ regions. A convenient feature of this in-place conversion is that the exported output replaces the original source. Here are such functions: +- ~org-ascii-convert-region-to-ascii~ :: + + #+findex: org-ascii-convert-region-to-ascii + Convert the selected region into ASCII. + +- ~org-ascii-convert-region-to-utf8~ :: + + #+findex: org-ascii-convert-region-to-utf8 + Convert the selected region into UTF-8. + - ~org-html-convert-region-to-html~ :: #+findex: org-html-convert-region-to-html diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index ee83898..d54c373 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -2065,6 +2065,20 @@ a communication channel." ;;; End-user functions ;;;###autoload +(defun org-ascii-convert-region-to-ascii () + "Assume region has Org syntax, and convert it to plain ASCII." + (interactive) + (let ((org-ascii-charset 'ascii)) + (org-export-replace-region-by 'ascii))) + +;;;###autoload +(defun org-ascii-convert-region-to-utf8 () + "Assume region has Org syntax, and convert it to UTF-8." + (interactive) + (let ((org-ascii-charset 'utf-8)) + (org-export-replace-region-by 'ascii))) + +;;;###autoload (defun org-ascii-export-as-ascii (&optional async subtreep visible-only body-only ext-plist) "Export current buffer to a text buffer. |