nobiot / org-transclusion

Emacs package to enable transclusion with Org Mode
https://nobiot.github.io/org-transclusion/
GNU General Public License v3.0
917 stars 44 forks source link

link fontification issues with a costume config #166

Open oatmealm opened 1 year ago

oatmealm commented 1 year ago

I'm not sure where to start looking, but I think what I'm seeing is that the transclusion links are not been fontified for some reason... the same file works perfectly fine in doomemacs.

Current configuration... I understand org-transclusion-font-lock is activated by default, but I added it to check. It makes no difference in either case.

(use-package org-transclusion
  :straight (:host github :repo "nobiot/org-transclusion")
  :after org
  :general
  (+map :infix "t"
    "T" #'org-transclusion-mode)
  :config
  (add-to-list 'org-transclusion-extensions 'org-transclusion-font-lock)
  (require 'org-transclusion-font-lock))

When the mode is active, it's value is:

org-transclusion-extensions is a variable defined in ‘org-transclusion.el’.

Its value is (org-transclusion-src-lines org-transclusion-font-lock)

image

nobiot commented 1 year ago

Can you try rever-buffer and see if it fontifies the transclusions?

oatmealm commented 1 year ago

Can you try rever-buffer and see if it fontifies the transclusions?

Thanks! Struggling to figure out. I had org-modern enabled. I disabled it and it seemed to work briefly but now it doesn't. Will update once I see something which makes sense.

nobiot commented 1 year ago

"briefly" is weird. What I have observed is that when you have a buffer already there and fontification is already done, Org-transclusion may not properly fontify the transclusion. But killing the buffer and then opening it again (or I believe revert does the same thing) re-applies fontification, this second time including Org-transclusion's custom fontification.

stardiviner commented 1 year ago

I got a similar might not related problem, I use org-modern-mode too. When I have this minor mode enabled, the org-transclusion left margin is not set. When I disable this minor mode, the left margin appears correctly by org-transclusion.

CleanShot 2023-02-26 at 21 58 33

nobiot commented 1 year ago

I'm aware of the "conflict" with org-modern. Including org-indent-mode, we are competing for the same text property. I have managed to "fix" the case for org-indent-mode and learned to co-exist. I don't how to do so with org-modern yet. It seems to aggressively remove what other packages might have done, and insert its own config -- I only had a quick scan of the code, I can be totally wrong.

To be honest, I do not use org-modern so personally I am not very keen to pursue this issue. We could open a dialog and ask for help for co-existence, but currently I lack time and interest to do so.

Happy for others to do so, though. It will be good to have a generic solution for co-existence.

stardiviner commented 1 year ago

@nobiot Sure, I currently disabled org-modern, it's not very necessary. I will take a thinking over this problem. And might send email to org-mode mailing list to discuss this problem.

stardiviner commented 1 year ago

@nobiot I have asked in org-mode mailing list about this competing problem. Ihor raised three solutions, you might want to take reference:

https://lists.gnu.org/archive/html/emacs-orgmode/2023-02/msg00734.html

nobiot commented 1 year ago

@stardiviner Thank you for this... I see. It's not something I can tackle soon. I'd need to understand the options suggested there first... PR or more discussions in this direction are welcome (perhaps in a separate issue or in the Discussion section).