From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tony-au Newsgroups: gmane.emacs.devel Subject: Search function that ignores some characters Date: Fri, 9 Dec 2011 11:09:22 -0800 (PST) Message-ID: <32944985.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 1323458369 13693 80.91.229.12 (9 Dec 2011 19:19:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Dec 2011 19:19:29 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 09 20:19:23 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 1RZ5yb-0001U8-Vt for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2011 20:19:22 +0100 Original-Received: from localhost ([::1]:56643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ5yb-0005lT-Dl for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2011 14:19:21 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ5p4-0004VY-RX for Emacs-devel@gnu.org; Fri, 09 Dec 2011 14:09:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZ5p3-0008Hd-Eh for Emacs-devel@gnu.org; Fri, 09 Dec 2011 14:09:30 -0500 Original-Received: from sam.nabble.com ([216.139.236.26]:42930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZ5p3-000858-Aj for Emacs-devel@gnu.org; Fri, 09 Dec 2011 14:09:29 -0500 Original-Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RZ5ow-0005df-LH for Emacs-devel@gnu.org; Fri, 09 Dec 2011 11:09:22 -0800 X-Nabble-From: auto51@hushmail.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 216.139.236.26 X-Mailman-Approved-At: Fri, 09 Dec 2011 14:19:20 -0500 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:146608 Archived-At: Hello, I would like to implement a search function that ignores some characters (like these characters { '.', ',' , 'X'}). So if I search "word", the function should not only find "word" but also "wor.d", "wo,rd.", "w,,o..X,r..d", and so on. That means I want to search w[.,X]*o[.,X]*r[.,X]d as a regexp. The function my-regexp produces the regexp and insert it into the buffer (defun my-regexp (&optional regexp-p no-recursive-edit) (interactive "P\n") (setq str (read-from-minibuffer "the word: ")) (insert-before-markers (mapconcat (lambda (c) (regexp-quote (string c))) str "[.,X]*")) ) But then I have to kill the produced regexp from the buffer and insert it into the minibuffer of "C-M-s" (Regexp I-search). This is not really comfortable. How can directly insert the regexp (in the example: w[.,X]*o[.,X]*r[.,X]d) into the minibuffer of (Regexp I-search)? -- View this message in context: http://old.nabble.com/Search-function-that-ignores-some-characters-tp32944985p32944985.html Sent from the Emacs - Dev mailing list archive at Nabble.com.