emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A search function that skip some characters


From: martin-u
Subject: Re: A search function that skip some characters
Date: Fri, 9 Dec 2011 12:29:33 -0800 (PST)

Well, I have now the function mfun:

(defun mfun (&optional regexp-p no-recursive-edit) ;I've just copied it from
another function
  (interactive "P\n")
  (setq str (read-from-minibuffer
        "Mysearch: "))
  (insert-before-markers
   (mapconcat (lambda (c) (regexp-quote (string c))) str "[.,2]*"))
  )

I put it into my dot.emacs and it works (but badly). So, if I want to find
the all the "t[,.2]*e[,.2]*x[,.2]*t" regexps, I call M-x mfun. Then I type
"text" into the minibuffer. Then mfun put into the normal buffer
"t[,.2]*e[,.2]*x[,.2]*t" that I have to copy. Then I have to call
isearch-forward-regexp and put in it minibuffer the copied regexp
"t[,.2]*e[,.2]*x[,.2]*t". As you see this not a good solution.

Calling "isearch-forward-regexp" from mfun is not difficult. The problem is
that I can't put the REGEXP of "mapconcat" into the minibuffer of
isearch-forward-regexp.

For this I need some help. Or maybe you have another idea?
-- 
View this message in context: 
http://old.nabble.com/A-search-function-that-skip-some-characters-tp32926746p32945125.html
Sent from the Emacs - Dev mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]