From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OEbDLP4Re2UwCwAAkFu2QA (envelope-from ) for ; Thu, 14 Dec 2023 15:32:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id yJnwJf4Re2UUBwAAqHPOHw (envelope-from ) for ; Thu, 14 Dec 2023 15:32:30 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=oXgtbiVb; 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=1702564350; 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=VD8kvXoC2eHSBCbTVQFTOc+kZ45FynlKzxNqH00XNtQ=; b=VVlsFIdELmrFdWjKiCBWA7un/ihHH1XPx3Z21+ZqjW1nrKaZO9gbpcM7bqn0kREJIVqJLb aRl5A1quxeyIjEWs5iAIPd/PRN71HmPnP4tsi8R0vDFajwY0P5q49AY+f2ddMD5ltdAz+d FBRxtgc8QeBYNaH3ZLQ/SlIeIap2FcYTo7kuT5ydv7vhVg76Ge179b+HYn67XRjdTGhz4P PAGLGegWroxnqKKZ2F/f0vSQbBcHFqFy+Ai9MeSxVHn0PZZlriO3al2EoGUJIPPoT69sKX D9DdDSGMj/hbsB6pEEkgfQFnvKrnSzItiVzFLqJ3yLcSGIUX4CEC0/oOymyLPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702564350; a=rsa-sha256; cv=none; b=fkbIJPLrJRLsuCNSkngMnwfjlbBNEd4eruwhAmEsm4XoZ0jVhJwxneDq266YMUevUeX7wr MI0ofeZ8V+HVPWSjl7MjWSmX3KEaqf3lztGBjUxl2sca47m3H89zz3r27KRJWJKCEBqch6 KwIiecdQdzqNepkWQuaACDk3Ewirjojqg7JdMvFasz6gGTeVfG5r6vuWwGtoy86s0wu6k0 q/KpaP3ZDJHP/i+z1QN19HC9rtFPYdo6wsqq4M6wVZAOWn6LMECR+QNUopt1Q4VeReDI+U sB4CPtgZa1gGlx11O7dCEZhcEIOrhV3ZWVfxY0wvAX8WhrH51VPOviP3asYc/g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=oXgtbiVb; 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 EBF3A65109 for ; Thu, 14 Dec 2023 15:32:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDmkS-0007En-Jf; Thu, 14 Dec 2023 09:31:36 -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 1rDmkP-0007EK-VR for emacs-orgmode@gnu.org; Thu, 14 Dec 2023 09:31:34 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDmkN-0003VR-5w for emacs-orgmode@gnu.org; Thu, 14 Dec 2023 09:31:33 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B2AE6240101 for ; Thu, 14 Dec 2023 15:31:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702564288; bh=ZVnWk+BpR+sRAgSVxYsJa8iaytjEOcSGHfJRWk4w78o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=oXgtbiVb4DMxMl0D7AfMaEJS9Ve2sfwqzCNlnM1Aq4nbi+L9qJwzifB4wzb3yCWwT fLhaKdEUMaH0L4W3c+tn9hWUOG47jTuWMizvskM3PbJkJlwiVbE+zu0JO/KMspEo0I /NVvpqiU0McPbf7hIWKBi4d9tQNb6kkOTICl0/7HwXBfjxeB940yJ7q/HljcNMrV1d oK8hBMQBmA6dIBDKjdjpFOX8yOV0ibIFQOGT/h6v9YRTsRjvO+LieZt6a+PtNcAQap ctb4Mq6I7WD4Jrwmw8REgkascWt/TZgnr7OiG81PAgnDMueCPKhXwJUOOsACgWynP9 QwocE/gDoFy4g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SrZXw2hnJz6twR; Thu, 14 Dec 2023 15:31:28 +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: <87msvcgjgv.fsf@gmail.com> References: <874jpuijpc.fsf@gmail.com> <87y1n6igvo.fsf@localhost> <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> Date: Thu, 14 Dec 2023 14:34:35 +0000 Message-ID: <87le9wq2dg.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: -9.41 X-Spam-Score: -9.41 X-Migadu-Queue-Id: EBF3A65109 X-Migadu-Scanner: mx12.migadu.com X-TUID: fjfOTSfyieSH Nathaniel Nicandro writes: > Attached is the updated version of the patch. I've also attached an > updated file that I've been using for testing the feature. Sorry for the late reply, and thanks for the patch! It runs fine on my side, although I am not sure if things are working as expected for all the cases. For example, headlines never got fontified on my side when I tried your patch on top of the latest main branch. Also, it looks like you simply made the ASCII sequences invisible, which causes funky behaviour when trying to edit the text around. What we may need instead is something similar to hidden parts of the links that get revealed when we try to edit the invisible text. See `org-catch-invisible-edits' variable and the functions that examine it. > What I have is essentially a function, org-fontify-ansi-sequences, that > scans the buffer for an ANSI sequence and depending on the > element-context processes the region that should be affected according > to the rules you stated (see above). The org-fontify-ansi-sequences-1 > function scans the buffer element-wise and processes the appropriate > regions of the elements, even if no sequences appear in those regions, > according to an ansi-context. This is to support the fourth rule you > mentioned. > > Note that modifications to highlighted regions hasn't really been > considered so if you have a scenario like > > #+RESULTS: > - Paragraph one > - Paragraph two > Line 3 > > where the sequence affects everything down to "Line 3" and you make a > modification to line three, the fontification due to the sequence > disappears on that line. You may use `org-fontify-extend-region' to handle such scenarios if you mark the ANSI highlights with a special text property. > Also note that lesser elements contained in greater elements that > don't have a RESULTS keyword are handled at the lesser element level > so if you have something like > > #+begin_center > Paragraph one. > > Paragraph two. > #+end_center > > It would be the same as if you just had the paragraphs without the > greater element. Sounds reasonable. P.S. I am not yet commenting on the details in the code. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at