From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UJm4IaOUnGB0dgEAgWs5BA (envelope-from ) for ; Thu, 13 May 2021 04:53:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6FxSHaOUnGDZGAAAbx9fmQ (envelope-from ) for ; Thu, 13 May 2021 02:53:23 +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 E490B1E613 for ; Thu, 13 May 2021 04:53:22 +0200 (CEST) Received: from localhost ([::1]:49520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lh1TU-0002pp-Cr for larch@yhetil.org; Wed, 12 May 2021 22:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lh1T8-0002pf-8t for emacs-orgmode@gnu.org; Wed, 12 May 2021 22:52:58 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:37873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lh1T6-0007gS-II for emacs-orgmode@gnu.org; Wed, 12 May 2021 22:52:57 -0400 Received: by mail-pl1-x631.google.com with SMTP id h20so13624943plr.4 for ; Wed, 12 May 2021 19:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=MQ/bYWKqbaOvMRIeATca6oHmX1l0LO61B1LrmQd4+fs=; b=UmHPp2IpwXlkls5R0og3IoFyxAtV2P1X8b+FRz18j8FTJ9WKPQ1qqkWeG/61EO9xL2 YCQ8P+IvAeMQyMbjmHNjZWyFtrOvtc5fqRSnvVa3xn/+BL3QnL1sOySpvGGi4mZsy646 NfHXwqtvfxMp75kQnpY25tUgf5QeoOeSXhy62qZr9+9LPcGi7rk2YTEEqTpSBi0X/Hhz bW9ug+lKxJbdaFFV1kWyJ6MPAWpHWjXQZEAmwJ+Irz3xYuurzzYaFgBupP3kOLIB57QM 8yvM9kWkJJ5yZVk33NZUofH/EQZexYIpedzfeLz8fYTSBgpE2DRSYqrso5lu5cLgrEpg zzOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=MQ/bYWKqbaOvMRIeATca6oHmX1l0LO61B1LrmQd4+fs=; b=KLJiu79/lh0BEEcIgNLlZ16sN2jJ6zCoYlaofRIEG/dfkLfNPwRoEAZTihXvQVF0oS 242pzwbsCJu9PGwokN3xycEwAvu3YcFS6g4jHjMxKSMqz0zBBD1XTUq+m0mzQbMs8MI1 cQY8damZtZDBp4Smsrdhkmdi3nLFkVHp1ute452h+zzGGfjh+PvSw20M54y9kbgS0ptn /ekWKDx1MYal99ZR+iyL4pLJ+oCb/bwMN6CqvP73VE7aEDMzA/V8ve12TPP33UQFxHNz srOGeyLaGRrrSKqQqtQKvNMxt0Zbprb4aWP7mMu6kJkImvc3IHw7jl9/q7t4oxVMuZ8X 0Rpg== X-Gm-Message-State: AOAM533uPGUmK1KGeAPHQYrLcXsl5FQ+jDUmmc8DnY6En/kyddIz5MMS NU4ziM+pjUKH6u0+82fgmgyWZL+FloE= X-Google-Smtp-Source: ABdhPJy2CSzJp+H2qFd1l567YhKt0gDOfJuKtoxjTCnIU0SOSpPDHYPkMqbKZ7eSLCi0v7Z8wPVyeQ== X-Received: by 2002:a17:903:244:b029:ec:9666:9fc6 with SMTP id j4-20020a1709030244b02900ec96669fc6mr38033350plh.63.1620874374150; Wed, 12 May 2021 19:52:54 -0700 (PDT) Received: from tim-desktop (220-235-15-145.dyn.iinet.net.au. [220.235.15.145]) by smtp.gmail.com with ESMTPSA id 204sm867255pfw.158.2021.05.12.19.52.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 19:52:53 -0700 (PDT) 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> <87im3odk35.fsf@localhost> <87cztv29ff.fsf@gmail.com> User-agent: mu4e 1.5.13; emacs 27.2.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: [PATCH] Fontification for inline src blocks Date: Thu, 13 May 2021 12:38:42 +1000 In-reply-to: <87cztv29ff.fsf@gmail.com> Message-ID: <87y2cjwdj1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: , 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=1620874403; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=MQ/bYWKqbaOvMRIeATca6oHmX1l0LO61B1LrmQd4+fs=; b=Kn5TluVhvfKFZTMWLhASAG+IVpf1nUiXb6Fp6zMkL7yFmTHG83l+vglQJxKSr5c41dZjB5 YyNACZFAK+mz67y/duyGgu8cvfUzPAd1IAOgdmClIlF3zycnj3x2pIqAiMyXfcZ9mxR/1B 2+J7zDTltt71D5BiQzutAtUdhs36gJV+clPFwmJF813Z1gm65OXAY/Sd63CWL9xGezR3aZ 5lgobW+bgpUcvnUWGNosvhd6YI1FxrfQwomsFVxcU45HABJH+2Ou+eV3n4POOoDiIG4Ei3 5fqgGwzxrR/gz9Hhl76GlcZ7rnnMIiPMDfBQzuVkSkXAA6WmetyvtRYIi3UOBg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620874403; a=rsa-sha256; cv=none; b=GYOJt3z96aCz0r8QasKJHiU3mDpwtXq+fiMvQHTSomz+aDvktvwEosJcyUiUsEypiuotCy j4mBChACRbsj0mQu7hND8zNhqIkhZozvGtjRUdwbR9H/pn1fZsIbBujgox4s3RfP+n7/JF 1Em0J2YbXXMyY5HFK8tkjxAjOWNxV3lc+FNOH7XGzKIm2+4dVcEA3OkSobeTKzS1AFCAEp 333CVISWFG4FnxBBQSJVc6RIil4zFuU2Td+f4so0ZRLwUrsXphOAfFCt8NGpxGPGb4PpR+ 69JYxQkyBuI5YVsmjdKGwMVWmo8es2oxw9j2sxxxCiwMXNWd7/HZi6LQqufpLQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=UmHPp2Ip; 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: -3.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=UmHPp2Ip; 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: E490B1E613 X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: jzVql1Hy+d8q Timothy writes: > Thank you for the detailed feedback :) > > Ihor Radchenko writes: > >> Timothy writes: >> >>>> I do not like abusing prettify-symbols-mode. What if it is not enabled? > > If you know of another way of accomplishing text-replacement which > changes back when the cursor enters the region, please let me know. > >>> 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). > > Isn't the same effect achieved by the remove-list-of-text-properties call? > >> 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. > > I just tried "setting org-inline-src-prettify-results to nil in already > fontified buffer." and the region just decomposed and stayed that way. > >> 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 > > Hmmm, from a look I can't tell exactly how these are "managed". Are they > just removed when a region is processed? > >> why are you even removing 'face? It should be already done by font-lock). > > I tried removing such calls, and everything still worked, so this is no > longer done. > >>>> 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? > > Well, I guess this is a by-product of using prettify-symbols-start/end, > see my note at the start of this email about not being aware of anything else. > >> 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. > > I'm guessing for this to work I'd need to return the final char > fortified? Or is the moving of point enough? > > Maybe related - I've noticed this doesn't seem to work with multiple > src_ blocks per line, might you have any insight here? > > This may or may not be something to consider but ... What is the impact of using this technique for accessibility and users of assistive technology like text-to-speech or braille displays? I'm currently not in the position to test this patch, but once I get some environments for testing sorted out, I should be able to try it out. >From an accessibility perspective, behaviour which changes what is 'displayed' based on cursor position is often confusing for things like text-to-speech. In the past, I have run into issues with prettify symbols because it results in either less meaningful content (e.g. unicode numbers rather than defined character names) or additional spoken text which makes it difficult to understand. Things like overlays, tooltips or features which make display different from underlying character content can often be problematic with assistive technology. -- Tim Cross