Function: isearch-del-char
isearch-del-char is an interactive and byte-compiled function defined
in isearch.el.gz.
Signature
(isearch-del-char &optional ARG)
Documentation
Delete character from end of search string and search again.
Unlike isearch-delete-char, it only deletes the last character,
but doesn't cancel the effect of other isearch command.
If search string is empty, just beep.
Probably introduced at or before Emacs version 27.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/isearch.el.gz
(defun isearch-del-char (&optional arg)
"Delete character from end of search string and search again.
Unlike `isearch-delete-char', it only deletes the last character,
but doesn't cancel the effect of other isearch command.
If search string is empty, just beep."
(interactive "p")
(if (= 0 (length isearch-string))
(ding)
(setq isearch-string (substring isearch-string 0
(- (min (or arg 1)
(length isearch-string))))
isearch-message (mapconcat 'isearch-text-char-description
isearch-string "")))
;; Do the following before moving point.
(funcall (or isearch-message-function #'isearch-message) nil t)
;; Use the isearch-other-end as new starting point to be able
;; to find the remaining part of the search string again.
;; This is like what `isearch-search-and-update' does,
;; but currently it doesn't support deletion of characters
;; for the case where unsuccessful search may become successful
;; by deletion of characters.
(if isearch-other-end (goto-char isearch-other-end))
(isearch-search)
(isearch-push-state)
(isearch-update))