Comments (7)
@gcv: Thank you. I'll take a look this week-end. I'm sorry for answering you only now... crazy weeks ;)
from perspective-el.
@gcv: Hi, I managed to speed up the processing further... I'm currently perfecting the code. Expect a PR soon ;)
I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in
persp-maybe-kill-buffer
much faster.
Benchmarks reveal that the processing could be sped up going bare metal, beyond the utility functions, accessing directly the data.
I put in a hack to allow killing temporary buffers (which we should not care about) without the expensive check. See 672d02d.
It's working on temporary buffers killed directly with kill-buffer
. Smart solution ;)
from perspective-el.
I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in persp-maybe-kill-buffer
much faster.
from perspective-el.
I think there needs to be a much faster mechanism for checking which perspectives a buffer is in. Maybe each buffer should keep track of it in a buffer-local variable, which will make the lookup in
persp-maybe-kill-buffer
much faster.
Thank you for the suggestions @gcv, I'm starting debugging to focus the problem... I'll report back to you ASAP ;)
from perspective-el.
Hi @gcv, after nights of debugging I can't manage to trigger the mentioned bug... maybe @deejayem, @ibytao, and @dpassen can give some context. I would like to design some regression tests...
I see there was a discussion about the recursive minibuffer in #163... I tried (setq enable-recursive-minibuffers t)
and also (savehist-mode)
with (setq savehist-autosave-interval 1)
but nothing...
How should I setup Emacs 27.2 to reproduce the bug #167? I'm on Gentoo GNU/Linux, by the way.
What sequence of commands should I execute?
Thank you all. In the meantime, I'll keep trying ;)
from perspective-el.
Thanks for looking into it. Don’t worry about that bug specifically. Commit 6e87eeb in master worked around it.
I commented out persp-maybe-kill-buffer
because of how frequently it gets called. It made basic Magit use feel very sluggish. When I put a breakpoint in it and start Magit or Helm, persp-maybe-kill-buffer
gets hit a lot because those packages create and destroy tons of temporary buffers. I run with a lot of perspectives and buffers, so the traversals in that function take a while. Feels like there’s an O(n^2) thing going on.
Maybe just adding a simple heuristic would be enough. Like assuming every buffer name that starts with a space (“hidden” buffer) can automatically be killed because none of them belong to a perspective. Not sure.
I still really like the intent behind persp-maybe-kill-buffer
— it’s just a fairly intrusive thing to have to run all the time, and so we need to make it really fast.
Feel free to look at my Emacs configuration (27.2, Mac) for inspiration: https://github.com/gcv/dotfiles/tree/master/emacs
from perspective-el.
@mehw: I put in a hack to allow killing temporary buffers (which we should not care about) without the expensive check. See 672d02d.
Then I reenabled the check, but hid it behind a feature flag, and turned it off by default: 248b4e9 — tests are now passing again.
I'll try running the code with persp-feature-flag-prevent-killing-last-buffer-in-perspective
set to t
for a while and see if I run into trouble. Please do the same. If everything looks good, I'll turn it on by default.
from perspective-el.
Related Issues (20)
- Marginalia annotation not working with `persp-switch-to-buffer*` HOT 4
- persp-mode does not get activated during startup HOT 3
- helm mini frame errors saying no such buffer HOT 5
- Recently released Emacs 28.1 uses `C-x x` for buffer actions, thus conflicting with the prefix for perspective-el HOT 10
- [feature request] - Option to not save modes for buffers HOT 1
- Creating pipe: Too many open files HOT 5
- Can't setup perspective layout at startup HOT 4
- Perspective breaks after enable-theme HOT 5
- Perspective hides buffers when running Emacs as server HOT 4
- Current perspective name not being propertized in the mode-line HOT 5
- Display perspective in frame title HOT 7
- `C-x 5 2 ` different behaviour when running perspective with daemon HOT 2
- Perspective.el wipes out perspectives when a emacsclient frame is closed. HOT 2
- `persp-delete-frame` alters windows of other frames when killing frame with dedicated window HOT 1
- Issue with using ediff and perspective [sorted] HOT 6
- Compare to tabspaces? HOT 2
- Support eshell state save and restore
- Would it support different themes per frame? HOT 2
- Loading perspectives upon opening emacs HOT 5
- ibuf-ext.el not loaded HOT 2
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 perspective-el.