-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
padding is not present on folded headings #1
Comments
Hey, yeah I am definitely able to reproduce this. The thing is, I never really fold headings myself so it's basically a feature that is currently not implemented. Would have to take a closer look to see if this is at all doable or not, I think Org messes with display properties quite a bit when folding stuff. |
I'm trying to figure this one out. Instead of matching headlines using regular expressions, it could be possible to craft something using the built-in org functions.
I'm really new to elisp so I can't quite figure out what is going on. (define-minor-mode org-padding-mode
"Padding for org-mode"
nil nil nil
(let* ((keyword
`((".*\\($\\)"
(1 (let ((point (match-beginning 1)))
(unless (= point (point-max))
(org-padding--remove-padding point))
(if (org-at-heading-p)
(org-padding--set-padding point (nth (1- (org-outline-level)) org-padding-heading-padding-alist)))
nil))))))
(if org-padding-mode
(progn
(font-lock-add-keywords nil keyword)
(font-lock-fontify-buffer))
(save-excursion
(goto-char (point-min))
(font-lock-remove-keywords nil keyword)
(font-lock-fontify-buffer))))) As far as I can tell the regex here matches every single line and then I'm testing for headings... I will keep trying and post back if I come up with a solution. |
@eidetic-av I believe the issue here is not that matching headlines using regular expressions doesn't work, but that the text properties used to produce the padding effect ( |
@TonCherAmi Ah, sorry I guess I wasn't very clear. If I switch out any of the regex matching for the Take the following mode: (define-minor-mode org-padding-mode
"Padding for org-mode"
nil nil nil
(let* ((keyword
`((".*\\($\\)"
(1 (let ((point (match-beginning 1)))
(unless (= point (point-max))
(org-padding--remove-padding point))
(if (org-at-heading-p)
(org-padding--set-padding point `(40 . 40)))
nil))))))
(if org-padding-mode
(progn
(font-lock-add-keywords nil keyword)
(font-lock-fontify-buffer))
(save-excursion
(goto-char (point-min))
(font-lock-remove-keywords nil keyword)
(font-lock-fontify-buffer))))) It results in the following behaviour: Compared to the original behaviour: This is why I believe that is has something to do with the regex matching, since the So maybe @hrehfeld could be right when saying "EOL is not the actual EOL anymore"... regex cannot match to "$"? What I can't get to work though, is setting the correct height per headline using |
On my setup, padding is not present when an entry is folded, whatever the state of
org-ellipsis
is. This is probably because the EOL is not the actual EOL anymore.Does this work for you? I'd try to give a minimal example if you can't reproduce.
The text was updated successfully, but these errors were encountered: