From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CGBWFPLYmWIQYAEAbAwnHQ (envelope-from ) for ; Fri, 03 Jun 2022 11:48:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CJZTE/LYmWIrjwAAG6o9tA (envelope-from ) for ; Fri, 03 Jun 2022 11:48:34 +0200 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 CB00E34500 for ; Fri, 3 Jun 2022 11:48:33 +0200 (CEST) Received: from localhost ([::1]:59556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nx3uy-0002X0-WD for larch@yhetil.org; Fri, 03 Jun 2022 05:48:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx3rP-0002Wp-Hl for emacs-orgmode@gnu.org; Fri, 03 Jun 2022 05:44:51 -0400 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]:45953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nx3rN-0005Xg-Vo for emacs-orgmode@gnu.org; Fri, 03 Jun 2022 05:44:51 -0400 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-e93bbb54f9so9934204fac.12 for ; Fri, 03 Jun 2022 02:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=lhExVugf7QdyzQQcO55FvDoLwJiSPtIoqALlcpVMP2U=; b=edZCdtAdXNHIKv5bhepSnigDdMjioQaEdxq+yA4PQD+Wju9xjVDSjUDX9uGBLpta6x 30ptclhfs9HeWmHxkJLoRpU0exw7ZuUhOB/E+ZGZtR3Gkm9GcZalobSZDL9Sv4wb+fYU YKmpwFTxVs1FEc5MCY5L6KbgedRP67fXrEEi5Q5PFLQjPZ49FsV9G+HpDG3CKK+bNsmx +FxSUOc9TWnlDPY42CP3YYeu1WN4jv8mog5jGckoDacyQZzEKMTsiHbRWKUbPWoK9QC8 hHopr+rPZjZhGq9GYnEEHFtKh6TfdCq7NTgJEiCtbmTvMPdZEX1bDZq3k4z2rSdAj7OH dxiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=lhExVugf7QdyzQQcO55FvDoLwJiSPtIoqALlcpVMP2U=; b=vktBpOhDrvt7J8RFhXuasAXJ4ZCivLyZJ9ps7JX2vzV5+1EXoF0exRmFjQQkN4CTMh +BsJmi7/XApVxahsVA+03Ou6FccZhHAbglRYONTWjZHkZEEd2+oRmEEzXE2daOXOPdJy qtIII/TSi4A1cFkDhDURqcTtHSzOnePRD3LmlbV+NSjpDrXTNsJ7l9LoNiFLCX6Y4kH9 SuQ81D6iIbb1XxgnLp3nu7wTp636sM329OmDSVOmbuEUEp/BnYhfrFnI6UutgnMb3Iuj 7ElOKUPeSCcMqOXEDbdW+z+f+pIrHHB+OSMf1+xElQqF/lX8K4Gki2KulCHUM+7rdaPo 6mOg== X-Gm-Message-State: AOAM532OxL1xRuHsxjr+MbscjCPJlddxzz4mRLbtwKh3Dy/f2RlPhdcu ZieVnPiIAeVvNBBKujOaqKaPCk8ixV/rCQ== X-Google-Smtp-Source: ABdhPJyBINgShTlFx2vNLrJRTzj3t6zl7u8pduAYB8IiuoS4FFkRWF8Pm9o4IsOqKAZGU/bXMM0/sw== X-Received: by 2002:a05:6870:41ca:b0:e9:c84:987a with SMTP id z10-20020a05687041ca00b000e90c84987amr4796710oac.149.1654249479397; Fri, 03 Jun 2022 02:44:39 -0700 (PDT) Received: from localhost ([104.223.98.2]) by smtp.gmail.com with ESMTPSA id 3-20020a9d0b83000000b0060603221279sm3298089oth.73.2022.06.03.02.44.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 02:44:38 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: Re: [DISCUSSION] Refactoring fontification system In-Reply-To: <87ee7c9quk.fsf@localhost> References: <87ee7c9quk.fsf@localhost> Date: Fri, 03 Jun 2022 17:45:16 +0800 Message-ID: <87k09ycc7n.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=yantar92@gmail.com; helo=mail-oa1-x2e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654249713; 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=lhExVugf7QdyzQQcO55FvDoLwJiSPtIoqALlcpVMP2U=; b=WqH2mtHsGhYOjLc2g/AhtuCeWptc0z7YJ1UCh6CZqkjsh4CHa3L91iVwVGZYEGJ3xiKR6P bao79+AQzjpxAfwXJkqWq8BrdKjLZ7uLklDokRvHEQnxlP1SCX6qDvvB7uGY27if9hjpmU ufDxR59MyKCtTFCuuUwzminDG3sZL1P72tcXHXlwHTg/DNa8mtb8CkD9+YfiWRdjML72Rz /IVJat05uEXTqO5v5bvXEGpi51mNhZKlihNE5fhkioajj26lAlnOXrGkiAizin2LMkilwZ wYGnjZLjzf1uES7ynO7zZgX5ivRy5N+J1UuLLvx2tSz4KioW+MTAPGVNHmnDHw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654249713; a=rsa-sha256; cv=none; b=tmKLNiBzYssuxv4wbm5G6+SJiKh/TXsq+JaTKefh53inUcHfYaCaGyFzk3gxrGMxWkP1v8 2TGtLW3mHxcSkOpv2svqyXmbjippTK89V5RE9eKiwJZKGVloDe8/QpmidbdbqzWVsB9Cqu Im/zbe66rb5HUbeErBqcBmu98QdENW/UsiKbA9YrZ2Ktnw45iyRnzfm+7zrJe3kOkbmVOO lcu9qeduw4YHjlMiTWbwveUKgUOWQR6N/HlUu12JxIzVUl7mll81YQP6i8o0UVtuGXHee+ x/HlIaA3eHNlsmUszKl5FgP+y+Fari5zwJKVjRZRxP3XHiq1lf2AIFQcEluqiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=edZCdtAd; 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.52 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=edZCdtAd; 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: CB00E34500 X-Spam-Score: -3.52 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4Bd1xDe7y0tr Ihor Radchenko writes: > Instead of fontifying elements individually via regexps, we can leverage > org-element-map, org-element-parse-buffer, org-element-cache, and > jit-lock-mode. Each type of Org element/object can be assigned with a > fontification function accepting a single argument - the element datum. I have been working on the new fontification library for the last several months and I have noticed several confusing things in the current fontification settings. I'd like to hear if anyone has any idea on how to interpret the following: 1. org-protecting-blocks is an internal auxiliary variable used to determine which blocks should be fontified using different major mode. It's value is ("src" "example" "export") So, #+begin_src lang and #+begin_export lang are fontified according to LANG. Makes sense. However, what about #+begin_example? org-element-example-block-parser does not appear to expect language specification in the example blocks. Only switches seems to be allowed. Am I missing something and Org actually allows example blocks to specify language? Or was it the case in the distant past versions of Org? 2. org-script-display is an internal auxiliary variable used to display sub/superscripts. Note that it's default value holds 4 possibilities. Two for each type of script. For example, for superscripts we have two options: ((raise 0.3) (height 0.7)) and ((raise 0.5)) The first one looks more compact (does not change the line height) and reduces size of the superscript. The second one makes superscript have the same size with the main text an increases the line height x1.5. org-raise-scripts fontifies sub/superscripts differently inside and outside the tables: From org-raise-scripts: (nth (if table-p 3 1) org-script-display) However, it currently uses x1.5 line height for tables creating empty space between vertical | separators. It looks like a typo for me. It would make more sense to make table lines compact, not vice versa. Am I missing something? 3. org-fontify-meta-lines-and-blocks-1 creates a special face for ("+title:" "+subtitle:" "+author:" "+email:" "+date:") The face name is org-document-info. But what about, say, +description: or +language:? Would it make more sense to fontify all the keywords from org-options-keywords instead? Best, Ihor