From: Alexander Adolf <alexander.adolf@condition-alpha.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: [feature proposal] Export in foreign buffers - ASCII (ox-ascii)
Date: Wed, 24 Oct 2018 19:03:35 +0200 [thread overview]
Message-ID: <15D92B2B-9EA8-4EF2-BB6F-86760635303C@condition-alpha.com> (raw)
In-Reply-To: <87mur3ygdi.fsf@nicolasgoaziou.fr>
Hello Nicolas,
Many thanks for your swift response!
On 2018-10-24, at 09:04 , Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> [...]
> I see you are not including Latin1 export. Is there any reason to
> implement pure ASCII export? Wouldn't UTF-8 be sufficient?
>
> 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))
> (org-export-replace-region-by 'ascii))
>
> 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)))
----------------------------------------------------------------------
next prev parent reply other threads:[~2018-10-24 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 19:22 [feature proposal] Export in foreign buffers - ASCII (ox-ascii) Alexander Adolf
2018-10-24 7:04 ` Nicolas Goaziou
2018-10-24 17:03 ` Alexander Adolf [this message]
2018-10-25 14:56 ` Nicolas Goaziou
2018-10-25 15:07 ` Alexander Adolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15D92B2B-9EA8-4EF2-BB6F-86760635303C@condition-alpha.com \
--to=alexander.adolf@condition-alpha.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).