-
Notifications
You must be signed in to change notification settings - Fork 22
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
Looking for feature suggestions #3
Comments
On one hand, that seems out-of-scope for this package that is supposed to be like a reimplementation of |
Yeah, I have minor reservations because of that, but it's hard to strike a balance between avoiding feature creep and giving the project a unique enough identity to not have it feel redundant.
Funnily enough, I do have plans for creating a package converting a particularly ingenious prettification for SRC blocks from a context-insensitive Back on the topic of a UI for prettifying |
Thanks for that link! I hadn't seen his blog before. Another great example of a blog generated with Org. I added it to https://alphapapa.github.io/org-almanac/#Blogging. Your plans sound good. Thanks. |
I've been watching this package since I found out it exists, and would like to replace my own fork of org-bullets with it when it's ready for prime-time. A feature I would thus love to see (and which I implemented in my fork of org-bullets) is an option to remove the indentation from the bullets, so that each is underneath the other, instead of the tabbed hierarchy (useful if the characters used for the stars make obvious the level of the heading (e.g. letters or numbers), and indentation is thus superfluous), found from this PR to the original org-bullets repository. In my fork I basically implemented the changes of this PR by hand, as the original forked repo was deleted and I also had forked the emacsorphanage version, which had made some incompatible changes in the meantime. Thanks in advance for your consideration. P.S. In general, you could get some more ideas for features from the other PRs from the original org-bullets repository too. |
Also, in regards to the performance issues, I have encountered the aforementioned lag issue for windows pcs in org-superstar as well (Windows 10, emacs 26.3), and I solved it in the same way too, that is setting |
An excellent point, I forgot the PRs! I am currently working on the TODO feature (almost done I believe). Once that is out of the way I'll take a look at how to implement this feature nicely. I think I will implement it the way org implements hiding emphasis markers, though. |
Regarding the performance issue, could you do me a favor and try out whether a plain text file full of bullets ( |
Looking at the third pull request, the primary change seems to be adding an explicit mouse event for visibility cycling. I would leave that out for the time being, in order to keep elements provided by the package largely non-interactive. |
Weirdly enough, I don't see any stuttering in a plain text (*.txt) file full of fisheye characters with |
Ah, I think I know the cause of the issue. Here's a MWE function of what the modes do to compose the bullets: (defun mwe (start end)
"May cause tremendous slowdown when used in region."
(interactive "r")
(let ((pos start))
(while (< pos end)
(if (save-excursion (goto-char pos) (eolp))
(setq pos (1+ pos))
(compose-region pos (setq pos (1+ pos))
?◉))))) This will convert every (non-newline) character to a fisheye (visually). Try opening a larger buffer, mark a region, and call |
Just took a .txt file with about 60 lorem ipsum paragraphs and ran |
Ah yes, it's a font-lock matter then, I believe. Here's a minor mode using font lock: (defun slo-down (start end)
"May cause tremendous slowdown when used in region."
(let ((pos start))
(while (< pos end)
(if (save-excursion (goto-char pos) (eolp))
(setq pos (1+ pos))
(compose-region pos (setq pos (1+ pos))
?◉)))))
(defvar slo-keys
'(("^[A-Ma-m].*$"
(0 (slo-down (match-beginning 0)
(match-end 0))))))
(define-minor-mode slo-mode
"Try to slow down the buffer."
nil " Slo" nil
(cond
(slo-mode
(font-lock-add-keywords nil slo-keys 'append)
(font-lock-ensure)
(font-lock-flush))
(t
(decompose-region (point-min) (point-max))
(font-lock-remove-keywords nil slo-keys)
(font-lock-ensure)
(font-lock-flush)))) This will convert any line beginning with a letter between a and m, you can easily play with the regex however to see how far you can go (worst case being |
If that does not break it it's likely not the bullets but the different faces. Then I'd probably whip up a function applying like a dozen different faces to each line. |
Again I did not manage to trigger a slowdown like the one that happens in org-bullets/org-superstar with inhibit-compacting set to nil (even in org-mode, with org-superstar disabled of course so as not to interfere in the results). On the other hand, if the font-lock was the culprit, I would have experienced a similar slowdown as a result of packages that add extra syntax highlighting via font-lock (e.g. https://github.com/cireu/elispfl, my fork of which with added features I have enabled in my own config), which hasn't been the case. |
Glad to hear you like it! Regarding the slowdown issue, I'll have to try cutting superstar-mode down to size to try and extract another potential MWE. Try this: load superstar and org as you normally would, but eval this afterwards in the scratch buffer: (defun org-superstar--update-font-lock-keywords ()
"Set ‘org-superstar--font-lock-keywords’ to reflect current settings.
You should not call this function to avoid confusing this mode’s
cleanup routines."
(setq org-superstar--font-lock-keywords
`(("^\\(?3:\\**?\\)\\(?2:\\*?\\)\\(?1:\\*\\) "
(1 (org-superstar--prettify-main-hbullet) prepend))))) Now the package only prettifies UTF-8 bullets and merges two fonts. If this triggers it then I can boil it down further into two variants, one of which will be the MWE. Thank you so much for your patience and continued help! 😄 |
@integral-dw It's great to see the care with which you are developing this package. Thank you. |
Trying to test this, I had a different problem now: When I at first got and tried to use the latest version of the org-superstar.el file, upon attempting to load an org file I got this error:
and org-superstar wasn't enabled. This error is obviously the result of commit 6fcf4b5 and has to do with the fact that After I got past this problem, replacing the problematic new version with the old one, after eval'ing the above code snippet and restarting org-superstar, I now got the lag (again having inhibit-compacting set to nil). Just to verify something: this changed the fontification so that all stars would show, but only the last one was fontified as a bullet - this was the expected visual result, right? |
@lmintmate You may find some of these tools useful for installing and upgrading packages not on MELPA: https://github.com/alphapapa/unpackaged.el#packages |
Correct! I'll sit down later and cobble together a more compact working example. Very strange that an error cropped up there, but it should be fixed now on both branches. |
Ah, my patch has been accepted. |
This file serves as a working example for the Issue discussed here: #3
Okay, I added a new version of |
Weirdly enough, I see lag for all 3 test cases. In particular, I tried scrolling down quickly, adding text and selecting (with the mouse) text in order to delete it. I see in all cases lag when scrolling down and when selecting text and deleting the selected text (though for the latter less often in case 2). I also saw lag very occasionally when adding text too. Unfolding headlines also lagged a little bit the first time I did it (though more so for cases 1 and 3). Just to be clear, the visual result for test cases 1 and 3 is that the last star of the line becomes a fisheye instead, while for test case 2 there is no obvious visual change, is that right? |
Yep, I guess I know what's going on now. I boiled the thing down to what I think is more or less an MWE. Try test-case 1 and 2. There will be no visual differences whatsoever. |
Now, I still see lag on both test cases when scrolling quickly, but on test case 1 I don't see lag when adding text and selecting text and deleting the selected text, while on 2 I do occasionally. And indeed there is no obvious visual change on both cases. I also don't see lag when unfolding all headlines on both cases (unless one counts the slight lag when enabling slo-mode). |
It's peculiar that you see any lag in test case 1, but that essentially means it's a deep-rooted font-lock issue. Case 2 essentially allows you to "stack" faces on top of one another, which I use to dynamically adapt the face of the bullet alongside the heading face. Quoting the documentation of
From the looks of it this issue stems not from special UTF-8 characters (or anything particular to the modes), but simply the (default) font used in conjunction with the particular system. It can likely be triggered by any fontlock-reliant mode. I'll put up a small explanation in the README about this and add the fix. |
This also covers what I believe is all I can do regarding the slowdown issue discussed here: #3
I think this update pretty much wraps this issue up. Thanks again for your help, @lmintmate! |
Regarding this:
I confess that I hardly use inline tasks at all, so I'm not requesting this. However, cleaning up the stars from inline tasks would be a very cool feature. So if you're looking for an excuse to do it, you can say that someone actually commented on it. ;) Maybe a nice idea for 1.1? |
So, as I previously hinted, I have taken a quick look at the open issues and suggestions over at org-bullets. Here's what I found:
It seems that there were performance issues related to the rendering of UTF8 characters. This seems to have been primarily an issue on windows, but sadly I currently have no way to test that. I would appreciate checking this package's performance on a modern windows computer!
TODO
-specific header bullets ☑️Another interesting suggestion was to add special bullets for
TODO
andDONE
headings, as suggested by @sumitsahrawat. I would like to know if people are generally interested in such a feature.Different codebase, different bugs. Currently I have squashed all bugs I could find, but I have more faith in my ability to produce bugs than in my ability to find them. If any strange behaviour crops up, be sure to open an issue!
That seems to cover the issue tracker of org-bullets. I would greatly appreciate comments regarding the points I found, how they may be applicable to or desirable for this package.
Thanks to everyone in advance!
The text was updated successfully, but these errors were encountered: