preview

Clojurescript Reagent Image-Previewing Selector

Intro It took some elbow-grease but I was able to convert online examples1 into a working image selector in Reagent Clojurescript. It isn’t a lot of code, but there were two complications: converting the declarative style of the examples into more functional CLJS (hint: it involves closures), and doing it in a way that will jive with the React life-cycle. CSS code The following styling makes things look okay. This is using Garden2 syntax.

Customizing or disabling Ivy/Swiper pre-selects

By default ivy/swiper/counsel (not sure which) will visit all results as I scan through a list, e.g. when going through my buffers. I thought I liked this until working on my exwm with multiple monitors and non-emacs buffers are only allowed to appear once, meaning that simply moving down my selection list caused screen to be stolen from my other monitor. Answer Buffer-changes are apparently an effect of using counsel-switch-buffer, which I had bound to C-x b.

Image previews with helm-follow-mode

When using helm-find-file you can use helm-follow-mode to cause images to show themselves as you move over them, replacing the need to start up some other program to preview images. The shortcut for that while within helm-find-file is C-c C-f. By default, you will be ejected from the follow mode as soon as you move over a non-image file. The following customizatoin will give it a little more tolerance: (setq helm-follow-input-idle-delay 0.