all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Custom searches, like interactively searching palindromes
Date: Fri, 01 Oct 2010 15:36:46 +0200	[thread overview]
Message-ID: <4CA5E3EE.5080002@easy-emacs.de> (raw)
In-Reply-To: <7042.89429.qm@web36206.mail.mud.yahoo.com>

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
>
>
>
>
>




  reply	other threads:[~2010-10-01 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01  9:50 Custom searches, like interactively searching palindromes Karan Bathla
2010-10-01 13:36 ` Andreas Röhler [this message]
     [not found] <mailman.1.1285926611.30610.help-gnu-emacs@gnu.org>
2010-10-01 13:58 ` Andreas Politz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CA5E3EE.5080002@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.