From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0C4YL22CmmJbIwEAbAwnHQ (envelope-from ) for ; Fri, 03 Jun 2022 23:51:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EHEnL22CmmIvXAAA9RJhRA (envelope-from ) for ; Fri, 03 Jun 2022 23:51:41 +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 3AD6A1FC5F for ; Fri, 3 Jun 2022 23:51:41 +0200 (CEST) Received: from localhost ([::1]:50390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxFCm-00040C-2H for larch@yhetil.org; Fri, 03 Jun 2022 17:51:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxFC7-000400-Gg for emacs-orgmode@gnu.org; Fri, 03 Jun 2022 17:50:59 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:37761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxFC4-00058Z-O3 for emacs-orgmode@gnu.org; Fri, 03 Jun 2022 17:50:59 -0400 Received: by mail-pf1-x42a.google.com with SMTP id bo5so8089314pfb.4 for ; Fri, 03 Jun 2022 14:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=tmkIV2P04UrOFaqagzU2C2ud3IkqZegONudqLvY/yUw=; b=ObN51xh/4UDYFqN0kccC+O32Oy0/+q8QHQKpMo/wesr7Tu+53rXvE5ygVMFUTkm6dd R/f4MYIEXhmdIMMUE+30LDmmXfdhFkgvFCa/5mM+6QAAReOvWp1oulFkmPYCOUKoKH2M BaFqKb+GCg5t1PctyjZ+rkfUglyFPUWkLW/0h/UP79oO0SXJSbCxUEpdNuT1p8QZYfnn nB06mJZvIZnjNYtMQqkZqTPIymTdM3iX8/y8GmNuNsFWWtaB/ibbLiAdRVJEMDacurFI 83x2xbPFO6h8slDnyzBwcR207cLmMv8pmRvfMfs0bh/C61YF7ByQpN9eQMPCHSQdYjlc 4QgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=tmkIV2P04UrOFaqagzU2C2ud3IkqZegONudqLvY/yUw=; b=ttBAY/GjlS+EJt1N9GMglIO/8jauMG3abr5uHLafZH56XrouDeyhtG1E2dJ2E7a+rV +tMPkasZSHAtyfcCDQKlBIcDIFaxpmGEdHd12tsotGv4PgZX6pbSH+6D0cAqBMtiJr+z AB9hWZEF5CowgKUBz+1iRmYN+/CVzA7zXRDtjqEwn7XufaLvB6D8KNAvQC7+z4H/idXa cz8TFbYx4PW3JvIaY9HjMDxLF8ojZCakANWfJeh0gxnDEeto41mAk75LG6eHLaV1Qyhw i5tqXNFoJ3myTCNP/aH/oUKN1cbfQOTr2suIwG6SPF6N8PcZqx/dwUWtb7UcheYBG0UI 2+kw== X-Gm-Message-State: AOAM531qsuk2LRHlAF3DpBD+Tvxa3sID/+d040nr07tVKHXC0ld9ozW8 wi72SLCXnTfKqYlQkgfG12umcJc8ZSE= X-Google-Smtp-Source: ABdhPJzxH8TqqwG+rgQ7Ngz2kIktap5iu2j6P4yyBrRbGCcWLEgmT14q5RBvX2urfEQkvgs+Htjuig== X-Received: by 2002:a05:6a00:150f:b0:51b:e050:d36e with SMTP id q15-20020a056a00150f00b0051be050d36emr5447182pfu.44.1654293054560; Fri, 03 Jun 2022 14:50:54 -0700 (PDT) Received: from dingbat (2001-44b8-31f2-bb00-9128-1983-86f4-2ebd.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:9128:1983:86f4:2ebd]) by smtp.gmail.com with ESMTPSA id t4-20020a1709027fc400b0015e8d4eb28esm5927704plb.216.2022.06.03.14.50.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 14:50:54 -0700 (PDT) References: <87ee7c9quk.fsf@localhost> <87k09ycc7n.fsf@localhost> User-agent: mu4e 1.7.25; emacs 28.1.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: [DISCUSSION] Refactoring fontification system Date: Sat, 04 Jun 2022 07:38:09 +1000 In-reply-to: <87k09ycc7n.fsf@localhost> Message-ID: <87zgit76wz.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=theophilusx@gmail.com; helo=mail-pf1-x42a.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, 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=1654293101; 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=tmkIV2P04UrOFaqagzU2C2ud3IkqZegONudqLvY/yUw=; b=NjkMFp3Sh3bGe+E9JJw3/tS/envRYrHcuJjGja6NvemuO9e0V6qXbQEAuefi9NMifY4MM4 w+WC28nhk4glSUl3ENyZnl5bUj4jQdkV4+tVBwD7oA9cV5gaYg35lZIAIwg9atCuostATG 4rASotTgEDazCKGNxhudPL38/FeHRYJtkRCQA1A/6aQvQ2wtCNWZP+MVv8NhvH0Iv/hiL1 fmtXuXh5IPpDhSJgX1Wr7XDk+eg7tbOOZ1UKP7S/jG9v3FsguFtXtMtkm7REGiOibjxNDP tRE9zvwTu7mFtFo0AVwtBM6NiUFd0CH5Cwk6kwMzLyIzxJH6tuDgfSfjA13uRA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654293101; a=rsa-sha256; cv=none; b=fFQnoryLP+MKxK08aUIv8fybPtncepa3gjKv95j1h9YzVpNAe5hGV4eEymxyI9/f0wPRG6 sxG3fBjjuZ0Zu1VnShBLFeY9AzbQ+DEqgHWN0QK4jImzobGR+YCLR9T0kiLZ8T8oNpSaKa 2gmzbxLX07BBmHDKyc5XVhVxd1wovPxutJZFTlnqtltK513R/7Jedc6xsle8R+Or+wcRYh RUTGazeI1C/8GdkZAqblPhk68/qJH0YTQsXCMIOW57f6jPiaqKR2e4NdCH8cS2/vVrhn7l fzMk8kAnp27yhhDWyuV6mvbNybJa7MZTfmEfKnt2QHOFIQKasSiLPCANS/HxWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ObN51xh/"; 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: -7.52 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ObN51xh/"; 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: 3AD6A1FC5F X-Spam-Score: -7.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: E5IRDupFfzTw Ihor Radchenko writes: > 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. > Very pleased your working on this. I suspect this will, once combined with the other fine work you have done, generate some very rewarding results. > 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? > I don't recall ever being able to specify language type with source blocks. The only benefit I can see for being able to would be to have blocks which are not 'executed' (tangled), but you can already achieve that just using source blocks. So, from my perspective, I would want example blocks (which I view mainly as a type of verbatim block) fontified in a distinct manner, but no need for language specific font-locking - if I want that, I would just use a src block. > 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? > I need superscript/subscript so rarely I really don't have much of a position. However, I do find it annoying when a superscript/subscript character alters the line spacing for the line it happens to display in. > 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? > Yes, I think that would be the right approach. I suspect most people won't really worry too much. Absent font locking is less of an issue than incorrect font locking. Soemthing too often seen with regexp based font-locking which I'm hoping will be avoided with a version based more on parsed elements etc.