minad / org-modern

:unicorn: Modern Org Style
GNU General Public License v3.0
1.55k stars 48 forks source link

mention org-modern-indent #117

Closed jdtsmith closed 1 year ago

jdtsmith commented 1 year ago

Note that org-indent-mode interferes with some of the style elements applied by org-modern-mode, e.g., the block brackets in the fringe

You might mention org-modern-indent here, which is now more stable as it no longer uses dirty font-searching hacks (in fact I borrowed some of the ideas from your fringe block font-lock code).

minad commented 1 year ago

Yes, I may mention it but it doesn't seem ready yet. Does it work with line-spacing>0? Do you plan to release it on ELPA/MELPA? Ideally I would also add this to org-modern itself but it is very complex, which I find hard to justify for the block prettification only.

jdtsmith commented 1 year ago

Does it work with line-spacing>0?

I mean it works but just doesn't look as good.

image

Unless I'm missing something (possible), by definition you cannot draw within the line-space pixel buffer between lines. It is documented at least. I would recommend people use a font with larger line spacing.

I would also add this to org-modern itself

Would be better long term. I actually had the latest rewritten version as a draft PR for you, but then once I looked at the complexity (which grew when I discovered editing headings re-indents the contents), thought better of it. There was great response on Reddit, so it seems people are interested in this functionality.

Do you plan to release it on ELPA/MELPA?

I may let it simmer for a bit longer with the (completely rewritten) new version and then submit it to Elpa. Not sure it belongs there, though. Lots of people are using :straight now it seems.

minad commented 1 year ago

...doesn't look as good.

This is what I mean. It does not work.

Unless I'm missing something (possible), by definition you cannot draw within the line-space pixel buffer between lines. It is documented at least. I would recommend people use a font with larger line spacing.

I disagree. line-spacing is a perfectly good setting. I implemented org-modern with line-spacing>0 in mind. I believe there is a possible solution. You can maybe create a thin white space character (display space width 1) and then give it the color of the line as background. This way you should get a continuous line. The rounded corners are a bigger problem though.

There was great response on Reddit, so it seems people are interested in this functionality.

Yes, it seems that there is interested, so I am not opposed to adding it. But it must work with line-spacing>0.

I may let it simmer for a bit longer with the (completely rewritten) new version and then submit it to Elpa. Not sure it belongs there, though. Lots of people are using :straight now it seems.

Okay, maybe rather add it to org-modern directly.

jdtsmith commented 1 year ago

line-spacing is a perfectly good setting

As is org-indent ;).

I believe there is a possible solution. You can maybe create a thin white space character (display space width 1) and then give it the color of the line as background. This way you should get a continuous line.

Interesting idea. I didn't realize you can style the full-height background like this (never used line-space>1). It would actually be good to stop including the bracket in the line-prefix when the block is flush-left, since when editing headings, org-indent aggressively re-prefixes the entire content (which means I have to aggressively re-style the indent).

I played around with specified space with BG a bit:

So maybe a solution would look like:

Seems like a simpler solution is out there (sans SVG of course). I also note that many modes draw with unicode box characters (vundo, various tree-modes, etc.) will also break with line-spacing>1. One may sensibly argue these types of modes have "standalone control" of their buffer so can enforce line-space=1. But still, it's not a unique problem.

Okay, maybe rather add it to org-modern directly.

That would be my preference too. I'll noodle with it.

minad commented 1 year ago

Note that terminal support is not very relevant for org-modern. org-modern only aims to work well on the GUI due to its visual features. I never tested this package in the terminal. Some prettifications may work well nevertheless.

jdtsmith commented 1 year ago

Something like these are possible, (mostly) independent of line-spacing:

image image image image

But selecting still overrides the BG value, as does the cursor.

jdtsmith commented 1 year ago

One could also I suppose use overlays. Then before-string and priority would be possible. Sounds difficult to keep track of though.