hotfuzz
hotfuzz copied to clipboard
Getting hotfuzz-module to play nicely with consult
I've been playing around with the hotfuzz-module and it's so fast — just ran into one issue with consult which uses these 'tofu' characters in candidates which breaks with this error:
Debugger entered--Lisp error: (wrong-type-argument unicode-string-p #(".gitignore�" 0 10 (face consult-file multi-category (file . ".gitignore")) 10 11 (invisible t consult-strip t)))
hotfuzz--filter-c("m" (#(".gitignore�" 0 10 (face consult-file multi-category (file . ".gitignore")) 10 11 (invisible t consult-strip t)) #("README.md�" 0 9 (face consult-file multi-category (file . "README.md")) 9 10 (invisible t consult-strip t))
...
Any ideas how I can work around this? I've tried stripping out those characters but to no avail so far. Oddly enough it works fine without the compiled module (albeit much slower), so it might actually be an issue with my system/compiled module.
BTW, I've been able to get the module compiling and loading on macOS. I need to clean up how it works as I had to change some settings in the CMake file and it wasn't finding my emacs module header, but after working around that it has been working flawlessly, apart from this consult tofu character issue. This could be related, but also after cleaning it up I'm hoping to open a PR here :)
If the non-Unicode Tofus create problems you can set consult--tofu-char
and consult--tofu-range
such that characters from the private Unicode plane B are used instead. The range will be smaller but encoding issues are avoided.