2

I would like to ask a question about org-mode and font-lock-mode.

I just started using Emacs and, since I am not a programmer, I use it mostly for writing and handling texts. And, I am quite interested in org-mode because I heard it is the best tool for pretty much anything I can do with texts. Of course, I tried it.

However, I found one thing which bothers me. It is not an actual "problem" but a matter of my "preference". I do not like the fontification of org-mode. (ex: italic or bold) I do not want it to hide any markup elements. (ex: brackets for hyperlinks) I just want plain text showing everything without any visual effects. I want to see such visual effects only when it is exported to other format like HTML. I want to see only plain text in the text editor.

I googled and found out font-lock-mode. It was very close to what I wanted. But, there is one problem. When it is turned off, color highlighting disappears too. Even though I want plain text, still I want it to be colorful.

I tried my best but could not find a solution. But, considering the flexibility of Emacs, I am quite sure that there is a way. I just cannot find it. Can anyone help me with this?

2 Answers 2

1

Font-lock isn't your problem, if you want to keep having it color text.

If you just want to change the appearance font-lock gives you for some particular faces, e.g., by removing their boldness or whatever, then just customize the faces that you don't like. Boldness, like color, is just a face property/attribute.

Put your cursor on such text, and hit C-u C-x =, to see which face(s) are present there. Then use M-x customize-face to customize the problematic face.

You can also use M-x list-faces-display, to see all faces, compare them, etc. And in that display you can just click a face name to do what M-x customize-face does.

5
  • The various faces that Org mode uses for fontification are defined in the file org-faces.el. They all belong to the customization group org-faces so you can say M-x customize-group org-faces and go through them, find out which one does what and customize them as you wish.
    – NickD
    Dec 18, 2022 at 0:30
  • 1
    Thank you, Drew and NickD. Now I understand that it can be done with "M-x customize-face" or "M-x customize-group". But, unfortunately, it looks kind of overwhelming because there are too many options and I do not know which item does what. I think there is no one-line code which can conveniently achieve what I wanted. Definitely, I will need a lot more time to experiment and find optimal settings for me.
    – bman25
    Dec 18, 2022 at 2:25
  • 1
    Right: but you can change one thing at a time and make sure it does what you want before going on to the next thing. You will be able to get through it all in fairly short order. So don't rush it: you can live with face imperfections for a little while, particularly if you see them going away one by one.
    – NickD
    Dec 18, 2022 at 2:47
  • 1
    I found a temporary measure, which is not perfect but very close to what I wanted. Though this may be something obvious to experienced users, still I am sharing this for beginners like me. Adding (setq org-fontify-emphasized-text nil) & (setq org-descriptive-links nil) to my init.el, I could disable emphasis fontifications and prevent hiding brackets for links.
    – bman25
    Dec 18, 2022 at 8:18
  • 1
    OP: Put that in an answer, not in a comment, if you want it to help others. Comments can be deleted at any time. (You can accept your own answer, BTW.)
    – Drew
    Dec 18, 2022 at 16:32
2

I found a temporary measure, which is not perfect but very close to what I wanted. Though this may be something obvious to experienced users, still I am sharing this for beginners like me:

(setq org-fontify-emphasized-text nil)
(setq org-descriptive-links nil)

Adding these 2 lines to my init.el, I could disable emphasis fontifications and prevent hiding brackets for links.

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.