From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Re- text formating Date: Wed, 8 Feb 2023 02:14:35 +0300 Message-ID: References: <82d4febc-c8f9-06be-e2a8-c3967fb70a2e@posteo.de> <428aaeeb-eb6e-03b7-32ec-60298b8f9e39@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18118"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: Gottfried , "help-gnu-emacs@gnu.org" , incal@dataswamp.org To: Daniel Fleischer Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 08 00:19:52 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPXFg-0004Us-OP for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 08 Feb 2023 00:19:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPXF2-0007e0-0d; Tue, 07 Feb 2023 18:19:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPXEw-0007cu-5H for help-gnu-emacs@gnu.org; Tue, 07 Feb 2023 18:19:06 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPXEu-00082k-6r for help-gnu-emacs@gnu.org; Tue, 07 Feb 2023 18:19:05 -0500 Original-Received: from localhost ([::ffff:197.239.15.228]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000103950.0000000063E2DC6A.00005100; Tue, 07 Feb 2023 16:19:05 -0700 Mail-Followup-To: Daniel Fleischer , Gottfried , "help-gnu-emacs@gnu.org" , incal@dataswamp.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142648 Archived-At: * Daniel Fleischer [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/