From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IJ8pK+1iYGc1OgEAqHPOHw:P1 (envelope-from ) for ; Mon, 16 Dec 2024 17:27:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IJ8pK+1iYGc1OgEAqHPOHw (envelope-from ) for ; Mon, 16 Dec 2024 18:27:09 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=b0vmJdpW; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734370029; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QAOI+MUYDH8HNFTSANMdVb8Lt2AuSGsODNhxcRA4eqw=; b=FDguV0eWT4LDQdtkKbsrZjWOEjh1GWfnIA0e9WcZERbWzekANIYOT+ldlqtQE0gWJALwcB 1jbOV+SVeeQrybxYenyD4ek25Kkqzcb+WLLnUQs2eT5KdqBI+ie9bC1EZep6cvkDPBCPGn hAYmXA4HyqfaOr/6o1Pm4UizBouJd+DAxlvf2h0Snzk/7uHaz6zds/KcburWl1SY3ZrEqX l9Ukpzj30RTpiTOHOD6e+Hj1SY6c3rcexWPTLqZi/Cuf/EEtbJnEKFzYBQpbkSvGCRf/vp k97GCY638CR1zXy1TQrVjwiRe8mlHuZsy624MiJox9NHdHRhT9NyTcF3cADq2w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734370029; a=rsa-sha256; cv=none; b=L5swMJDtRGlssI/nLm+SQ8z7xVXfLpKTP0zrnhCPB8QkK6kgOIm2ARo2o3d11ceyzYrNsj YkudsrHJaZulcBHtNJeHpOqK1yADX7xniDM8iyimK7nPOOKFztgqOEheN+SNowHnOlzsv3 45Lxde3MDWcCz2WKVIGugNhb6Smas+BGZtSBHl+sNNxksuMlzwkCnha2K+bdVK4UCFHCsR DH6y2eUn2kZmX4pHGejIJGliHJ9GNq39ytSMoVV3oqmSj3LmOwmnt38ENsmK5CURfFZmtv Ch/HOjeSotq6+lebEpXtuWK/l2jzDBlXDGnJAl2rvihDUdh5vU3ISqDgNELI5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=b0vmJdpW; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 81EA74453A for ; Mon, 16 Dec 2024 18:27:08 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNErL-0007IO-3Z; Mon, 16 Dec 2024 12:26:19 -0500 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 1tNErH-0007I2-NX for emacs-orgmode@gnu.org; Mon, 16 Dec 2024 12:26:15 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNErD-0001aw-R7 for emacs-orgmode@gnu.org; Mon, 16 Dec 2024 12:26:15 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 67CD3240027 for ; Mon, 16 Dec 2024 18:26:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1734369966; bh=x054isVVtnAcH2C2EHLcdkl69mN90kzSIySEfeOTh9s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=b0vmJdpWsAsDJQCCf+oj9z6pdIzTC4SN7kphx0NbjamlLZ6LjkMUawzOFp1QJjIZ9 flhVUgkNvmpSxXtVDL8sT9Izs5C4JkZFDVVa1bN9hN1R+ghHnyIJ9KDBqJ3/xExY/b VmRLDJ6yTrzeiN67CkB8vDNn12yHENTiLGcgTNvXNNzbaOXUJ7hjMm4X19S22nBCZu PjPEaDZYJQTcjlebJ5tKP/702D61x9/KzOW61CC8UpfvKFLxDLvy0B3OUQ7LfL4Tpn wfWaJ9UjT3k2pNZdvtGBC+LUhrOte26BtAhUo3j3hpbfk0HWIHBBjCd90E1o6+tyBu ZLNeh96e3hMIQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YBn0Y2NSTz9rxF; Mon, 16 Dec 2024 18:26:05 +0100 (CET) From: Ihor Radchenko To: Nathaniel Nicandro Cc: emacs-orgmode Subject: Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] ANSI color on example blocks and fixed width elements) In-Reply-To: <87plmbygp4.fsf@gmail.com> References: <874jpuijpc.fsf@gmail.com> <878rev1q0k.fsf@gmail.com> <877cueonkj.fsf@localhost> <87zg6dez93.fsf@gmail.com> <871qjobhwa.fsf@localhost> <877ct5fzt6.fsf@gmail.com> <87a5y1mnj0.fsf@localhost> <87msvcgjgv.fsf@gmail.com> <87le9wq2dg.fsf@localhost> <8734uwhlhj.fsf@gmail.com> <875xzsjfvo.fsf@localhost> <87plvhf5gf.fsf@gmail.com> <87msqid9gi.fsf@localhost> <87bk3kuj20.fsf@localhost> <87wmm5yn1m.fsf@gmail.com> <87jzhy8x9y.fsf@localhost> <87ikx3zl8j.fsf@gmail.com> <877cdgndyj.fsf@localhost> <871pz9zc0d.fsf@gmail.com> <871pz1apky.fsf@localhost> <87plmbygp4.fsf@gmail.com> Date: Mon, 16 Dec 2024 17:27:21 +0000 Message-ID: <87a5cvedxi.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.95 X-Spam-Score: -8.95 X-Migadu-Queue-Id: 81EA74453A X-Migadu-Scanner: mx11.migadu.com X-TUID: QupWiAgHvGD1 Nathaniel Nicandro writes: > Ihor Radchenko writes: > >> I will need some time to review the patch. It would be helpful for the >> review if all the functions had a docstring and the data structure for >> CONTEXT were described in commentary. > > Attached is an updated patch with all functions documented and more > comments about the CONTEXT. Thanks! This is getting really complicated. Looking at your code, I can see that you are basically re-implementing what I have done in https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-font-lock-core.el#L220 and in https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-element.el#L4580 There are also problems I do see, like unnecessary special cases handling fixed width - affiliated keywords may be present in many more elements, which your code may fail with. There may be more. I feel that the right approach would be implementing generic parser-based fontification first, and then using its APIs for ANSI fontification. But I have no idea when I can have more hours in the day to actually work on that feature branch. What about the following idea: 1. To make use of the working code you provided, let's split it up into an ELPA package. It seems to be possible. 2. When we get the parser-based fontification with finalized APIs, we can come back to merging your code upstream. WDYT? -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at