Giter Club home page Giter Club logo

Comments (3)

rnkn avatar rnkn commented on May 24, 2024

Interesting. I had always thought of Olivetti as an extension of visual-line-mode, and that it would only be used for prose writing, but I've since seen plenty of people using it for code (which I find weird but that's cool).

Yeah we could just add as a default hook with it in the :options so it appears as a checked checkbox, and remove the hardcoded stuff.

Two things I think we should consider though...

The option olivetti-recall-visual-line-mode-entry-state seems obvious to have if visual lines are hardcoded, but weird if just a hook. The thing that I'm stuck on is how to then write the doc string for this option without it sounding convoluted/complicated.

The other thing is tangential to this but I think will absorb much attention; given I'd only ever seen Olivetti as an extension of visual lines, and for writing prose, I never bothered much with compatibility with line numbering. When display-line-numbers-mode was introduced I put some fruitless effort into trying to add compatible with it, but display-line-numbers-mode is written into the C code and provides scant interfacing to Elisp. The function line-number-display-width is supposed to return the width used for displaying line numbers in the selected window (e.g. lines up to 99 return 2, up to 999 return 3) but it's never accurate. The result is you can't calculate the offset correctly and scrolling will causes the window text to jump back and forth by a column. When I approached the maintainer about this he dismissed the problem.

So I guess my feeling is without hardcoded visual lines it might present an obligation to be compatible with line numbering, which seems like a bigger problem. What do you think?

from olivetti.

larstvei avatar larstvei commented on May 24, 2024

Thanks for the quick reply! I never thought about the tight connection between Olivetti and visual-line-mode, because I use auto-fill-mode by default for everything, so it's is only once in a while I actually observe lines that are wrapped.

For the question of olivetti-recall-visual-line-mode-entry-state, would it be sufficient to add a note saying something like "Setting this variable will only have an effect if olivetti-enable-visual-line-mode is non-nil"?

I tried running display-line-numbers-mode and didn't see any odd-looking behavior. Is the problem that the line numbers are moved along with the margin? I don't really see the connection between visual-line-mode and line numbering (and never use line numbering anyways), so I don't see it as an issue. But then again, I think you have a better perspective on how other people use the package, and I can only speak for my usage.

In any case, I think visual-line-mode only happens to play nice with the core functionality of Olivetti, which makes me think of it as an opt-in feature. A strong argument for making it enabled by default is that there might be many users who will have to edit their configs if this is changed. I would think that most people who prefer visual-line-mode will already have it configured to be enabled for text/org/markdown buffers, but this is a mere guess.

from olivetti.

rnkn avatar rnkn commented on May 24, 2024

Cool, let's worry about line numbers another day then.

I would rather just add visual-line-mode to the hook and to its :options keyword. Does that makes sense? Can you whip up a PR?

Don't worry about the doc of olivetti-recall-visual-line-mode-entry-state, I'll think about it afterwards.

from olivetti.

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.