For example: I want the regexp ^\*.*
to appear as the search pattern after typing M-x isearch-forward-regexp
and <return>
.
Asked
Active
Viewed 86 times
0

Big Shield
- 612
- 5
- 15
1 Answers
0
I found the solution:
(defun foo ()
(cond
((string= (minibuffer-prompt) "Regexp search: ")
(insert "^\\*.*"))))
(add-hook 'minibuffer-setup-hook 'foo)
- Press
C-M-s
and<return>
, then the regexp^\*.*
will appear as the search pattern. - Complement the full regexp (such as
^\*.*emacs
) and<return>
. - Press
C-M-s
andC-s
to search incrementally.
References:

Big Shield
- 612
- 5
- 15