From 59a1f58695d09ab29ddf992b2c0711c94a4039ea Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 3 Jan 2023 23:03:03 -0600 Subject: Switch to use-package --- lisp/+isearch.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lisp/+isearch.el (limited to 'lisp/+isearch.el') diff --git a/lisp/+isearch.el b/lisp/+isearch.el new file mode 100644 index 0000000..3516ec4 --- /dev/null +++ b/lisp/+isearch.el @@ -0,0 +1,24 @@ +;;; +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 -- cgit 1.4.1-21-gabe81