For the record, the search ring advance/retreat commands suffer from a bug similar to the `isearch-del-char' one described here. Namely, `C-s M-p M-p M-p' presumably takes you to the first match, after the starting point, of the third history element. It would be very strange to expect that the result of this key sequence depends on the first and second history elements, or on the contents of the buffer beyond the first match of the third history element. And, in fact, everything is fine when `search-ring-update' is nil. However: (progn (setq search-ring-update t search-ring '("1" "2" "3") search-ring-yank-pointer nil) (save-excursion (insert "expect point here -> 3 2 1 2 3 <- but instead get here")) (isearch-mode t) (isearch-ring-retreat) (isearch-ring-retreat) (isearch-ring-retreat)) On Sun, 14 Feb 2021 at 19:45, Juri Linkov wrote: > I tried again, but your patch still doesn't work. With > > (progn > (define-key isearch-mode-map (kbd "DEL") 'isearch-del-char) > (execute-kbd-macro [?\C-s ?y backspace ?x ?1])) > x1yx2 > > It signals the error "Keyboard macro terminated by a command ringing the bell". Now I see, my old patch only worked in regexp mode (which is `C-s' for me). The attached one seems to work (but this is subtle stuff, there may be edge cases).