smart-scan
smart-scan copied to clipboard
Case is ignored when case-fold-search is t
Ideally, smartscan would know which languages have case insensitive symbols (like Common Lisp) and know when to ignore case and when to be case sensitive. However, this is probably more trouble than it is worth since symbols are almost always written with the same cases anyway.
An easy fix that seems good enough is to simply wrap the calls to search-forward, re-search-forward and re-search-backward in smartscan-symbol-replace and smartscan-symbol-goto with a
(let ((case-fold-search nil))
...)
Until this is patched, I'm using the following advice (posted in case anyone else wants it).
(defun without-case-folding (orig-fun &rest args)
(let ((case-fold-search nil))
(apply orig-fun args)))
(advice-add 'smartscan-symbol-goto :around 'without-case-folding)
(advice-add 'smartscan-symbol-replace :around 'without-case-folding)