From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Gillespie Subject: Re: [PATCH] Fix verbatim block fontification to end blocks on headlines Date: Tue, 17 Dec 2019 20:38:14 -0800 Message-ID: References: <87y2viq6lw.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000e7dee20599f303ed" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55487) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihR6U-0002l5-AE for emacs-orgmode@gnu.org; Tue, 17 Dec 2019 23:38:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihR6S-00087V-DC for emacs-orgmode@gnu.org; Tue, 17 Dec 2019 23:38:29 -0500 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:39743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihR6S-00083m-0l for emacs-orgmode@gnu.org; Tue, 17 Dec 2019 23:38:28 -0500 Received: by mail-lf1-x143.google.com with SMTP id y1so651400lfb.6 for ; Tue, 17 Dec 2019 20:38:26 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --000000000000e7dee20599f303ed Content-Type: text/plain; charset="UTF-8" Hi, Here is the updated patch, including the fix to only trigger on actual headlines (and not bold or similar), the readability improvement for beg-of-next-line and a fix to call point-max only once per branch. I also switched all the regex over to use the rx macro. I left out the tests because since they would entail quite a bit of additional work that is out of scope for this patch. The rx changes mean that the patch is now over the tiny change limit, I went ahead and sent a request to assign@gnu.org so we don't have to wait around if things look good. Best, Tom --000000000000e7dee20599f303ed Content-Type: application/x-patch; name="0001-org.el-Fix-verbatim-block-fontification-to-end-block.patch" Content-Disposition: attachment; filename="0001-org.el-Fix-verbatim-block-fontification-to-end-block.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k4as6wo40 RnJvbSA4YzM2ZmZhODJjMTM4MDU3YTAzYzgxM2FhMGM3NjE2ZjA0NzQ0YTcyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBUb20gR2lsbGVzcGllIDx0Z2J1Z3NAZ21haWwuY29tPgpEYXRl OiBXZWQsIDExIERlYyAyMDE5IDE3OjU3OjQ3IC0wODAwClN1YmplY3Q6IG9yZy5lbDogRml4IHZl cmJhdGltIGJsb2NrIGZvbnRpZmljYXRpb24gdG8gZW5kIGJsb2NrcyBvbiBoZWFkbGluZXMKCiog bGlzcC9vcmcuZWwgKG9yZy1mb250aWZ5LW1ldGEtbGluZXMtYW5kLWJsb2Nrcy0xKTogRW5oYW5j ZSByZWdleApmb3IgZmluZGluZyB0aGUgZW5kIG9mIGJsb2NrcyAoaS5lLiwgYGJlZy1vZi1lbmRs aW5lJykgdG8gZGV0ZWN0CmhlYWRsaW5lcyAoaS5lLiwgKHJ4IGJvbCAob25lLW9yLW1vcmUgIioi KSBzcGFjZSkgc28gdGhhdCBmb250aWZpY2F0aW9uCm1hdGNoZXMgdGhlIGJlaGF2aW9yIG9mIG9y ZyBtb2RlIChpLmUuLCB0aGF0IGhlYWRsaW5lcyBhcmUgaGVhbGluZXMsCmV2ZW4gaW4gdmVydGFi aW0pLgoKVGhpcyBjaGFuZ2UgYWxpZ25zIHRoZSBiZWhhdmlvciBhbmQgdGhlIHZpc3VhbCBhcHBl YXJhbmNlIG9mIHZlcmJhdGltCmJsb2NrcyB0aGF0IGNvbnRhaW4gaGVhZGxpbmVzLiBXaGVuIGBm b250LWxvY2stbW9kZScgaXMgZW5hYmxlZCB0aGlzCmNoYW5nZSBtYWtlcyBzaXR1YXRpb25zIGxp a2UgdGhvc2UgaW4gKGluZm8gIihvcmcpIExpdGVyYWwgRXhhbXBsZX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