emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [feature proposal] Export in foreign buffers - ASCII (ox-ascii)


From: Alexander Adolf
Subject: [O] [feature proposal] Export in foreign buffers - ASCII (ox-ascii)
Date: Mon, 22 Oct 2018 21:22:36 +0200

Dear Org-Mode Developers,

I was missing convert-region functions in the ox-ascii export back-end
as are provided by the HTML, LaTeX, Texinfo, and MarkDown back-ends [1],
and hence crafted my own (copied below) to go into my init file. My use
case is composing emails using notmuch-message-mode.

[1] https://orgmode.org/manual/Export-in-foreign-buffers.html

I though this feature might be useful to others, too, and would likely
also seem a low hanging fruit to implement? ;-))

It would be awesome to see this new feature in one of the next releases
of ox-ascii.


Many thanks in advance and cheers,

  --alexander

----------------------------------------------------------------------
(defun org-ascii-convert-region-to-ascii ()
  "Assume the current region has org-mode syntax, and convert it to plain ASCII.
This can be used in any buffer.  For example, you could write an
itemized list in org-mode syntax in a Mail buffer and then use
this command to convert it."
  (interactive)
  (let ((my/org-ascii-charset org-ascii-charset))
    (setq org-ascii-charset 'ascii)
    (org-export-replace-region-by 'ascii)
    (setq org-ascii-charset my/org-ascii-charset)))

(defun org-ascii-convert-region-to-utf8 ()
  "Assume the current region has org-mode syntax, and convert it to UTF-8.
This can be used in any buffer.  For example, you could write an
itemized list in org-mode syntax in a Mail buffer and then use
this command to convert it."
  (interactive)
  (let ((my/org-ascii-charset org-ascii-charset))
    (setq org-ascii-charset 'utf-8)
    (org-export-replace-region-by 'ascii)
    (setq org-ascii-charset my/org-ascii-charset)))
----------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]