-
Notifications
You must be signed in to change notification settings - Fork 14
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 insensitive isearch #15
Comments
In the search prompt of Adding the same feature to isearch would be quite a hassle, I believe. You can always manually type |
I'd like it to always be insensitive. But maybe I can write up some code that always adds |
Note that this is even if I have |
The advice from #12 (comment) works for me as a workaround, but I don't see why this shouldn't work by default (assuming the isearch settings are configured to ignore case), and I especially don't see why it shouldn't respect the vr settings. |
I don't think it does. It is defined in As mentioned here, I obeyed the isearch case-fold-search variable in the past, but removed it, unfortunately without writing down the reason in the commit message :( I vaguely remember that there was some trouble with that. However, I don't see a problem in adding this feature if it doesn't break anything. However, I don't see a reason not to implement this feature if it behaves okay. So the task consists of two points:
Then there is the question on whether to use the regular isearch key map to manipulate the Hence the
From my first response. |
|
Can you check with Do |
I get the same behavior with emacs -q. I've got a few isearch customizations (including isearch+), so those may be interacting somehow. With my emacs configuration, |
This is very bizarre. In vr/isearch-forward, there is no code to prepend the
What do you mean? With |
No I mean in my .emacs I do. With emacs -q it doesn't happen (sorry, I meant to type "I get the same behavior as you" above). |
I've modified a bit the code provided in #12 (comment) to make it toggleable (sorry, I've little knowledge of elisp): ;; Togle case sensitiveness for vr/isearch
(defun toggle-vr-case-insensitive ()
"Toggle case-insensitive search for visual-regexp."
(interactive)
(setq advice-list (list))
(advice-mapc (lambda (advice _props) (push advice advice-list)) 'vr--isearch)
(message "advices %d" (length advice-list))
(if (= (length advice-list) 0)
(message "Enabling case-insensitive search"
(defadvice vr--isearch (around add-case-insensitive (forward string &optional bound noerror count) activate)
(setq string (concat "(?i)" string))
ad-do-it))
(message "Disabling case-insensitive search"
(advice-mapc (lambda (advice _props) (advice-remove 'vr--isearch advice)) 'vr--isearch)))
)
(global-set-key (kbd "C-c t") 'toggle-vr-case-insensitive) |
I have enabled case insensitivity in the vr/default-regexp-modifiers, but vr/isearch-forward is still case sensitive. Ideally vr/isearch-forward would be insensitive by default anyway (or use something similar to the default isearch behavior).
The text was updated successfully, but these errors were encountered: