[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Custom searches, like interactively searching palindromes
From: |
Andreas Röhler |
Subject: |
Re: Custom searches, like interactively searching palindromes |
Date: |
Fri, 01 Oct 2010 15:36:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 |
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