From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kGriMRcwBWagRQEA62LTzQ:P1 (envelope-from ) for ; Thu, 28 Mar 2024 09:53:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id kGriMRcwBWagRQEA62LTzQ (envelope-from ) for ; Thu, 28 Mar 2024 09:53:43 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=b32QCH1J; 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=1711616023; 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=hnV9nLZHgGDJh8EkuQ0UG4x7htYrTM06FaYeeoijHxQ=; b=qkK3JeSRL371tAO3MtxOVmcQZGjp748hUMzvz3BMWSd1F4JaEvCKTne3QeJ8H6gmk+h33U /VvLKjbG64vSl5br/X2ahRdItClAsmQHlou1aElTWZCpcNLbQbaJlGQtvjjjTX1n9d0oDg fKtzuJZqCWW1H52NfSkHUxMaoRJD7aEgSNyskO95uiO0lNJQsyuWRMO8vAYwDXdzSg74+E Q5/TJl05mOq0/yOGk3Em1tvZdYjTZUQko0OwcQKBS53T6uEdEmR0FO6IkFu1d1UyZnVlrN oT3u7ZP6wrEEII1w09RoWs4aWdpvpQHu/zLdfIyDXI7F8ShjXeECAS1MAC/EoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=b32QCH1J; 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-Seal: i=1; s=key1; d=yhetil.org; t=1711616023; a=rsa-sha256; cv=none; b=ObJxjTp6vy1Ve5bfLn0JUwxlqa7easa/cWjds3TRSlAXLOT7JQFE9ldQjtCnNKfNJjxHTC 93sXpRe5917j29pYmbwdP3bbkBAXARH9/6VS22smwWQQmlJ+3/urMnRKOlHElV5sh3y57y HA/0vupPf9FZMxPTMnW3+TSS0vrmXynFfRUtmr1D09VOleStlmDbBmgpX/qxMZx07zPDHJ CnHr4COeqwI6vZr0Iz9yGqKZD4kS3Om8iMOD2ea2cyxC+lczQxLuqJNykhlens5AlOQBp0 Xmw7slvEeiZ3cW2iQ1EQnkaLUVYjwNWMjZK+7DXt6g6oVhqj95leX4USWx311Q== 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 5CD1D742C6 for ; Thu, 28 Mar 2024 09:53:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rplVG-0000JG-HR; Thu, 28 Mar 2024 04:52:54 -0400 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 1rplVE-0000Io-71 for emacs-orgmode@gnu.org; Thu, 28 Mar 2024 04:52:52 -0400 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 1rplVC-00081o-3U for emacs-orgmode@gnu.org; Thu, 28 Mar 2024 04:52:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1736A240105 for ; Thu, 28 Mar 2024 09:52:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711615968; bh=LLahJOPI+HTqRug5nTFmwtYdU36Q0I5VLEXe+v6OdJQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=b32QCH1JGdM7LfBQSgF0Uwx/DWv1WVZjBlFv4EVQ0PyO5thwhYBdWZIhpEkkptPVv E/6jUZNGq+1SBzD6WrYHLkvd8h3NPgU4QYxGghIzfvVpDk59hg62UOdp33CZDcC6QI W25eP6m0VXCkjXUHctfYt46UZU+NNmcRNWT57d5dX8YWaRMHh9HCZuc1xVxTOgnZZh KVtHPL647HFKDph0LpSkH05H1oU30nxkU/VMoOW/jHkssVR6JDaVy5kcD1ngWGEdME dn0lZ+cFoY48E13LBsEnsTvN1kpud5apmKc54nHGPQZIkejgkykHJVctBIlf97cD0g QxTP9wBXAChig== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V4y3g1723z6tvt; Thu, 28 Mar 2024 09:52:46 +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: <87plvhf5gf.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> <87le9wq2dg.fsf@localhost> <8734uwhlhj.fsf@gmail.com> <875xzsjfvo.fsf@localhost> <87plvhf5gf.fsf@gmail.com> Date: Thu, 28 Mar 2024 08:52:45 +0000 Message-ID: <87msqid9gi.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_H4=0.001, RCVD_IN_MSPIKE_WL=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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 5CD1D742C6 X-Spam-Score: -6.01 X-Migadu-Spam-Score: -6.01 X-Migadu-Scanner: mx10.migadu.com X-TUID: VhpFJlwqUdn9 Nathaniel Nicandro writes: > Feedback appreciated! Thanks for the update! > I've finally implemented a solution to what I've discussed previously, > inserting zero width spaces as boundary characters after an ANSI > sequence to act as a separator from the text after the sequence. This > would handle the scenario where deleting into the end byte of a > sequence causes ansi-color to recognize the partially deleted sequence > plus the character directly after the end byte to be a new sequence. > This looked like the invisible region containing a sequence eating up > other characters not intended to be part of the region. > ... > So the implementation of that rule of maintaining a zero width space > after valid sequences and the rules around deleting into the space or > insertion in front of a space are the main changes in this patch > compared to previous versions. This is very fragile. I believe that hooking into `org-fold-check-before-invisible-edit' would lead to simpler implementation. I also do not like the idea that fontification code modifies the buffer. I tried your latest patch with test-ansi.org file you shared earlier: 1. Open the file and move to the end of the headline "Greater elements" 2. 3. Observe fontification extending past the title. I also edited it around in various places and I managed to trigger parser errors when the parser lost track of the modifications. This was presumably because your patch edited the buffer. I also observed strange glitches and hangs when I tried to surround an ANSI-colored region like =[42mtask 1[0m= and then edited near the boundaries. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at