From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Adolf Subject: Re: [feature proposal] Export in foreign buffers - ASCII (ox-ascii) Date: Wed, 24 Oct 2018 19:03:35 +0200 Message-ID: <15D92B2B-9EA8-4EF2-BB6F-86760635303C@condition-alpha.com> References: <8422BCDC-5B51-417D-B8DF-9D47BE2896FB@condition-alpha.com> <87mur3ygdi.fsf@nicolasgoaziou.fr> 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]:58518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFMZL-0002LS-U8 for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 13:03:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFMZI-0007du-OT for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 13:03:43 -0400 Received: from smtprelay05.ispgateway.de ([80.67.31.98]:14727) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFMZI-0007cD-F1 for emacs-orgmode@gnu.org; Wed, 24 Oct 2018 13:03:40 -0400 In-Reply-To: <87mur3ygdi.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hello Nicolas, Many thanks for your swift response! On 2018-10-24, at 09:04 , Nicolas Goaziou = wrote: > [...] > I see you are not including Latin1 export. Is there any reason to > implement pure ASCII export? Wouldn't UTF-8 be sufficient? >=20 > More generally, I wonder if, in 2018, it still makes sense to provide > ASCII-only and Latin1 export. I was of the same opinion, hence I didn't include Latin-1. Is pure ASCII still useful? I admit using UTF-8 99% of the time. But = sometimes there's the odd guy using that arcane email client and who = complains that my message came out garbled. That's when the pure ASCII = comes in handy. That will always work; 100% guaranteed. No strong feelings on whether to include pure ASCII or not. On the other = hand, it seems so cheap implementation wise, you might just as well = choose to include all three (i.e. UTF-8, ASCII, and Latin-1). > [...] > (let ((org-ascii-charset 'utf-8))=20 > (org-export-replace-region-by 'ascii)) >=20 > would be simpler. Bummer! This was my initial version, actually. But for some reason it = didn't seem to work (maybe I forgot eval-region?). You are right (of = course), and I have switched my implementation back to my original = approach (which copied below for completeness). > The manual needs to be updated, too. > [...] Indeed. Many thanks again and cheers, --alexander ---------------------------------------------------------------------- (defun org-ascii-convert-region-to-ascii () "Assume the current region has Org syntax, and convert it to plain ASCII. This can be used in any buffer. For example, you could write an itemized list or a table in Org syntax in a mail buffer and then use this command to convert it." (interactive) (let ((org-ascii-charset 'ascii)) (org-export-replace-region-by 'ascii))) (defun org-ascii-convert-region-to-utf8 () "Assume the current region has Org syntax, and convert it to UTF-8. This can be used in any buffer. For example, you could write an itemized list or a table in Org syntax in a mail buffer and then use this command to convert it." (interactive) (let ((org-ascii-charset 'utf-8)) (org-export-replace-region-by 'ascii))) ----------------------------------------------------------------------