From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ACXAGhRGlmGmXgAAgWs5BA (envelope-from ) for ; Thu, 18 Nov 2021 13:24:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YEpnFhRGlmH0BgAAB5/wlQ (envelope-from ) for ; Thu, 18 Nov 2021 12:24:52 +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 E92CA9E6F for ; Thu, 18 Nov 2021 13:24:51 +0100 (CET) Received: from localhost ([::1]:51754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mngTC-0006US-Lt for larch@yhetil.org; Thu, 18 Nov 2021 07:24:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mngSb-0006Sx-6d for emacs-orgmode@gnu.org; Thu, 18 Nov 2021 07:24:16 -0500 Received: from [2a00:1450:4864:20::32b] (port=44719 helo=mail-wm1-x32b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mngSY-0007N9-C4 for emacs-orgmode@gnu.org; Thu, 18 Nov 2021 07:24:12 -0500 Received: by mail-wm1-x32b.google.com with SMTP id c71-20020a1c9a4a000000b0032cdcc8cbafso4648324wme.3 for ; Thu, 18 Nov 2021 04:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ULB0PyHjl0xiNMxdsQeelhQJTd9hnSWc9WgNQ0GCg7o=; b=D3pOfm/s6odO06mZ0XzFaQ0gqgJ6gNwz2EB9CcWys6qTBdKjEdquk0o12M5Sqnvvdd 9GktprKZ3FkdNeJtSpgKrsaeibXzEslQS8LWrnF0RE8LSVHslrQaMsaMkrT4ZJGiclBb qKqbQi8sOXLgOjcPKM1QaO0B8SMe9kcE6Kr7qXZjF0t+lzWmCjIMyfp/QksJKH4WwfMX Iwo19/G3cH484l7YQL9grmhZ3yAwAvkD+P+4fiSxaBtDCOlVUWHZGMnzOEgeID7Un9x9 viP0lK+A9X3a6q49ifrcEnglut/OIryWylsGOU3Nbi0xL8LJ56o1D7kWXvi5EoR8s84v fHpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=ULB0PyHjl0xiNMxdsQeelhQJTd9hnSWc9WgNQ0GCg7o=; b=OHTNZX+V45EREmALwE4Pw98DF1zLlnp0zWrNGHxxO32q57OkTBLNkjcRq5n8JkiOUz +8mIKsYYgkg5sNp7mgwCdLNSTBG03vnYqF/HzlBPCwjvGSuD/EkdwVmwj0FARNlSOuJH u85SrifxN0Ck3bKbC7ifFz+JzMAF8M6BcqZknO/ywyZr0ScMl2lpkgUeB30E3YZrlUYh mYyiLEkit3XzDZH/5B2ZEqlO4AEHF5J2geQCVE+8I9rfk7PK4KYOThUth3XewhFZ7dPx XyvSDoPpx4j5kcidIK0EbcAEdgcP+RUN/l1VN+8zR40OL5/iP/tlM69wgWGuxuxROjxK gEhA== X-Gm-Message-State: AOAM530l53o0sVIi0D+Vuiao7w6uqtTAVsLK21anVmQAPXdX5njvs+Yn k0lqCFYIIvQCQKh2IYR1fJE= X-Google-Smtp-Source: ABdhPJxG/o+0hZJAJ7J/k+HbefqwZFXZ5sYuexclaqjWU1FcKr4b9zrk183ejhy8XKD4UpZ/GN+4tA== X-Received: by 2002:a1c:f219:: with SMTP id s25mr9529291wmc.31.1637238247946; Thu, 18 Nov 2021 04:24:07 -0800 (PST) Received: from localhost ([91.210.107.150]) by smtp.gmail.com with ESMTPSA id w7sm2926726wru.51.2021.11.18.04.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 04:24:07 -0800 (PST) From: Ihor Radchenko To: Max Nikulin , Nicolas Goaziou Subject: Re: c47b535bb origin/main org-element: Remove dependency on =?utf-8?Q?=E2=80=98org-emphasis-regexp-components=E2=80=99?= In-Reply-To: References: <87o86mw86r.fsf@localhost> <87fsrxkahq.fsf@nicolasgoaziou.fr> <87fsrxa1j5.fsf@localhost> <878rxoa6lk.fsf@localhost> Date: Thu, 18 Nov 2021 20:25:33 +0800 Message-ID: <87tug93b2a.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=yantar92@gmail.com; helo=mail-wm1-x32b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: emacs-orgmode@gnu.org 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=1637238292; 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=ULB0PyHjl0xiNMxdsQeelhQJTd9hnSWc9WgNQ0GCg7o=; b=LsQ/LVEEruQLFcmQUZXXy6c6FJLEivq/eh+Li9unD9jTSkgxhv56LYxkv5yL0GTAQee1uE e9vDAEiBs2kbGYrgOeA69HAmUBm2rEBneGRHWsSAbdVIPCQt8fmNnpe9rYt3ScD+jeT02B mDnbO7xJQ/Sb5ZcX7d47/n1Kj1tXegPneUea30QlfJx/0Qyw0V/PyQ+HgvsHpBokoq4yd+ BYAwxt1QdS/1EveYbo83e73+y5du7BDeJncLdP0E3YFOG4TJIvU+NO9+4M2TF0MxNkGgm6 AuT5VhIHpLsjnS/jvo43vpZlN9HW6w8EbLyX8RFCqFH1ZDvYz1Ao6yHotNg5dw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637238292; a=rsa-sha256; cv=none; b=NAC3wXn5G51iVDH3hpmLlyNcIcXJJO9fq7pmfCzJ8B/UAUY9c42wVyedo+EZnO1f5RXy2v 5kJFSIl57MJDhsRVa3uT+MuILSylm8GBYYQKgl6iAwvRdQzybpYOZdix9xjvtqZQOqPG8z 7W+gch9VLeA5RrnoDAyaCqYwa+nzVwfDa5ML97c8H3rixbvYWHJWiwGpCDiNW8Xyo8US0/ T+5c2MZkRZq1J/kKPnv6x6T0KEjb+83zYeePz3+U9MSjZUl+eq+FHWUqaMGRAvolczniK2 5ok1zw4fCIocauozzSNCZvfVRGfYkYPV5tI6ymVidOErqxutFp1Z+AniqLtNhg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="D3pOfm/s"; 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.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="D3pOfm/s"; 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: E92CA9E6F X-Spam-Score: -3.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: P7vbjIgYMPox --=-=-= Content-Type: text/plain Max Nikulin writes: > These regexps will always fail under some conditions, since it is not > strict markup. An example is emphasis terminated inside link target > > /A link [[https://orgmode.org/?oops=true][Org Mode]] Your example actually reveals a much bigger issue with current element parser. Even though the link is fontified by Org, if you run org-element-context on the link, it will return nil. The parsed sentence will look like: /A link [[https://orgmode.org/?oops=true][Org Mode]] The reason behind is partially regexps used to detect emphasised text and partially the way our parser works - no intersected objects are allowed. My intuition says that the current parser behaviour is not correct. It would make more sense to prioritise link over italics. However, it would require a major change in the parser - instead of a single pass, the parser may parse different types of objects sequentially. The emphasis objects should come last avoiding the markers to have different parents. Nicolas, WDYT? >> Maybe something like the attached? > > Thank you, Ihor. Another reason why I have not tried to do it myself is > that it is necessary to test behavior for users who customized markers. > The change should not be fatal for them. I have not checked it with you > patch yet. > > I was considering some way to warn users if improper customization is > detected (unexpected marker is noticed). It should be noticeable to make > user aware of export issues but not too annoying. > >> +The characters in the alist must not be changed. They do not affect >> +the actual Org syntax, just fontification. > > Since this is known point of abuses, maybe stronger words are appropriate. > > Do not change makers and do not add new ones to use custom markers for > existing styles or to introduce new styles. Org syntax is not meant to > be configurable and such modifications will not work with export. If you > are interested in fontification of custom markup inside Emacs only, > there are other ways to achieve desired effect. > ... > In addition, I do not like the following phrase in the manual: > >> To narrow down the list of available markup syntax, you can customize org-emphasis-alist. I updated the patch dropping your last suggested sentence in the docstring. I find it not very helpful for the user. We should either say nothing (as in the patch) or give a concrete reference how to "achieve the desired effect". Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-emphasis-alist-Update-defcustom-making-emphasis-.patch >From c950768bc08b4cae07ba3cb451d8af0abfec7dc8 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Tue, 16 Nov 2021 15:40:35 +0800 Subject: [PATCH] org-emphasis-alist: Update defcustom making emphasis characters constant * lisp/org.el (org-emphasis-alist): Mention that emphasis characters should not be changed by user. Update the defcustom type accordingly. * doc/org-manual.org (Emphasis and Monospace): Update the referece to `org-emphasis-alist'. --- doc/org-manual.org | 5 +++-- lisp/org.el | 41 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index c4bb7ef30..9fea2c42e 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -10814,9 +10814,10 @@ ** Emphasis and Monospace exported verbatim. #+vindex: org-fontify-emphasized-text +#+vindex: org-emphasis-alist To turn off fontification for marked up text, you can set -~org-fontify-emphasized-text~ to ~nil~. To narrow down the list of -available markup syntax, you can customize ~org-emphasis-alist~. +~org-fontify-emphasized-text~ to ~nil~. For more fine-tuned +fontification, you can customize ~org-emphasis-alist~. ** Subscripts and Superscripts :PROPERTIES: diff --git a/lisp/org.el b/lisp/org.el index 603b57279..00ac00ab3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -3833,18 +3833,49 @@ (defcustom org-emphasis-alist marker characters and the face to be used by font-lock for highlighting in Org buffers. +Do not change the characters and do not add new ones to use custom +markers for existing styles or to introduce new styles. Org syntax is +not meant to be configurable and such modifications will not work with +export. + You need to reload Org or to restart Emacs after customizing this." :group 'org-appearance :set 'org-set-emph-re :version "24.4" :package-version '(Org . "8.0") - :type '(repeat + :type '(list (list - (string :tag "Marker character") + (const "*") + (choice + (face :tag "Bold emphasis face") + (plist :tag "Bold emphasis face property list"))) + (list + (const "/") + (choice + (face :tag "Italic emphasis face") + (plist :tag "Italic emphasis face property list"))) + (list + (const "_") + (choice + (face :tag "Underline emphasis face") + (plist :tag "Underline emphasis face property list"))) + (list + (const "=") + (choice + (face :tag "Verbatim emphasis face") + (plist :tag "Verbatim emphasis face property list")) + (const verbatim)) + (list + (const "~") + (choice + (face :tag "Code emphasis face") + (plist :tag "Code emphasis face property list")) + (const verbatim)) + (list + (const "+") (choice - (face :tag "Font-lock-face") - (plist :tag "Face property list")) - (option (const verbatim))))) + (face :tag "Strike-through emphasis face") + (plist :tag "Strike-through emphasis face property list"))))) (defvar org-protecting-blocks '("src" "example" "export") "Blocks that contain text that is quoted, i.e. not processed as Org syntax. -- 2.32.0 --=-=-=--