all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Coding system to encode arguments to groff?
@ 2021-09-29  8:01 Tim Landscheidt
  2021-09-29 12:02 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Landscheidt @ 2021-09-29  8:01 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-03 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-29  8:01 Coding system to encode arguments to groff? Tim Landscheidt
2021-09-29 12:02 ` Eli Zaretskii
2021-10-03 13:14   ` Tim Landscheidt
2021-10-03 15:14     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.