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

cannot customize some faces of org-transclusion #174

Closed ffsammak closed 1 year ago

ffsammak commented 1 year ago

I can see and get the following faces customized by M-x customize-faces and list-faces-display:

Screenshot from 2023-03-06 21-13-06

org-transclusion-live-sync-start works fine and shows the corresponding custom-faces

Screenshot from 2023-03-06 21-23-51

However, for the faces below I cannot see anything changing no matter how I do customizations to them:

Screenshot from 2023-03-06 21-13-36

I am using vanilla Emacs and started to debug this issue by running emacs -Q but to no avail. I use straight for package installation and use-package for their configuration.

So in summary, all custom-faces are fine except: org-transclusion, org-transclusion-source, and org-transclusion-keyword they don't get changed. Is this a known limitation, or am I missing something? I tried to progressively comment packages/code to identify any interfering setup code in my init.el but to no avail. Any help would be appreciated.

nobiot commented 1 year ago

Oh, right. Thanks for reporting. It looks like I have forgotten to put org-transclusion and org-transclusion-source back (there was a design change, if I remember correctly). Let me take some time do so.

org-transclusion-keyword works, though. See the color changed for #+transclude: keyword in the buffer to a green. You might need to call revert-buffer in order for the keyword to take the Org-transclusion default. image

ffsammak commented 1 year ago

org-transclusion-keyword works, though. See the color changed for #+transclude: keyword in the buffer to a green. You might need to call revert-buffer in order for the keyword to take the Org-transclusion default.

Yep. Sorry its my bad. I confirm org-transclude-keyword is working. Thanks for the prompt response.

nobiot commented 1 year ago

The latest commit has add the faces back in. If you are still around, it would be great if you could spend some time to do a quick test. The commit should make its way to GNU-devel repository overnight.

Absolutely fine if you don't have time; wanted to let you know anyway. Thanks for reporting the issue; it helps improve the package for real usage.

ffsammak commented 1 year ago

Hi, thanks a lot for your efforts. Always early enough. Glad to test your latest development. I need clarification as to which commit you meant for testing. Currently, I am trying the one that starts with 0273975. If you meant a different one, please let me know. These are my test results:

Note: when I fiddle around with the transclude region and hit save the buffer, it will take forever and not get saved. I realized then that the buffer is creating multiples of the #+transclude line, and the buffer size is getting bigger and bigger with time. I noticed this issue in the previous versions as well. By the time I canceled saving, I had too many multiples of transclude lines to deal with and delete. My last resort, a poor man's solution, was to delete the whole buffer or close emacs altogether, which was unfortunate sometimes.

nobiot commented 1 year ago

Thank you for taking the time for reporting back; much appreciated.

I am trying the one that starts with 0273975. If you meant a different one, please let me know.

Yes, it is a good commit to test. Apologies, the commit I was referring to was linked and appear in this thread in GitHub website, so I thought it would be enough. Perhaps you prefer to work with email for this type of communication and didn't see the linked commit. I will try to be clear next time. Thank you.

The commit was actually only about the topic of this thread: "cannot customize some faces of org-transclusion". Thank you for noting other observations. I will respond to each one below.

Faces

  • org-transclusion: The face didn't change. Is this the transcluded text? If yes, then it didn't bother to change.
  • org-transclusion-source: The face didn't change.

These are the two faces that you originally reported, which I added back in. In order not to influence other users, the default is "transparent" -- only the face definition with empty specification. You'd have to add color and other specifications on your end to see the effect.

I will make this clear in the user manual and document string for these two faces.

org-transclusion-fringe

  • org-transclusion-fringe (I had to move the #+transclude keyword a bit to get it to show up, it sometimes disappears when I do revert-buffer, hence buggy)

First time I hear about this issue. If you could reproduce it reliably, I'd appreciate your opening a new issue -- I have never had any issue with the fringe disappearing. I will take note of it and try doing revert-buffer and see if I can reproduce it.

Live-sync

  • another issue I observed is that live-sync (bound to e) doesn't start when I am on the org header text, but it works fine in the normal text under it. I think I didn't have this issue in the older version. #+transclude: [node][Description]] :level 2

I will try to reproduce it. If I can identify the issue, I will open a new issue as a log. Let me see. One of the recent commits might have introduced a regression issue.

infinite loop

Note: when I fiddle around with the transclude region and hit save the buffer, it will take forever and not get saved. I realized then that the buffer is creating multiples of the #+transclude line, and the buffer size is getting bigger and bigger with time. I noticed this issue in the previous versions as well. By the time I canceled saving, I had too many multiples of transclude lines to deal with and delete. My last resort, a poor man's solution, was to delete the whole buffer or close emacs altogether, which was unfortunate sometimes.

This has been reported #177. It's something I have been trying to reproduce for a long time -- I have had this issue only when I am developing the code, so it's expected then -- after the release of the code, I have never been able to have this problem.

As I cannot identify the root cause, I am currently trying to put some heuristics to detect this issue and error to break the loop. If you can reliably reproduce the problem, I'd appreciate it to add the procedure in issue #177.

nobiot commented 1 year ago

Added some documentation for "transparent" default face specification.

eecb77b

ffsammak commented 1 year ago

Added some documentation for "transparent" default face specification.

eecb77b

Thank you for keeping the documentation updated. However, I have no clue how to add color to the face when it is transparent. Sorry for that. Could you please have a look at the screenshot below? As such, the face color didn't change on my end. What am I missing? Or how to add color to the face according to the updated documentation?

Screenshot from 2023-05-11 09-27-57

nobiot commented 1 year ago

“Transparent” simply means there is no specification (no color) by default. At a quick glance, the screen looks good to me. Does it not do anything?

nobiot commented 1 year ago

That one is for the source. So won’t change the transclusion, though. Transclusion has its own face.

ffsammak commented 1 year ago

That one is for the source. So won’t change the transclusion, though. Transclusion has its own face.

No, it didn't change the source of transclusion.

Screenshot from 2023-05-11 10-06-33

nobiot commented 1 year ago

Okay, thank you. I am looking. I may be seeing something wrong with the latest codebase... Maybe I made a mess with git... Let me check.

nobiot commented 1 year ago

Okay, definitely something went wrong with codebase change. Thank you for quickly returning to my request. I will look more carefully later today (probably evening in my timezone).

ffsammak commented 1 year ago

Okay, definitely something went wrong with codebase change. Thank you for quickly returning to my request. I will look more carefully later today (probably evening in my timezone).

You're welcome! It's always a pleasure to be of assistance.

nobiot commented 1 year ago

The new commit bc24be2 should fix the issue....

The two faces 'org-transclusion' and 'org-transclusion-source' would still need to be customized to add any shade of colors, like these below:

image

image

ffsammak commented 1 year ago

The new commit bc24be2 should fix the issue....

Sorry for getting back late. This is to confirm that both transclusion and source overlays are working as expected. Thanks a lot for your great work.

nobiot commented 1 year ago

@ffsammak Thank you for confirming :)