From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin-u Newsgroups: gmane.emacs.devel Subject: RE: A search function that skip some characters Date: Sun, 11 Dec 2011 06:47:52 -0800 (PST) Message-ID: <32955446.post@talk.nabble.com> References: <32945125.post@talk.nabble.com> <26FD6E71366F4E208A511D708D1C3E5D@us.oracle.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 1323620903 765 80.91.229.12 (11 Dec 2011 16:28:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2011 16:28:23 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 17:28:19 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 1RZmGA-0006Nq-FT for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2011 17:28:18 +0100 Original-Received: from localhost ([::1]:36357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZmG9-0007wl-LJ for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2011 11:28:17 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZkh1-0003M4-7a for Emacs-devel@gnu.org; Sun, 11 Dec 2011 09:47:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZkh0-00016A-0I for Emacs-devel@gnu.org; Sun, 11 Dec 2011 09:47:55 -0500 Original-Received: from sam.nabble.com ([216.139.236.26]:35529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZkgz-000166-Sw for Emacs-devel@gnu.org; Sun, 11 Dec 2011 09:47:53 -0500 Original-Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RZkgy-0003Qy-Lo for Emacs-devel@gnu.org; Sun, 11 Dec 2011 06:47:52 -0800 In-Reply-To: <26FD6E71366F4E208A511D708D1C3E5D@us.oracle.com> 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: Sun, 11 Dec 2011 11:28:16 -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:146649 Archived-At: > 1. I already gave you another idea, off list. What was wrong with it? This was my answer: Hello, "w[.,X]*o[.,X]*r[.,X]d" was just an example. It could be any other "text". Everytime I give a text like "abc" or "xyz" (as argument for the function) the special search function should search "a[.,X]*b[.,X]*c[.,X]*" or "x[.,X]*y[.,X]*z[.,X]*". But anyway, I have found a solution in your answer. This was my help: > (defun foo () (interactive) (insert "[[:word:].,2]+")) > (define-key minibuffer-local-isearch-map (kbd "M-q") 'foo) Here's the function (defun my-search () (interactive) (move-beginning-line 1) (kill-line) (setq g (car kill-ring)) (insert (mapconcat (lambda (c) (regexp-quote (string c))) g "[.,2]*"))) and here's the keybinding: (define-key minibuffer-local-isearch-map (kbd "M-q") 'my-search) After C-M-S M-e I write the text I'm searching "text" and then I type M-q. I get what I want "t[,.2]*e[,.2]*x[,.2]*t". -- View this message in context: http://old.nabble.com/A-search-function-that-skip-some-characters-tp32926746p32955446.html Sent from the Emacs - Dev mailing list archive at Nabble.com.