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 0BVzJPAEnGDjYQAAgWs5BA (envelope-from ) for ; Wed, 12 May 2021 18:40:16 +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 sEoNIPAEnGB7dAAAbx9fmQ (envelope-from ) for ; Wed, 12 May 2021 16:40:16 +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 EA29611D4F for ; Wed, 12 May 2021 18:40:15 +0200 (CEST) Received: from localhost ([::1]:53538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgru9-0000V4-V2 for larch@yhetil.org; Wed, 12 May 2021 12:40:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgrtb-0000RJ-VY for emacs-orgmode@gnu.org; Wed, 12 May 2021 12:39:39 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:56066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgrta-0001bg-4V for emacs-orgmode@gnu.org; Wed, 12 May 2021 12:39:39 -0400 Received: by mail-pj1-x102e.google.com with SMTP id gj14so13818741pjb.5 for ; Wed, 12 May 2021 09:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=nrSXxesFGmLpDGbFYGRrATGT4j6vqB066emRK92ftdg=; b=Y43stKmLZmMp2SJLVuyA/6M0mHPyY+j5exwZau3lSKmXZXFOdgqbGimtrCSvQ/Xipi lYyNrYBPC3egnQ8BH/JkO5da3zw5wkPK3rRLK1fcEf65KsEp7V6fobvCFrwNCLC1QNOl JO2WLFxE3P0rF99+1+LF8Ck0YGWTqlnXyOpuyOfIO6FrjXavBSGkhH7SkJtcoC4j1fRR mteiF61gp/lFXDnxbJvExfwaUgPPCKVnGqQvNnIUOsgom7sTIMtPqHbjR5/NL9OCaJY1 +/3RuANgj5MueMzKxSfijybGxkBXLaDyTahtcbOggkTUk7u3HQRmMjioPUYOTkqsRp+p ZbpA== 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:cc:subject :in-reply-to:message-id:date:mime-version; bh=nrSXxesFGmLpDGbFYGRrATGT4j6vqB066emRK92ftdg=; b=roZlwpE0OpEXWVlrsbxYup3pTYnWgoiGshRaPkrs/LkVd1IVQSXFxe9AuJK4LMJOSj KA48onR++BZKUplriI24903gEu/fEt4cj3fZUs2aW45+V9jiE7KqJxvJUbDK33sMlH5J ZEbGzgDdIxQkTJ7sF3s79Q345TCE8XflOBQEgfMrbYZ0ppLRJ1oKbL40Nb824l+4XiBc ul5IIO9h1tuIlDdx3qdlJcrVlVt0BcvT3icV4MZ9CB2Gmev8A+fAfHzLjK1J1K+PGtCR i/iuGB/74BWElaVQr4O4d7NwSK+m6o3oZjo4CVcS22VJL0rnCks0EDD0rnvb+D+w52Tz myTA== X-Gm-Message-State: AOAM532gQRlSpOJIV15xkx943wK32jFI+xdkc9c5peDY3n3BVaOYmyRn txsPnQ54neFeK6an9Ee3x5Q= X-Google-Smtp-Source: ABdhPJzVpJEnit3SZkA1F1lHwbmZUfJYODL69EEPvKplq0YF/0zTlFDAdUHTXzv1SwOi5bwyWN2fNQ== X-Received: by 2002:a17:902:ab89:b029:ee:dc90:7008 with SMTP id f9-20020a170902ab89b02900eedc907008mr35987324plr.30.1620837576199; Wed, 12 May 2021 09:39:36 -0700 (PDT) Received: from localhost (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id q24sm314695pgk.32.2021.05.12.09.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 09:39:35 -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> User-agent: mu4e 1.4.15; emacs 28.0.50 From: Timothy To: Ihor Radchenko Subject: Re: [PATCH] Fontification for inline src blocks In-reply-to: <87im3odk35.fsf@localhost> Message-ID: <87cztv29ff.fsf@gmail.com> Date: Thu, 13 May 2021 00:39:32 +0800 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x102e.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: , 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=1620837616; 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=nrSXxesFGmLpDGbFYGRrATGT4j6vqB066emRK92ftdg=; b=JuJQr/2RjhhNuWsiNVh4o2GyHr3WyeqkFc09xxYw2dhYPjzFwwf0obgOepJZDojDxNUkQ5 c8iADp1OdxMVgpZd5rpd4Ko1ygWZDKCMlgU2kLKPCQUpuYTrSvhOmtT39qI4uzi+FC1mB5 T3PTupPioyhMm280sdyK9qZMPEnMb1Zdf4pxVTpI3d9SlraSBXS51MUcHr+0cPsJn1H7Ow exejh0JCBxbH8xUHoNuCwf29pI1d3LwP5+A+IQaCQAi1sYhNLNn4UnKf5mEhAqeLjJpuEk IzTJJD6L6g9N9FDEJgzUGI59/ceDwgvRMp4+zVosN/mHqKaXqRLCTKJj33Gc7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620837616; a=rsa-sha256; cv=none; b=mS3BChGShnG7iiIYlVkN3XKgh1uakeUf0NJdckjpOaLXa29ia5gs360gyYi+ifk7CFbHBt 1nT+tsqd73nx9ucq7F7Ssa2Yvti8kDVijeSj4OXMmTNjSP4nlJxS0wr4r9ALm7nychHiCj LV5+D6DSIeKgL9MxkVP+3zUG0+p/YethOc+QdX+y4azYOeydcmZFlgn8Eg/6X9l4HE2zJc G6GfAxrPJ/tQzXHpSSA/+guODsqVELnxwE23+UNuYP3aWJ7J1/7XTtnwqZ/4RnkUMj8fNA 76UJ+4F0fto/LzY0Rb3ATTc6DUlMX7GDbZYPH/DDHebgQMLoM1PbDqMZgGhNFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Y43stKmL; 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=Y43stKmL; 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: EA29611D4F X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: Ya5Nmz7EgjLI 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? Thanks, Timothy