Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case is ignored when case-fold-search is t #24

Open
djr7C4 opened this issue Jan 3, 2023 · 1 comment
Open

Case is ignored when case-fold-search is t #24

djr7C4 opened this issue Jan 3, 2023 · 1 comment

Comments

@djr7C4
Copy link

djr7C4 commented Jan 3, 2023

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))
  ...)
@djr7C4
Copy link
Author

djr7C4 commented Jan 3, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant