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 WI9FFAwrr2Im5wAAbAwnHQ (envelope-from ) for ; Sun, 19 Jun 2022 15:56:28 +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 8DpOEwwrr2IVUAEAG6o9tA (envelope-from ) for ; Sun, 19 Jun 2022 15:56:28 +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 DD3353735F for ; Sun, 19 Jun 2022 15:56:27 +0200 (CEST) Received: from localhost ([::1]:51862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2vPf-00063F-0g for larch@yhetil.org; Sun, 19 Jun 2022 09:56:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2vPC-00062p-1g for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 09:55:58 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2vP9-0003la-SZ for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 09:55:57 -0400 Received: by mail-wr1-x432.google.com with SMTP id k22so4904100wrd.6 for ; Sun, 19 Jun 2022 06:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=L6rBnbT6nrE6NC+IKeUu4HEJ/JkgquiHH0+nAB2rFZg=; b=fln60W3CH5WiQKNrOBWdrByfT2Dy4dqQwz0XWXIx4kvzCLWoXIUDr+cpwmlM5oYhbZ VZ1idnfAAS91MY+jIYMQw8RSRD05haSLXRkrulBtlY4EkbDKtYU62ITexuaAd2edlmBo SFdUQULkZC7yZ+hGvhzzoZ5dmgd35lV7PJgHtxJT3cqbCZWHq6+KDLG0IQxS6YKyConr /Z2SUKeCAPwl+ytHl88u3PgwGODtXCIaObri0d53ImQfyshfN0FYw0uZsUDV6W8vnK+p +7VsveQnO8FzcuCfd92PG1Nz0JjzTJg6Bh+bveJJVcAL5ykDD8gDLpg4phmUpdMCkU4S nIZg== 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=L6rBnbT6nrE6NC+IKeUu4HEJ/JkgquiHH0+nAB2rFZg=; b=0e1eJ+d4WRJpCcWS9ymrUBBqVjaPP6i+UVfw+0HbjsxRBwQR5EdQtAXtxBur5w0+AL ujGZgpNG4x7M+NYcKFsXn1o85/0ew6qbj6/WEadFjJF1ecQ54ZZHO+emFVP6pDoyOMz3 2FqpnaFeIFVPdEca2TS1ezTb6zTaWxVv0k/WsEakeN2fAyVcppvOYu8gg7uNVLCCcr5Q ggPsQq5RWZZiXoA6V6cOYmfJ7AMd/YOAu+XrB7yzQg9I0njdmWPX05EOVGiatdU0yRfb 45RaWaE/g88ok3PbRwp9WMFu3ubDPRgAFUDrSPQWwY1PyyPi8woXo4fwvc1Dq7b6fjfg /o/w== X-Gm-Message-State: AJIora9C8BLPqQJWy9oDx4PgBkrQoFqk2g3Tatfd/V8IJYQcIAwplMYb ieyxUYeK1MmBeU0TYM12h88SkqYCIgDPjQ== X-Google-Smtp-Source: AGRyM1t/NyjzSz1ITq5JcLZiDlWgnTc//wNDqK90mMxZ2XbJuYZSj8N1zDFMODVzUnIoVAqSMSbS6Q== X-Received: by 2002:a05:6000:104f:b0:21a:3d3a:4d3d with SMTP id c15-20020a056000104f00b0021a3d3a4d3dmr13336201wrx.528.1655646953414; Sun, 19 Jun 2022 06:55:53 -0700 (PDT) Received: from paquerette (176-136-230-16.abo.bbox.fr. [176.136.230.16]) by smtp.gmail.com with ESMTPSA id h20-20020a05600c351400b00397342bcfb7sm12690926wmq.46.2022.06.19.06.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 06:55:52 -0700 (PDT) From: Edouard Debry To: Samuel Wales Cc: Ihor Radchenko , "DEBRY.Edouard" , emacs-orgmode Subject: Re: Orgmode plain list bullet : change automatically with list depth References: <87wndiv988.fsf@localhost> <87edznjyji.fsf@localhost> Date: Sun, 19 Jun 2022 15:55:53 +0200 In-Reply-To: (Samuel Wales's message of "Fri, 17 Jun 2022 16:27:01 -0700") Message-ID: <86sfo092qe.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=edouard.debry@gmail.com; helo=mail-wr1-x432.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=1655646988; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=L6rBnbT6nrE6NC+IKeUu4HEJ/JkgquiHH0+nAB2rFZg=; b=pQS1gawclBlYT2zrF/T+s9MP/pZmztqJPkPoxB814jPeRW2Wkl9dY3vqxrFF6VGApSqngE Ac6AgtPH+0VkWf0qsPp82Ra1NKHYLDFngb2YwW+rYxjOD0PbdeMdzdxkr29xLsqpQ9XVJH tMM/UneJKCF0k1s/eR60Y7LBoJMbQ7hawylU/xeZ2FHiawgrvmt/6mo/eqG9VSASFEuAy1 2Tpo5SVXws8RxOppsAJvOfVG0GFR5c0rmI74DQkdT4oQJ1Vq2aA00cHcaa23WrIN3Hh45y w7Fp28oBftdzZOnwosKGQ1Mpx3NYLi66SCuS38CH3ReT2RQd30xMADxDR3DegQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655646988; a=rsa-sha256; cv=none; b=DX9kCpWLMBYMO9uXqee6y4/LJVRQCo3zf24VEC0ab6876Kvwm35xpOlHdFWcVOkl+ZYwtx QwxZPGiediKXBPmcCqBVjr7QoVS+Vc77xkovElPQFF5wTFiEHraVTh0aJVmk4wGcdr50A3 5rhf/m0iLHxiuHrLpdqn1b/cQUVPQUGCMwulcYOkpHFCBa5sjYpNkWxWWGLtTUXtlKtQJf 0yziO8KaCFQWu21RCyEWOsotzA7UyAmmJFHavWM5S9bBAZ4PR2T3gSaqcIjrpssgv5soWW ld5B0YSOlTyJ7j74UODhH2VyGAXfEOZTGTjleJ/SIjuWpPfWwtHDtkJYfaChZw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fln60W3C; 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.48 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fln60W3C; 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: DD3353735F X-Spam-Score: -7.48 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1Y7mjgnxTyTC What I am looking forward to is 1) not modifying the true "bullet" in the raw text, it will always be "-" I just want the appearance to look "nicer" 2) having a bullet appearance level depth specific, e.g. =E2=96=AA this is first level of a list =E2=96=AA still first level =E2=9E=A4 this is the second level =E2=9E=A4 this is again the second level =E2=80=A2 a third level =E2=9E=A4 yet another second level which means that de facto a specific bullet appearance would be associated to a specifc list level depth, e.g. =E2=80=A2 is 3, =E2=96=AA is= 1 (I assume index begins at 1 ?) Built like this, putting this list into the first level of another one would shift all levels depth by +1 and consequently change the appearance. Currently, appearance is changed by : (font-lock-add-keywords 'org-mode '(("^ *\\([-]\\) " (0 (prog1 () (setq bullet "=E2=80=A2") (compose-region (match-beginning 1) (match-= end 1) bullet)))))) The key point is the regexp. I do not know if it is possible to capture the depth level with a regexp. That is why I tried to use org-list--depth in : (font-lock-add-keywords 'org-mode '(("^ *\\([-]\\) " (0 (let* ((depth (org-list--depth (org-element-= at-point))) (bullet (cond ((=3D depth 1) "=E2=80= =A2") ((=3D depth 2) "=E2=96= =B8") (t "-")))) (prog1 () (compose-region (match-beginning= 1) (match-end 1) bullet))))))) but it seems that "org-element-at-point" messes things. Samuel Wales writes: > sure. > > iiuc i think op wants 2 things: > > 1] graphical bullets. i.e. not the - + etc. that are in the org > plain text as saved to disk. > 2] each level of a list to have the same bullet style > > examples of 2]: > > a conforming list: > > - this is level 1. for this list, we always want level 1 to > use the - bullet style in the org plain text. > + this is level 2. for this list, we always want level 2 > to use the + bullet style in the org plain text. > + another level 2 > - another level 1 > + another level 2 > + the + is CONSISTENT with the + in the level 2 of the > previous list item > > a non-conforming list: > > - this is level 1. for this list, we always want level 1 to > use the - bullet style in the org plain text. > + this is level 2. for this list, we always want level 2 > to use the + bullet style in the org plain text. > + another level 2 > - another level 1 > * another level 2 > * these * markers are INCONSISTENT with the + markers in > the level 2 previous list item. > > the idea is for org [as opposed to fontification] to enforce this > level correspondence. whenever we do a bullet style change at any > level, org could change ALL BULLETS AT THE SAME LEVEL. this keeps the > list conforming. > > currently, org does not do this. instead, it allows you to > say that /demotion/ makes a + when you have a -. but > without enforcement, the list can quickly become > non-conforming after the user edits it. > > this idea is independent (orthogonal) to fontification / > displayed graphical glyph. i think op's 2] idea can make > sense. and then fontification / displayed graphical glyph > can be done perhaps with a fontification package. > > in any case, fontification can merely say that + looks > like =F0=9F=98=BA or so. orthogonal to levels. > > On 6/17/22, Ihor Radchenko wrote: >> Samuel Wales writes: >> >>> i wonder if org could do the semantics in the text, while >>> fontification could do the appearance only. >>> >>> org allows you to change the bullet style [real text bullets rather >>> than fontification] upon demotion. >>> >>> thus, you can have it consistent that demoting + from top level will >>> create - on level 2 for 1 item. until you change it. >>> >>> but org does not enforce by level. so you can't keep the results of >>> your demotion strategy in the rest of the list. an enforced scheme >>> would have it so that a change to new bullet style at a level, or >>> level 1 otherwise, would style that level. >> >> Could you please provide an example. I do not understand what you are >> trying to suggest. >> >> Best, >> Ihor >>