From: Jean Louis <bugs@gnu.support>
To: Daniel Fleischer <danflscr@gmail.com>
Cc: Gottfried <gottfried@posteo.de>,
"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
incal@dataswamp.org
Subject: Re: Re- text formating
Date: Wed, 8 Feb 2023 02:14:35 +0300 [thread overview]
Message-ID: <Y+LbWxbKywQFyRH/@protected.localdomain> (raw)
In-Reply-To: <m2r0v1zh96.fsf@gmail.com>
* Daniel Fleischer <danflscr@gmail.com> [2023-02-07 17:24]:
> It's an interesting question. In order to think about it you need to
> expand the context. Say there's a mode that combines text with
> formatting. How are you going to save this on file? Which format?
> text/enrich is ancient and looks like html so it's not easy to read
> outside Emacs.
26.14 Enriched Text
===================
Enriched mode is a minor mode for editing formatted text files in a
WYSIWYG (What You See Is What You Get) fashion. When Enriched mode is
enabled, you can apply various formatting properties to the text in the
buffer, such as fonts and colors; upon saving the buffer, those
properties are saved together with the text, using the MIME
‘text/enriched’ file format.
I do not quite agree that it is what you see is what you get.
I also do not agree it is ancient just because it was created long
ago.
Default text is something easiest to write letter, position the
address, date, subject, it is easiest to write corporate resolution,
articles and memorandum of understanding, notices, demand letters,
invoices.
That some people stop using simple for reason that commercial programs
advertise their templates, still does not diminish usefulness of
simple text, and also of enriched text.
But it can definitely be used for beautiful printing with bold,
italic, line centering, those basic text properties.
All what I want is to parse those text properties, translate to Pango
and then have `paps' print it.
For example, from enriched text:
hello there
(buffer-string) ➜ #("
hello there
(buffer-string)" 0 1 (rear-nonsticky (hard) hard t) 1 12 (face bold)
12 13 (rear-nonsticky (hard) hard t face bold) 13 28 (face bold))
I would like to map above to this:
https://docs.gtk.org/Pango/pango_markup.html
But where do I find explanation of "read-nonsticky"? or (hard) hard?
I find it as sex joke.
(rear-nonsticky (hard) hard t)
Back to business.
When I use `M-x describe-text-properties' I get for example:
There are text properties here:
hard t
rear-nonsticky (hard)
I cannot know what to do with "hard", wand "rear-nonsticky", how
should I translate that to Pango?
Any idea?
Should I parse chunk by chunk like word?
Or character by character?
Or by (buffer-string) how it is defined inside?
Is there any function that parses buffer-string text properties that I
can reuse?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
prev parent reply other threads:[~2023-02-07 23:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-05 17:22 Re- text formating Gottfried
2023-02-06 12:56 ` Emanuel Berg
2023-02-07 10:00 ` Jean Louis
2023-02-07 10:57 ` Gottfried
2023-02-07 14:23 ` Daniel Fleischer
2023-02-07 23:14 ` Jean Louis [this message]
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+LbWxbKywQFyRH/@protected.localdomain \
--to=bugs@gnu.support \
--cc=danflscr@gmail.com \
--cc=gottfried@posteo.de \
--cc=help-gnu-emacs@gnu.org \
--cc=incal@dataswamp.org \
/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.
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).