From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: A search function that skip some characters Date: Sat, 10 Dec 2011 08:20:43 -0800 Message-ID: <26FD6E71366F4E208A511D708D1C3E5D@us.oracle.com> References: <32945125.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1323534068 16338 80.91.229.12 (10 Dec 2011 16:21:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Dec 2011 16:21:08 +0000 (UTC) To: "'martin-u'" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 10 17:21:04 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RZPfb-0003qA-5s for ged-emacs-devel@m.gmane.org; Sat, 10 Dec 2011 17:21:04 +0100 Original-Received: from localhost ([::1]:51515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZPfa-0008OI-Ay for ged-emacs-devel@m.gmane.org; Sat, 10 Dec 2011 11:21:02 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZPfX-0008O7-FR for Emacs-devel@gnu.org; Sat, 10 Dec 2011 11:21:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZPfV-0007Ch-Qw for Emacs-devel@gnu.org; Sat, 10 Dec 2011 11:20:59 -0500 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:31317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZPfV-0007Cd-Kn for Emacs-devel@gnu.org; Sat, 10 Dec 2011 11:20:57 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBAGKtRJ000450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 10 Dec 2011 16:20:56 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pBAGKs0B029283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Dec 2011 16:20:55 GMT Original-Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pBAGKmWo000684; Sat, 10 Dec 2011 10:20:48 -0600 Original-Received: from dradamslap1 (/10.159.45.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 10 Dec 2011 08:20:48 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <32945125.post@talk.nabble.com> Thread-Index: Acy3Ddc2BgV+jTSuRkGnjl0WE/pfbQAR52fg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090209.4EE386E8.00B7,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146618 Archived-At: > (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.