Comments (3)
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.
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.
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)
- Please add legacy bindings to the key-map HOT 3
- set-transient-map is set to nil when running olivetti-expand HOT 25
- Olivetti no longer scales with `text-scale-mode`
- Post your screenshots here HOT 9
- Olivetti does not react to some frame resizing HOT 6
- Incompatibility with diff-hl and making olivetti a global mode HOT 10
- The new keymap appears to still conflict with (or shadow) org-mode's HOT 3
- Unexpected sync between two olivetti-mode windows HOT 2
- Confliction with git-gutter HOT 2
- How to enable olivetti globally or to some modes HOT 1
- Wrapped text shifts left when company auto-complete comes up HOT 8
- Feature Request: Set Olivetti "gutter" background colour HOT 1
- Middle mouse click does not paste HOT 2
- Side window bug HOT 3
- Fix mouse-wheel events when mouse-wheel-mode is unavailable
- Olivetti errors on org buffer HOT 7
- olivetti-mode isn't activated on the minibuffer when executing isearch commands. HOT 3
- Please share your modeline config HOT 1
- Please explain "a nice writing environment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from olivetti.