Comments (11)
Try removing window-configuration-change-hook
and see if you get better results. post-command-hook
is actually not called as much as one might think.
from olivetti.
Could you explain your reasoning for thinking that may be the culprit? The slowness was experienced while simply navigating left and right on a single line without triggering scrolling on any sort, so I have a hard time imagining that window-configuration-change-hook
would be called. My suspicion of post-command-hook
was further strengthened by the problem going away after I removed olivetti-set-environment
from post-command-hook
.
It might be because I have various other modes enabled, but for me, post-command-hook
runs on pretty much every keypress. Among other things:
- On arrow key navigation (
next-line
,previous-line
,evil-backward-char
,evil-forward-char
), - On inserting keypresses in a buffer (
outshine-self-insert-command
), and - On inserting keypresses in the minibuffer (
self-insert-command
).
I'll give you that the amount of time I spend actively pressing keys is small in comparison to the time I spend looking at buffers, but using that to say "it's not called as much as one might think" seems like a mischaracterisation. During those short bursts of active typing are precisely the time I need insertion to be responsive!
from olivetti.
I know it seems counterintuitive; I got into a protracted argument with Eli about this but ended up eating humble pie because window-configuration-change-hook
is called way more often than post-command-hook
.
from olivetti.
from olivetti.
Might be able to get away with only window-size-change-functions
, but that has broken compatibility in 27.x. I'm handing olivetti over to GNU ELPA so this should be fixed soon by people who know more about the display code than me.
from olivetti.
I have no doubt that exchange happened, but I still don't know what you mean by "way more often".
I tried verifying my experience just now by adding a function to window-configuration-change-hook
that incremented a number by one, and another function to post-command-hook
that decremented the same variable by one. I then performed the operations I'm talking about (navigating around a buffer, inserting some text) for half a minute, and then when I displayed the value of the counter it was distinctly negative.
I'm not using Spacemacs (I still have nightmares from trying to wrap my head around configuring it!), but I do have evil-mode
active.
from olivetti.
Posting as a separate comment for emphasis:
I should state more clearly that this is not a general, constant problem, which makes it hard for me to isolate the issue. I'm currently running the default Olivetti hook set-up with no issues at all. This has yet only happened once, after Emacs had been running for quite some time. However, when it happened, it was very clear that the post-command-hook took way too long.
I'll try to remember to fill in more information if/when it happens again.
from olivetti.
Interesting. I tried a similar incrementing test and window-configuration-change-hook
won. But that was maybe Emacs 25, and I suspect that work has been done to call that hook less and window-size-change-functions
more.
I've had some feedback from Stefan about how best to get this working nicely so it should be better soon.
from olivetti.
I've switched back to window-configuration-change-hook
and removed post-command-hook
. Changes have been pushed to GitHub and GNU ELPA.
from olivetti.
I have upgraded to the latest olivetti package now, and I'll try to take note of this happening again. Although due to the nature of the issue, it would take some time. I don't know if you want to close this issue and then I reopen it if it happens again, or however you want to handle it.
Thank you for maintaining such a great mode!
from olivetti.
Cool, thanks for checking it. I'll close now and if it you see further problems, can you report to [email protected] (which will go to me).
I still need to push some more changes that should speed things up for Emacs 27. (I'm trying to keep support for Emacs 24 onwards.)
from olivetti.
Related Issues (20)
- 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
- Maybe not enable visual-line-mode by default? HOT 3
- 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
- feature request: maintain a minimum left margin HOT 2
- After shrinked buffer is closed, other buffers remain shrinked as well HOT 2
- Eager macro-expansion failure with `use-package` 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.