For example, if I type "foo spam
" after the prompt of isearch-forward
, how can I advice some functions in isearch.el
to convert the string to "foo[.?:,!]?[ \n]spam
" before search? Basically I want to search for the two adjacent words in the text. I know I can use isearch-forward-regexp
to do that, but it's painful and error-prone to type out the regexp directly and I have many strings of that kind to search. I tried to understand code in isearch.el
but failed. hope some Emacs gurus could help me out. Thanks.
相关问题
- Symbol's function definition is void: declare-
- How can I set the SVN password with Emacs 23.1 bui
- Emacs shell: save commit message
- emacs bind key to the insertion of another
- Emacs - set mark on edit location
相关文章
- ess-rdired: I get this error “no ESS process is as
- Emacs/xterm color annoyance on Linux
- Does learning one Lisp help in learning the other?
- Pipe less to Emacs
- Capturing the output of “diff” with org-babel
- emacs terminal mode: how to copy and paste efficie
- How to permanently enable the hs-minor-mode in ema
- Pipe emacs shell output to a new buffer
You may be interested in
isearch-toggle-word
(M-s w) during your incremental search.http://www.gnu.org/software/emacs/manual/html_node/emacs/Word-Search.html
This will search for individual words ignoring punctuation, spaces and line ends.
Here's a rough crack at it:
I think you have to bind it to a key in
isearch-mode-map
; I don't think M-x works quite right inisearch-mode
.If you require more power, there is a variable
isearch-search-fun-function
, which you can set to a function that returns a function. The returned function is used to find the next match.