From: DEBRY.Edouard <edouard.debry@mbda-systems.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Orgmode plain list bullet : change automatically with list depth
Date: Tue, 14 Jun 2022 15:03:18 +0000 [thread overview]
Message-ID: <yu1mczfbfft5.fsf@mbda-systems.com> (raw)
When making a plain list in orgmode, I would like to change of bullet
autmatically depending on the list depth.
Currently, I use this to prettify bullets :
(font-lock-add-keywords 'org-mode
'(("^ *\\([-]\\) "
(0 (prog1
()
(setq bullet "•")
(compose-region (match-beginning 1) (match-end 1) bullet))))))
I attempted to this :
(font-lock-add-keywords 'org-mode
'(("^ *\\([-]\\) "
(0 (let* ((depth (org-list--depth (org-element-at-point)))
(bullet (cond ((= depth 1) "•")
((= depth 2) "▸")
(t "-"))))
(prog1 () (compose-region (match-beginning 1) (match-end 1) bullet)))))))
for the bullet to change with respect to the org list depth, so to have
(e.g.) :
• test
▸ test1
▸ test2
But it breaks the org file.
How could I achieve this ?
Regards
___________________________________________________________________________________________________________________________________
This email and any attachments are confidential to the intended recipient and may also be privileged.
If you are not the intended recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person.
Ce courriel et ses pieces-jointes sont envoyes de maniere confidentielle et doivent etre traites avec attention.
Si vous n'etes pas le destinataire, merci de le detruire et d'en informer son auteur.
Vous ne devez pas copier, utiliser, reveler ou diffuser son contenu a quiconque.
next reply other threads:[~2022-06-14 15:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 15:03 DEBRY.Edouard [this message]
2022-06-15 4:31 ` Orgmode plain list bullet : change automatically with list depth Ihor Radchenko
2022-06-16 9:14 ` DEBRY.Edouard
2022-06-16 9:59 ` Ihor Radchenko
2022-06-16 23:26 ` Samuel Wales
2022-06-16 23:27 ` Samuel Wales
2022-06-17 11:54 ` Ihor Radchenko
2022-06-17 23:27 ` Samuel Wales
2022-06-18 0:17 ` Tim Cross
2022-06-19 13:40 ` Edouard Debry
2022-06-19 22:50 ` Tim Cross
2022-06-19 13:55 ` Edouard Debry
2022-06-19 14:03 ` Ihor Radchenko
2022-06-19 14:49 ` Edouard Debry
2022-06-24 14:28 ` DEBRY.Edouard
2022-06-25 3:27 ` Ihor Radchenko
2022-06-29 12:42 ` DEBRY.Edouard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yu1mczfbfft5.fsf@mbda-systems.com \
--to=edouard.debry@mbda-systems.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).