From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Custom searches, like interactively searching palindromes Date: Fri, 01 Oct 2010 15:36:46 +0200 Message-ID: <4CA5E3EE.5080002@easy-emacs.de> References: <7042.89429.qm@web36206.mail.mud.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1285940808 7854 80.91.229.12 (1 Oct 2010 13:46:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Oct 2010 13:46:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 01 15:46:46 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P1fwj-0000zn-Hj for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Oct 2010 15:46:45 +0200 Original-Received: from localhost ([127.0.0.1]:41219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1fwi-0007XK-JH for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Oct 2010 09:46:44 -0400 Original-Received: from [140.186.70.92] (port=45960 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1foX-00049D-Ox for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 09:38:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P1fnZ-0006nP-Ji for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 09:37:46 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:62737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P1fnZ-0006mc-7x for help-gnu-emacs@gnu.org; Fri, 01 Oct 2010 09:37:17 -0400 Original-Received: from noname.home (brln-4dbc4297.pool.mediaWays.net [77.188.66.151]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MF8Xf-1Ozk8H40cd-00Fk9G; Fri, 01 Oct 2010 15:37:15 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 In-Reply-To: <7042.89429.qm@web36206.mail.mud.yahoo.com> X-Provags-ID: V02:K0:bsXYDw/yitjyLnozwP8No6ylsLN8UfgYLSvu1ST3WlJ ItwRSaJcrsIHVxdC47ad3ftDvOgiATUM2GUBzzvX4IjpgeJ71W uaoOgFHnOQ9Y8mTjG7PDcuw8J0X5U2CjbeM/3YCh8dGJuNM99U LS1LlhvEyturdp5y4HQmcTnL0MObAkDR0rG60aLUMK/Z898vhP M7ygG/kULhoCoOE4zDeR8oVWokm1QuLOB8rpnZDUb4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75055 Archived-At: Am 01.10.2010 11:50, schrieb Karan Bathla: > > Hi > > I would like to know how one can interactively search for patterns that are not captured by regexes, like palindromes. > > One approach would be to use \, to embed a lisp function, like it's availabe in regex-replace. Is it easy to modify existing functions (or make new ones using the ones available) to do this? > With Emacs Lisp knowledge you can do this at a reasonable effort. It's just for tasks like this, Emacs is the most perfect general tool IMHO. The knowledge given, you may do the basics within minutes. Finishing it will be some kind of tricky, as written language commonly is not so regular. It depends how reliable your results must be, which language, the kind of texts etc. > Or maybe something like (check-for-pattern palindrome), where palindrome is a function that takes a string and returns true if that string is palindrome. The function check-for-pattern does the search interactively feeding new string in the buffer to palindrome and highlighting them if they match. The problem I am facing here is writing the check-for-pattern function using the existing search functions. Should you encounter that kind of tasks repeatedly, read the Emacs Lisp Doku, resp. the Intro first, if you are not a programmer. Maybe some person here on this list don't know what to do some evening and writes it for you... Good luck Andreas -- https://code.launchpad.net/~a-roehler/python-mode/python-mode-components https://code.launchpad.net/s-x-emacs-werkstatt/ > > Any other ways to do it ? > > Thanks > Karan > > > > >