From: "Drew Adams" <drew.adams@oracle.com>
To: "'martin-u'" <auto51@hushmail.com>, <Emacs-devel@gnu.org>
Subject: RE: A search function that skip some characters
Date: Sat, 10 Dec 2011 08:20:43 -0800 [thread overview]
Message-ID: <26FD6E71366F4E208A511D708D1C3E5D@us.oracle.com> (raw)
In-Reply-To: <32945125.post@talk.nabble.com>
> (defun mfun (&optional regexp-p no-recursive-edit)
> (interactive "P\n")
\n serves no purpose here.
And you don't use arg NO-RECURSIVE-EDIT.
> (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?
1. I already gave you another idea, off list. What was wrong with it?
Put "[[:word:].,2]+" in a register or variable, and insert it after `M-e' during
isearch.
Or define a command to insert it after `M-e':
(defun foo () (interactive) (insert "[[:word:].,2]+"))
(define-key minibuffer-local-isearch-map (kbd "M-q") 'foo)
C-M-s M-e M-q C-s
2. FYI - A better mailing list for this kind of topic (a question about how to
use Emacs or Emacs Lisp) is help-gnu-emacs@gnu.org.
HTH.
next prev parent reply other threads:[~2011-12-10 16:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-06 19:03 A search function that skip some characters Martin Usbach
2011-12-06 19:33 ` Tekk
2011-12-06 21:11 ` Stefan Monnier
2011-12-09 20:29 ` martin-u
2011-12-10 16:20 ` Drew Adams [this message]
2011-12-11 14:47 ` martin-u
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26FD6E71366F4E208A511D708D1C3E5D@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=Emacs-devel@gnu.org \
--cc=auto51@hushmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.