Code Monkey home page Code Monkey logo

Comments (14)

integral-dw avatar integral-dw commented on June 4, 2024 1

Oh, that IS news to me! I'll have a look in the near future :)

from org-superstar-mode.

integral-dw avatar integral-dw commented on June 4, 2024

Hi @wakatara, that's a pretty nifty idea! I'll have to think about it, though I may not manage to do so properly before February.

from org-superstar-mode.

wakatara avatar wakatara commented on June 4, 2024

Well, I am using the right triangle now to demarcate the first two levels (as I did mess around with Notion over the holidays) and the toggle feature there is very nice (which is basically just org-mode folding and unfolding but with a nice vidual indicator. Also, while I'm thinking about it, this would also remove the need for the org-mode end of line ellipsis I currently use as well (which happens to be a down triangle... :-/ ).

And I am sure I can hold my breath till February. Thanks for all your work on this library! Makes the UX in org-mode much much nicer. Makes a big difference.

from org-superstar-mode.

wakatara avatar wakatara commented on June 4, 2024

Actually, an even better think here would be to also allow the bullet to be optional or distinct if there was information in the fold.

So, for example, have a simple hidden or missing bullet if it's simply a headline but then display a ▶ if there is actual content folded into the headline (and then, of course, the down arrow ▼ once unfolded... =]

from org-superstar-mode.

integral-dw avatar integral-dw commented on June 4, 2024

I finally have more time on my hands to look into this a little more. I looked a bit into the options and I'm afraid that the solution for this is the same that allows for example creating even more interactive elements in Org that can hide away information. It's a project I have put on hold for a while but wanna pick up again soon. The core technical issue to overcome with it is twofold:

On the one hand, you can have text in an Emacs buffer hold such metadata (like "do I belong to a folded entry?") effortlessly, but keeping this metadata up to date requires a lot of moving parts in real time. Essentially each time the user executes a command and changes the buffer some bookkeeping will need to be done. This is the job of a mode that wants to achieve this.

On the other hand, making Emacs visualize that metadata ("ah, this bullet belongs to a folded entry, hence I ought to display it as..") is also rather simple. This task is deferred to font-lock, which handles everything from syntax highlighting to Superstar making Org look nice. However, font-locking can be quite expensive, hence font-lock does not just constantly update the buffer but tries to only change bits it "has to".

And that's the problem, really: Keeping these two independent processes in sync, and I'm working on an entire mode dedicated to nothing but keeping these two things in sync. I have not yet found a solution for this that can't be confused by simple operations, however (like cutting out large chunks of a buffer etc). My next plan towards this goal is to first write down and explain what I am doing over there and talk to the Emacs upstream to gain a deeper understanding of "real-time" font-lock. Sorry for the rant, but after discovering that this leads down the same rabbit hole as #20 I thought it was necessary to mention this at least somewhere.

To get back to your initial request, there may be a way to do this specific thing with a nice hack involving orders of magnitude less complexity, so I'll see if I can come up with something over the weekend. If not, it is only an even bigger incentive to get the org-menu-mode engine to run without race conditions and other timing nonsense.

from org-superstar-mode.

wakatara avatar wakatara commented on June 4, 2024

Wow, that is much more complex than I thought it would be (so, out of curiosity, how does the org-mode ellipsis symbol know to appear on fold and unfold then?). Thank you for even considering it.

I think your entire mode sounds very interesting and have to admit I selfishly want it since I'd also like better TeX rendering than org-mode currently support in-buffer.

In any case, certainly interested to see what you come up with. I have to admit to only have messed around with font-lock over the Xmas holidays when I wanted to make my emacs experience a lot closer to something like Notion, so really interested in seeing the results.

from org-superstar-mode.

integral-dw avatar integral-dw commented on June 4, 2024

Yeah, sadly it's a bit hairy.

so, out of curiosity, how does the org-mode ellipsis symbol know to appear on fold and unfold then?

Org mode uses overlays for that, which are rather convenient, but as far as I'm aware can cause slowdown if used extensively. I usually restrict myself to using text properties exclusively, especially since my modes would easily double/triple the amount of overlays in the worst case.
(EDIT: I have consulted the info node again, and yes, excessive use of overlays is discouraged.
Good to know where I got that from. 😅 )

Anyway, I'll work on a more coherent update on the matter on the other repo, though I will likely first have to do some Font Lock research...

from org-superstar-mode.

andersjohansson avatar andersjohansson commented on June 4, 2024

This would definitely be a cool feature! (maybe something for upstream org even). BTW, @integral-dw, if you are not aware of @yantar92's work on reimplementing the org folding mechanism with text properties instead of overlays, you should take a look at that. May be some overlap or inspiration for org-superstar: https://github.com/yantar92/org

from org-superstar-mode.

andersjohansson avatar andersjohansson commented on June 4, 2024

I have been using the org-fold branch for a few weeks and found that it speeds up my large org files. Hopefully it will be ready for merging soon.

from org-superstar-mode.

wakatara avatar wakatara commented on June 4, 2024

@andersjohansson
What does org-fold do precisely? (and have you seem origami? I use that to help with folding in super-org-agenda. It is great.).

from org-superstar-mode.

wakatara avatar wakatara commented on June 4, 2024

@integral-dw

Hola! Was just wondering if you ever got a chance to look into those overlays. (the interesting thing is most apps that use a web rendering (notion, workflowy, etc et) and lists now do the "▶" to "▼" swivel thing now. It is actually a suprisingly nice dynamic.

Anyhow, was just wondering as I was back in org-mode again... =]

from org-superstar-mode.

yantar92 avatar yantar92 commented on June 4, 2024

from org-superstar-mode.

integral-dw avatar integral-dw commented on June 4, 2024

Hi everyone,
sorry I've been so quiet. I've been out of commission last year and am slowly working through the issues again.
The org-fold patch in principle may allow me to implement that feature quite neatly, actually. I'll need to do some housekeeping in the Issue tracker but I'm just letting you know it's on my mind, thank you for your patience!

from org-superstar-mode.

andersjohansson avatar andersjohansson commented on June 4, 2024

By the way, outline-mode got these kinds of toggles in Emacs 29. I haven’t looked into the implementation, and whether it can be used for org (which has recently split with outline-mode). But looks promising.

from org-superstar-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.