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

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

Re: Re- text formating


From: Jean Louis
Subject: Re: Re- text formating
Date: Wed, 8 Feb 2023 02:14:35 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* 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/



reply via email to

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