I've rebound some keys in god-mode so that
R start a forward and backward incremental search and
r repeat but never start incremental searches. This is the approximate division of labor between Vim's
This has some behavior I like, namely that the previous incremental search query is available until I specifically replace it with a new one via
But, it leaves "stray highlighting" when I'm moving around via
r. The stray highlighting seems to last indefinitely.
To reproduce the problem, run the
.emacs file below, it will drop you into the scratch buffer with
scratch-mode already activated.
g <to navigate to the top of the buffer
RETto start a forward incremental search. The cursor should now be immediately after
rmoving forward three matches and then backward three matches.
- wait one second
- All of the
scharacters in the buffer are now highlighted with a greenish color behind them.
How do I clear the greenish color behind all the
s characters without replacing the "current default isearch query"?
;; minimal init.el to represent problem. (progn (defun isearch-repeat-forward-command () (interactive) (isearch-repeat-forward)) (defun isearch-repeat-backward-command () (interactive) (isearch-repeat-backward)) (package-initialize) (require 'god-mode) (god-mode-all) (global-set-key (kbd "s-g") #'god-mode-all) (define-key god-local-mode-map (kbd "i") #'god-local-mode) (define-key god-local-mode-map (kbd "s") #'isearch-repeat-forward-command) (define-key god-local-mode-map (kbd "r") #'isearch-repeat-backward-command) (define-key god-local-mode-map (kbd "S") #'isearch-forward-regexp) (define-key god-local-mode-map (kbd "R") #'isearch-backward-regexp) (identity 1))