From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +E8wMpf6m2BRTAAAgWs5BA (envelope-from ) for ; Wed, 12 May 2021 17:56:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4CLoLZf6m2BeCgAA1q6Kng (envelope-from ) for ; Wed, 12 May 2021 15:56:07 +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 F209010AB2 for ; Wed, 12 May 2021 17:56:06 +0200 (CEST) Received: from localhost ([::1]:45454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgrDS-0001mt-40 for larch@yhetil.org; Wed, 12 May 2021 11:56:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgr6n-0001Ty-Qg for emacs-orgmode@gnu.org; Wed, 12 May 2021 11:49:16 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]:39584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgr6b-0002CE-D5 for emacs-orgmode@gnu.org; Wed, 12 May 2021 11:49:10 -0400 Received: by mail-oo1-xc34.google.com with SMTP id t17-20020a4a3e110000b02901fab2f46a48so5045384oot.6 for ; Wed, 12 May 2021 08:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=YLhAmLnL7maGQnq6irNiQVWSxdNCYpUgMyRWB5BMQ+E=; b=d9wbObZB5uOOBfhl5U2iJfz8LMXEimkdR6L2tdGfEmywZ5PYUZ0z/U21IhWY8yttQQ uRtFR1rhSUOUIB9N6xVD5Zr0sr48UvIlQ1mlvxhJ2r3FhUbUz2as/Z3GA/PMWDYsCU1E hommQAIuUBEodlhzbzaG61ZDfD8XUvg3A0uPQc1J7ICe4YdCNUnv4FtKhZPym0pjyFx9 idK5abIzKIPwZ6hI+qFm5FBi8qoYnNZrx27zKwiZTkJOxE/wpZ2fJiB8mopG6Sikck8r JIhUAYK+vv0h0ZeheEn4/G0JjsJjSb52Yp7gK4jEH5YDb6wr0XdvG/DPGphuJ/L5bR6r repA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=YLhAmLnL7maGQnq6irNiQVWSxdNCYpUgMyRWB5BMQ+E=; b=YR5ROB+Dce+PsMGxljNHdhr+PBHEDfRpztE1PtoxAGlD5yYaMPbzLKbqOGAwPVTe9A qVxL1UqI5gsjQtYUiqGTe+zdD6AJgBtyB8pWzrpqIp77QE4yC4QvB9nz2xXVCKLdKj7h Fa4G903qCn5s10gKA1PL51xDdfUEf0iXujYhac17DfL8LkK+G5XNv1AZZWBZBGFd+a/m yAzy6PGO1qRdclWyClIyLqUqvZz2crZkYXu5tq0JMNQ7p5Bhmam2AMWKdE//PrhcwYiP JFO00LrXuI0E3cfVI8kb9IefV0DhDORMDV57CVZJUTLkl6K/7hNx/zU0yjNVENrcMjba BUng== X-Gm-Message-State: AOAM531kCvwrB+zHyCsmGlhJiJ10YEBkkE0WYOVz1q8r1Lz+YpaMlKg4 wuKkDZx6IpzAa4Pycu5NSk8= X-Google-Smtp-Source: ABdhPJz/KJtpuKIRZOHxkvfc+XoC+P1ogCk+UleL31rwZ5dX3aBVbLL6GbP/AkHx1nhbYkQj/Wvvrw== X-Received: by 2002:a4a:b186:: with SMTP id c6mr11398393ooo.28.1620834539923; Wed, 12 May 2021 08:48:59 -0700 (PDT) Received: from localhost ([192.200.115.226]) by smtp.gmail.com with ESMTPSA id v19sm27544otq.35.2021.05.12.08.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 08:48:59 -0700 (PDT) From: Ihor Radchenko To: Timothy Subject: Re: [PATCH] Fontification for inline src blocks In-Reply-To: <87fsys102j.fsf@gmail.com> References: <87pmzf4bd0.fsf@gmail.com> <87pmye51a3.fsf@gmail.com> <87zgxcgaba.fsf@gmail.com> <878s4wtrzx.fsf@gmail.com> <87k0o419uh.fsf@gmail.com> <87o8dgdo7l.fsf@localhost> <87fsys102j.fsf@gmail.com> Date: Wed, 12 May 2021 23:53:50 +0800 Message-ID: <87im3odk35.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=yantar92@gmail.com; helo=mail-oo1-xc34.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Gillespie , org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620834967; 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=YLhAmLnL7maGQnq6irNiQVWSxdNCYpUgMyRWB5BMQ+E=; b=mWRLyxeM0zSONXJSmc40zUAcWCiSPGVGGnAOfUaxLZw9kR2Mhx+4ebKrMoZ8caCScVrQbM BpThvXIHMQJ71PSa+S85WlGhMttOP86/gicQzj85c1MqKd1rPB+0gaAMFO+3aWBgz1zJAl f+cN7Vsl1kmMXkE9pQNYii42NioYNKPwX4eEL2rGpjnf8MhadYMKcnN6uZwuuywv8gGQMU luBAfP93tc7QKxwjSE3J+43SovAp8ufJ6tUWmJrprzLRxbW6c0lgSaD1xmkJ9Z+3N3MHZd uWRGhD6OLB63R0w2FBRUohrj9tKlHW1y96AjHvogxNE6RppPv03doRksU/8KoA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620834967; a=rsa-sha256; cv=none; b=cWAc4ufDZbwYOsmrDiyhnS6iqlK7G1YLOyUCtuNaIiLRWh/IvTx7jh06KBummk0FQc+npo +UfUGsUAd/CKOMBucjZwRfSN6ajGbVkPPcPtYXz1vVGeevLK8tOhluqSQCQp4yslhfaOQv u06JJxffsoTV2FxBXY8Xpp8fk3mz7FNHvzUe5nv+I/BqC0S/Yf5XknHng6N3ACf9RHfN8E DAvpKmWbV2RDn+8q/wIlpWCV0lNNs3sD3jDfOhgdSQ/+n2erVXZD6yjB1jSFrubeTY1iYR wa467CBGSSVhRLwLW8DspLrPf9zmqB1j/5Z6RsmY8TqFE4g0+7OMIXavkPXV1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=d9wbObZB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.65 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=d9wbObZB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: F209010AB2 X-Spam-Score: -2.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: lafhTZZgm1P2 Timothy writes: >> I do not like abusing prettify-symbols-mode. What if it is not enabled? > > Ah, it does it anyway at the moment. Hmm. You are right. You are calling compose-region directly. Note, that you do not add 'decompose-region function for automatic region destruction (see help:pretty-symbol-pattern-to-keyword). If I understand correctly (I did not really install your patch), if you have composed region, disable font-lock, and try to edit the region, edits will be invisible. Or imagine setting org-inline-src-prettify-results to nil in already fontified buffer. Also, you may find help:font-lock-extra-managed-props useful. That way, you will not have to manually remove composition and other non-standard properties during fontification (why are you even removing 'face? It should be already done by font-lock). >> What will happen if user toggles prettify-symbols-mode in Org buffer? > > This seems to be toggled nicely by prettify-symbols-mode too. I would not expect it to. Why would prettify-symbols-mode interfere with Org mode native fontification if it is not strictly necessary? P.S. Nitpick: You do not need to run fontification in while loops. Just fontifying next match before limit should be enough. Font-lock will call the function again if needed. Best, Ihor