color-identifiers-mode is very slow when hideshowvis is enabled
Issue filed for both projects.
https://github.com/ankurdave/color-identifiers-mode/issues/83
Thanks for the report. Tried this with my config but both cases (begin and end of file) finish nearly instantly. Will try later with only your minimal config. Which versions did you use of Emacs and color-identifiers-mode? Tried using 27.2, 1.0.0
└──> emacs --version
GNU Emacs 29.0.50
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Here's an init.el file:
(require 'package)
(package-initialize)
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(eval-when-compile (require 'use-package))
(setq use-package-always-ensure t)
(add-to-list 'load-path "~/.emacs.d/lisp")
(use-package hideshowvis
:diminish
:load-path "~/.emacs.d/lisp"
:bind ("M-[" . hs-toggle-hiding)
:init (progn
(add-hook #'prog-mode-hook (lambda () (hideshowvis-enable) (hideshowvis-symbols)))))
(use-package color-identifiers-mode
:diminish
:config (global-color-identifiers-mode))
I open up the big c++ file and make sure that hideshowvis and color-identifers are both running. You should see the colored variable names and all the little hideshowvis marks in the fringe. Then hold pagedown until you hit the bottom and then refresh the color identifiers. For me it's very consistently reproduceable a problem.
Maybe try again with my minimal init.el?
Tried this with Emacs 27 calling color-identifiers:refresh is instant for me. Could you try with the latest stable version?
M-x version
GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0)
Same with Emacs 29
GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0)
I've used the following default.nix file to reproduce using nix-shell (on NixOs):
{
nixpkgs ? (builtins.fetchGit {
name = "nixos-stable-21.05";
url = "https://github.com/nixos/nixpkgs";
ref = "refs/tags/21.05";
}),
emacsOverlay ? (import (builtins.fetchGit {
url = "https://github.com/nix-community/emacs-overlay/";
ref = "master";
rev = "343c8b190c66979d9a543c216148d417146db5c1";
})),
}:
with import nixpkgs {};
with import <nixpkgs> { overlays = [ emacsOverlay ]; };
let dummy = 0;
# myEmacsPkg = emacs;
myEmacsPkg = emacsGit;
# myEmacsPkg = emacs.override { withXwidgets = true; };
# myEmacsPkg = emacsPgtkGcc.override { withXwidgets = true; };
myEmacsWhatever = (emacsPackagesFor myEmacsPkg);
hideshowvis = callPackage ({}:
myEmacsWhatever.elpaBuild {
pname = "hideshowvis";
version = "0.7";
src = builtins.fetchurl {
url = "https://raw.githubusercontent.com/sheijk/hideshowvis/0.7/hideshowvis.el";
sha256 = "675ec91748194d8688d208ea63a53b16ee0c6e87c5585e6fe408713481919ce9";
};
}) {};
myPackages = epkgs:
let stable =
(if lib.versionAtLeast myEmacsPkg.version "28.0"
then epkgs.melpaPackages
else epkgs.melpaStablePackages);
new = epkgs.melpaPackages;
in [
stable.use-package
stable.paredit
new.color-identifiers-mode
hideshowvis
];
myEmacs = myEmacsWhatever.emacsWithPackages myPackages;
in
stdenv.mkDerivation {
name = "my-emacs";
buildInputs = with pkgs; [
figlet lolcat
mu # for mu4e
libvterm # see also new.vterm
ripgrep
bash
coreutils
];
propagatedBuildInputs = [
myEmacs
];
unpackPhase = "true";
buildPhase = false;
installPhase = ''
mkdir -p $out
'';
shellHook = ''
figlet "OMG Emacs!" -t | lolcat --freq 0.5
'';
}
Hmm, I don't know what to say! It very consistently a problem on my system yet you don't seem to see it. I don't know how else to test it.
Sorry for the delay. Some things you could try:
- install Emacs 27 (latest stable version), the 29 indicates this is a build from source/snapshot
- try to install Nix and use the above derivation to install the same Emacs version I have and see if the issue happens there, too
The related ticket for color-identifiers-mode has been marked as resolved and this cannot be reproduced so I'll close this one, too