From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SLM0NKQ3r2I49gAAbAwnHQ (envelope-from ) for ; Sun, 19 Jun 2022 16:50:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YP0nNKQ3r2LALQEA9RJhRA (envelope-from ) for ; Sun, 19 Jun 2022 16:50:12 +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 8FB8E1363D for ; Sun, 19 Jun 2022 16:50:12 +0200 (CEST) Received: from localhost ([::1]:43566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2wFf-0005W5-N9 for larch@yhetil.org; Sun, 19 Jun 2022 10:50:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2wF4-0005Vh-KC for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 10:49:34 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]:46841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2wF3-0004yE-8P for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 10:49:34 -0400 Received: by mail-il1-x12f.google.com with SMTP id y16so5885685ili.13 for ; Sun, 19 Jun 2022 07:49:32 -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=NU0v7YXu5nnF3zu46+gjevL0j1noNz4eFWTztv+LaOc=; b=TEVX+skxQHQBSqxnNI92D2irgYx/3mOeTOMR7zpYWBRHX7jRJEKRPoufBg3Te2BcfY oset93l3Ly+JQBSQgbFUd782nfw2l0p2+yfFB1mCG6tKLk4QFNvoR5gfkBC+kAw6/ZXQ 8arD7IJdMIoUnK4B7vHX/1fP+kEDENWzifqhSl8A4pJSpsBUQJNLYOIXEWFPyHxdZ1FD xqdoT7+EDCunsoX25OyjGMA7BmOnLAVR2x6zrh2kCxb3lsJRbpGJzmnH0Hrhh0R4eLeZ lP2JtT5nm14ejCR1LJJ9r7j94D4Mu9yN5c1rNwgyfXS2HmAiqxGw/2np4FBFCeWVh2se O21Q== 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=NU0v7YXu5nnF3zu46+gjevL0j1noNz4eFWTztv+LaOc=; b=oaPspmElALMtdG1RlOVR91PNR9Ou1yQ3nhxup5p57We/JkEPrMEkPhi1bfJ7DReCz8 2X72wsjtF7a6LMHaIgoqGRE4i1C9B95SsfymGBJiAOU19/8xRKkGiDDswtxfarx8ofGw Xj0+NPAYVZ1xmjJl3FNTKMLuEoqfWXw0zXEK5RNm3Yfsg2jaW0xmU4Y6UIlVbPg0VBOs bYaNY55gZ3cZ4AFcIJF3r1X9a05UHzBVFkDS2vlbwtPhTW5fezVRkGJCBXAUptGv182E MVhngYPTyOsfuQNQ0UxSOuwLM0e6FmONRhhF2HPqkTeQqWYLqFEhurnRf0hOr/uBrnKE cRmA== X-Gm-Message-State: AJIora/t2tRvfw3YVW8ETMdiaxh8HB4BxCnhhg3Q6rqXvKYlZTIy5+K/ 3UXpeUjv+yPsATyjPIH11Wabik2wXfI28agz X-Google-Smtp-Source: AGRyM1t3mq+DxuYIgIW6hEcYX8xzyXxTbJxKyZ1sqh3wtRPK2bHhr/JqllR/AB2QKL1bv/7v4pxKpQ== X-Received: by 2002:a05:6e02:1a03:b0:2d2:c409:b12e with SMTP id s3-20020a056e021a0300b002d2c409b12emr10603530ild.125.1655650172078; Sun, 19 Jun 2022 07:49:32 -0700 (PDT) Received: from paquerette ([2001:861:4284:db70:cd73:5783:789b:9f6e]) by smtp.gmail.com with ESMTPSA id y21-20020a02ce95000000b0033206b52e4csm4787062jaq.42.2022.06.19.07.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jun 2022 07:49:31 -0700 (PDT) From: Edouard Debry To: Ihor Radchenko Cc: Samuel Wales , "DEBRY.Edouard" , emacs-orgmode Subject: Re: Orgmode plain list bullet : change automatically with list depth References: <87wndiv988.fsf@localhost> <87edznjyji.fsf@localhost> <86sfo092qe.fsf@gmail.com> <87y1xsoim6.fsf@localhost> Date: Sun, 19 Jun 2022 16:49:24 +0200 In-Reply-To: <87y1xsoim6.fsf@localhost> (Ihor Radchenko's message of "Sun, 19 Jun 2022 22:03:45 +0800") Message-ID: <86k09ck8sr.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=2607:f8b0:4864:20::12f; envelope-from=edouard.debry@gmail.com; helo=mail-il1-x12f.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=1655650212; 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=NU0v7YXu5nnF3zu46+gjevL0j1noNz4eFWTztv+LaOc=; b=JOXVzp6M20YdxhZa6vLZYKNiaXofAZ/+ZuIcGR0Ja108IpRQBUtdwqMvz4+AITb5z872nT QjwSc7rdSGi+2vU/AryY4vsdkGjvk8xFG8qJcyM4Qxz0mh7NB97t3jXRLiwfJ874WoZ1ax e6yORXMGO5BLb6VJ5o5lPd8TTyZ45TlH0dwuRFgeVrSpJs6Iju54Fu2oMCrApD6AEX2qwH hdCnWjPXPDOcV/0UgeXohg/KuWyXo9NDjwzcvc1tJkM2hsIrfE6to1tSGPDywpNmO+V+vW YvCy7HrkOyn5JBZtaN586OxHXAKtOjkwlzLmMF66zcbNQSsTAk+T/Sm6ZlA+Xg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655650212; a=rsa-sha256; cv=none; b=o6TlpwANsbyZ8c3Vk1/bX+epH1nHBC9p9kF6eepnmk4zTTuHCN2nuOEhFeo/UAN1iE0pKM rgR79HMtQb5lyVecPVEIJ+ggLQxOgSZ/pLWlAWN+6upwrhORkW8S7BJeBoljoMvQJKnpjO lFOpw4U0z/OJaMzPvFDrT/cHCFEk1VQpO0eGhkMTYWfJX96fIjSuiKG6PKu3hp4GL1Dyna qcbp3seNrqfFqWEUvaxE2l9SxNwq9KdQ85wGkBfSBaxE0PgECdFnLFcMWoHEJDbpxsCyPK rXATQ6Nua+whqMpXLdOR2XXGDi0VdDq10ImDB/242hlSmsRNZ+TxLxnEiMYI5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TEVX+skx; 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: -4.28 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TEVX+skx; 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: 8FB8E1363D X-Spam-Score: -4.28 X-Migadu-Scanner: scn0.migadu.com X-TUID: Xu52q6C24N/L Thanks for your information complement. Indeed, I know too few about emacs to guess that by myself. And it works ! For anyone interested, here are the settings : (font-lock-add-keywords 'org-mode '(("^ *\\([-]\\) " (0 (let* ((depth (org-list--depth (save-match-da= ta (org-element-at-point)))) (bullet (cond ((=3D depth 1) "=E2=97= =8F") ((=3D depth 2) "=E2=97= =86") ((=3D depth 3) "=E2=96= =AA") ((=3D depth 4) "=E2=96= =B8") ((=3D depth 5) "=E2=80= =A2") ((=3D depth 6) "=E2=86= =AA") (t "=E2=86=AA")))) (prog1 () (compose-region (match-beginning = 1) (match-end 1) bullet))))))) Many thanks for your help. Regards Ihor Radchenko writes: > Edouard Debry writes: > >> 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 : >> >> ... >> but it seems that "org-element-at-point" messes things. > > Sorry, I though that I gave you enough information to fix the issue. > > Just wrap (org-element-at-point) into save-match-data: > (save-match-data (org-element-at-point)) > > That's it. > > P.S. I actually plan to fix `org-element-at-point' modifying match data > (which is not documented), but it will probably be a part of a bigger > font-lock-related patchset. > > Best, > Ihor