From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uJ+IAbyvm2H6hQAAgWs5BA (envelope-from ) for ; Mon, 22 Nov 2021 15:57:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yInUOLuvm2FDXwAAB5/wlQ (envelope-from ) for ; Mon, 22 Nov 2021 14:56:59 +0000 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 A617D2362B for ; Mon, 22 Nov 2021 15:56:59 +0100 (CET) Received: from localhost ([::1]:53502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpAkc-0000uQ-Ed for larch@yhetil.org; Mon, 22 Nov 2021 09:56:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpAhS-0006Wq-R0 for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 09:53:42 -0500 Received: from [2607:f8b0:4864:20::102b] (port=54924 helo=mail-pj1-x102b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpAhR-0006dc-70 for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 09:53:42 -0500 Received: by mail-pj1-x102b.google.com with SMTP id np3so14040591pjb.4 for ; Mon, 22 Nov 2021 06:53:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=fjaNMy5Q75gOnIsNKr/j7Df1ema2TTfKaVS/F7SW3zk=; b=hQ3mM5NAb6iygP8a0THiTib3d2YHut6eSejaZrnVN4IkfysIYX6ZkPV0r2uGG/SdaF Xl24Z7Rm06xhhVExGF+MvenCWlZJD3HcgP0oGMBucPWQSJZDy0+YQJZK4cI+hcqgHRA+ bAKcUnc2ToTzR2Gl1v9cuwP3YmkHAutIBNcVz5EG/c94G+q2a6GznrHRNt6Y13dEKQiV /wNh250eaXwJ8bbdlfLmjXhxV53jXI6b/xirnwQmAk+EAPZ6iYoKhhnniak32rN85BkF WERrSvSPUeETTlR3IRphwrxBOXLogFeR+wXHZwaCSD2fMuNKBdtRdOeOBYt5At3jxvby gX7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=fjaNMy5Q75gOnIsNKr/j7Df1ema2TTfKaVS/F7SW3zk=; b=MriejmGIzk4etsMAB21YWOmcFSZEy/qLlzqar35Geo9bg2PNkDyoLA0g3/T/kkx4wj d0QooaSXLykLoLltvm2IU9hZQ90kb6cYf8CJnmScJTRW6jzp+pDwv9ApihcO0IAO2DLr 6/A7UCpeoKFLhWp9ltaCx478GThstvhtYsMWfvT80AAFljYn7yvvUQk2g/noi5rh3mas kDdZgr+rbEE/Meznb0VC0pxtH5UQGMcAvfnjubxmdX+W+06cSvyBkqxclbXIKYXWvJLD 4PdcYBanBF0CieL5RR1blMoKimjke1G0TgLiXJb+8Nhb4REUq5qQD4GAleKxn3gHSGFH VwiA== X-Gm-Message-State: AOAM532HWpcAEduAYdKgfqYiFe6FSIZieN1cU7RxONy0wrWtGt/ZkX/V JuCN6YAkxQO8g0OJRYS0I2oHp5KEFh8= X-Google-Smtp-Source: ABdhPJx0GxvcWPQ0n5oOfh0tRNhvc5ras0llvEiP6DBtchXnVgJk0qC7Kfji0RkQLxIn1qdqY41B8A== X-Received: by 2002:a17:902:f283:b0:141:f719:c434 with SMTP id k3-20020a170902f28300b00141f719c434mr105625503plc.79.1637592819392; Mon, 22 Nov 2021 06:53:39 -0800 (PST) Received: from localhost (61-245-128-160.3df580.per.nbn.aussiebb.net. [61.245.128.160]) by smtp.gmail.com with ESMTPSA id t2sm9318523pfd.36.2021.11.22.06.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 06:53:38 -0800 (PST) From: Timothy To: Ihor Radchenko Subject: Re: [PATCH] Fontification for inline src blocks Date: Mon, 22 Nov 2021 22:37:23 +0800 References: <87pmzf4bd0.fsf@gmail.com> <87o86d7g05.fsf@gmail.com> <875ysk76bo.fsf@gmail.com> <87a6hwpeew.fsf@localhost> <87zgpw5lt9.fsf@gmail.com> <87k0h0b6mv.fsf@localhost> User-agent: mu4e 1.6.9; emacs 28.0.50 In-reply-to: <87k0h0b6mv.fsf@localhost> Message-ID: <87y25g5jip.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x102b.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637593019; 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=fjaNMy5Q75gOnIsNKr/j7Df1ema2TTfKaVS/F7SW3zk=; b=ZRERGpsqIje2rjhH1gTWJNqXLiipBUUkt7dLkwQcsG2Ty2vSLgE+oNDMIsPdqRQU0/KEUC uht0s+kn6l1U5K84cKtCzYEoJjUwQO8vH6mCmUvEISqAulsdEr5RotvkgI7rZPPBTpdwDT isV1TYdNSBpnWCnQRYhr6IQ2745onLwWVPOeWzbmDuIgENDVNe/oXx+OrOk/eLjT1RvJOE odBhXV7NmCnnpJuLQl8RkWrsCSctrgZtn0JTd8scPYnRzuZW8hr+svAp8TPVAcwIf94CvL pARbU124akClQiw1Y6OaA4CQc+ULCegshF3dIX5onftpa8YDLayGhIAbCQVvfQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637593019; a=rsa-sha256; cv=none; b=GSI9xbuN9Cj4KRUtyAwnNGleCQPvjD/TA5+HozMDb+W/isKhhky2YPQC/thX7UI6ZMHX6Z 6hVKY3hWH3vmkhkrpEVD+IcqlWdR87pwvZ1IDKF2LIp+DOVR8b9+SkQ8mZtroqEH5wka77 aaV13xpBkO7Ljt9kTbTkZNklHSD185PJm5L4TD7rLDpxNMaceR862tHGh7UXZGmkJTzj+1 AycvC9HX+h3wO1eJFmPXhF09b484ZsVGmT6SnvMSE8QBi4OdRUAwgBCmZFzGJDTnibPz9G rMXrhFZ4PAZjin/6lMQPFi5GgbBPkEHejRYpqOBUX/pzVSJnxhXpZ1IIGOaZxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hQ3mM5NA; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -3.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hQ3mM5NA; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: A617D2362B X-Spam-Score: -3.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7Z0FM6moJOAB --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ihor, >>>> org-inline-src-fontify-max-length >> The description may need updating, as that=E2=80=99s a tad inaccurate. T= hat value >> actually limits how far forwards a paired paren is searched for. There= =E2=80=99s no >> spurious fontification. > > I can see the purpose. However, it still looks like overcomplication. > org-element-context takes care about this issue simply by narrowing to > current element (inline src block is an object and hence must end within > current element). Well, one simple change we could do is just replace org-inline-src-fontify-max-length with the addition of `(save-excursion (search-forward "\n" limit nil) (point))' to the restriction. >>> It looks like you are repeating the job of org-element-context here. Why >>> don=E2=80=99t you just get the proper object? >> >> IIRC `org-element-context=E2=80=99 doesn=E2=80=99t separate out the `src= _=E2=80=99, `lang=E2=80=99, `[options]=E2=80=99, and >> `{content}=E2=80=99 of an inline source code block (which we want). > > Sounds like an omission in org-element-context. At least, the parser > could return :contents-begin and :contents-end. Then, you would also not > need to re-implement the parser. Perhaps. However frankly I don=E2=80=99t think it would do that much to red= uce the complexity, and what=E2=80=99s in this patch seems to work fairly nicely. All the best, Timothy --=-=-=--