branch: elpa/isl
commit 2e52d36510bf64bc6d23ffebf7024370e57db9e8
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Use read-from-minibuffer to allow isl-map usage
    
    in simple search function. This could be useful to e.g. change
    matching style during macros.
---
 isl.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/isl.el b/isl.el
index 4f021b8fe5f..e8b35c6c7fa 100644
--- a/isl.el
+++ b/isl.el
@@ -1005,10 +1005,20 @@ appended at end."
                 isl-current-buffer)
       (switch-to-buffer isl-current-buffer))))
 
+(defvar isl-mini-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map minibuffer-local-map)
+    (define-key map (kbd "M-r")    'isl-change-matching-style)
+    (define-key map (kbd "C-c f")  'isl-select-case-fold-search)
+    (define-key map (kbd "C-j")    'isl-toggle-multi-search-in-line)
+    map)
+  "A minimal map used only in `isl--search-string'.
+Use here only commands able to run inside kmacros.")
+
 (defun isl--search-string ()
   "Search next match forward from point and stop.
 This function is intended to be used in kmacros."
-  (let ((str (read-string "Search: ")))
+  (let ((str (read-from-minibuffer "Search: " nil isl-mini-map)))
     (isl-multi-search-fwd str nil t)))
 
 ;;;###autoload

Reply via email to