0

Both markdown mode and Org mode allow you to insert a number of dashes on an otherwise empty line (at least three in markdown mode, at least five in Org mode), that are rendered as horizontal rules in the exported output.

In markdown mode, the dashes become green in the markdown buffer.

Would it be possible to obtain the same behavior in an org-mode buffer, where the dashes become colorful?


https://orgmode.org/manual/Horizontal-Rules.html

12.9 Horizontal Rules: A line consisting of only dashes, and at least 5 of them, is exported as a horizontal line.

11
  • It is possible, but you'd have to bring the subject to the org-mode mailing list. From my cursory look, org doesn't define any customizable face for these dashes.
    – aadcg
    Sep 27, 2021 at 18:25
  • 1
    Are you talking about appearance in the Org mode file buffer? If so, are you talking about displaying the five dashes in green? Or do you really want to display a green horizontal rule that runs across the page? BTW, if what you want is to change how the buffer looks, the link reference is irrelevant since it's about export, so it ends up confusing the issue.
    – NickD
    Sep 27, 2021 at 18:48
  • Sorry for not clearifying it, I want its apperance in the Org mode file buffer, while I am editing into it.
    – alper
    Sep 27, 2021 at 19:00
  • I edited but if the edit is wrong, feel free to revert the edit (or edit some more).
    – NickD
    Sep 27, 2021 at 21:44
  • BTW, I just tried and in my case, nothing happens to the dashes in markdown mode. Have you tried with emacs -Q?
    – NickD
    Sep 27, 2021 at 21:49

1 Answer 1

1

Please see the Professor John Kitchin`s original solution from: https://list.orgmode.org/[email protected]/T/#t


you can add a rule like this in an org-mode hook:

(add-hook 'org-mode-hook
          (lambda ()
            (font-lock-add-keywords
             nil
             '(("^-\\{5,\\}"  0 '(:foreground "green" :weight bold))))))

that will make a line starting with at least 5 - be green and bold in color.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.