From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Adolf Subject: [feature proposal] Export in foreign buffers - ASCII (ox-ascii) Date: Mon, 22 Oct 2018 21:22:36 +0200 Message-ID: <8422BCDC-5B51-417D-B8DF-9D47BE2896FB@condition-alpha.com> Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEfmk-0003m2-VH for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 15:22:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEfmh-00043V-Qh for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 15:22:42 -0400 Received: from smtprelay06.ispgateway.de ([80.67.31.95]:37119) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gEfmh-00041Q-Ik for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 15:22:39 -0400 Received: from [46.244.207.72] (helo=hyperion.fritz.box) by smtprelay06.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gEfme-0006VE-UR for emacs-orgmode@gnu.org; Mon, 22 Oct 2018 21:22:36 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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))) ----------------------------------------------------------------------