;;; +isearch.el --- iseach (and query-replace) extensions -*- lexical-binding: t; -*- ;;; From https://github.com/astoff/isearch-mb/wiki (defun +isearch-cancel@add-search-to-history () "Add search string to history also when canceling. This should be used as `:before' advice on `isearch-cancel'." (unless (string-equal "" isearch-string) (isearch-update-ring isearch-string isearch-regexp))) (defun +perform-replace-dont-exit-on-anykey (orig &rest args) "Don't exit replace for anykey that's not in `query-replace-map'. This should be used as `:around' advice for `perform-replace'." (save-window-excursion (cl-letf* ((lookup-key-orig (symbol-function 'lookup-key)) ((symbol-function 'lookup-key) (lambda (map key &optional accept-default) (or (apply lookup-key-orig map key accept-default) (when (eq map query-replace-map) 'help))))) (apply orig args)))) (provide '+isearch) ;;; +isearch.el ends here