Open jave opened 7 years ago
I tried turning off segments to find a workable setting for tramp buffers, but I couldnt really find any.
also it seemed like projectile-project-p was called even if I turned off that segment.
So I made a little workaround. Revert to standard mode-line when slowness is perceived. The workaround works well, so there is indeed a connection between tramp buffers, spaceline-all-the-icons and slowness.
(defun jv-std-modeline () (interactive) (setq mode-line-format '("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces)) )
Hi @jave, yep, this is something I've been working on when I get chance. The latest version of all-the-icons
include memoization so that should hopefully improve things for you!
Basically, I noticed this because there was a recent change to use the files filename to calculate the icon in all-the-icons-mode-icon
segment, which performs a tonne of regexp matches. I've also changed this to use the the files major-mode
which is a quick alist assoc.
I don't really use tramp in my day to day, but I can imagine that my buffer-path
mode doesn't like it at all, so I could maybe add something to the predicate to disable/change that?
Also, I think Spaceline runs the :when
predicates even when the segment itself is disabled, which is unfortunate... So it may mean that the best design pattern is to perform the predicates as part of the main body of the segment if that makes sense?
tl;dr
What version of all-the-icons
are you on? Maybe try updating to get the memoization.
If you could tell me what kind of behaviour you'd like in a tramp buffer, I can start working on the compatibility with the buffer-path
segment
I use spaceline-all-the-icons-20170506.408 from melpa. So theres a newer one?
Nope, that's the latest version, but the library that it depends on (all-the-icons
) needs to be 20170513.1019
to get the memoization optimisations.
Which is newer than the latest spaceline-all-the-icons
. It's worth just checking that dependency.
However, like you say, there'll probably still be issues with tramp and the buffer-path
segment
ok, thanks, that dependency was indeed a couple of days older!
I don't know if this related or not, but Projectile mode-line has a similar problem (with sudo and TRAMP): https://github.com/bbatsov/prelude/issues/594
It seems related to s-a-t-i because I have no performance problems when using plain modeline, and tramp together.
I did some profiling. It seems some functions are called a lot. Shouldnt it be possible to improve performance with memoization for instance? Failing that, can I disable spaceline-all-the-icons--buffer-path perhaps?
<compiled 0x599ded3> 22232 45%
<compiled 0x447507> 2 0%