help-gnu-emacs
[Top][All Lists]
Advanced

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

Coding system to encode arguments to groff?


From: Tim Landscheidt
Subject: Coding system to encode arguments to groff?
Date: Wed, 29 Sep 2021 08:01:12 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi,

I pass text arguments from Emacs Lisp to a groff command
with the "-d" option.  For ASCII strings, this is trivial;
for strings with umlauts, I need to use:

| (encode-coding-string variable-to-pass 'iso-latin-1)

For strings with other Unicode characters like "–" (#x2013),
I need to call groff's preconv like:

| (shell-command-to-string (concat "preconv -r <(echo " (shell-quote-argument 
variable-to-pass) ")"))

which for "ä–ö" returns something like:

| \[u00E4]\[u2013]\[u00F6]

Now in Emacs, this looks very much like what a coding system
would do.  The info documentation for elisp just laconically
says:

|    How to define a coding system is an arcane matter, and is not
| documented here.

Has someone implemented such a coding system for groff so
that something like:

| (encode-coding-string variable-to-pass 'x-groff)

would do what is needed?

TIA,
Tim




reply via email to

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