all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Orgmode plain list bullet : change automatically with list depth
@ 2022-06-14 15:03 DEBRY.Edouard
  2022-06-15  4:31 ` Ihor Radchenko
  0 siblings, 1 reply; 17+ messages in thread
From: DEBRY.Edouard @ 2022-06-14 15:03 UTC (permalink / raw)
  To: emacs-orgmode


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.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-06-29 13:46 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-14 15:03 Orgmode plain list bullet : change automatically with list depth DEBRY.Edouard
2022-06-15  4:31 ` 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.