all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Deniz Dogan <deniz.a.m.dogan@gmail.com>
To: "Paulo J. Matos" <pocmatos@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Does word under cursor match pattern?
Date: Mon, 23 Aug 2010 14:37:46 +0200	[thread overview]
Message-ID: <AANLkTik8zK7AMihpMhKV1Ri4yqkRfnLReq-FEEfa_et_@mail.gmail.com> (raw)
In-Reply-To: <yayhbilefvu.fsf@alma.europe.root.pri>

2010/8/23 Paulo J. Matos <pocmatos@gmail.com>:
> Hi,
>
> I am trying to know if a word under the cursor matched a pattern
> ([Bb]-?[0-9]+). My idea was:
> - Select region with word under cursor
> - Transform region into string
> - Apply regexp on string
>
> This has one problem: I can't seem to find a function to transform a
> region into a string. On the other hand maybe I can work with the region
> directly.
>
> Any tips on how to do this?
>

You can use e.g. (thing-at-point 'word). This would return the string
with properties and such, if you want that.

-- 
Deniz Dogan



  parent reply	other threads:[~2010-08-23 12:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 11:18 Does word under cursor match pattern? Paulo J. Matos
2010-08-23 11:56 ` Lennart Borgman
2010-08-23 12:43   ` Paulo J. Matos
2010-08-23 12:37 ` Deniz Dogan [this message]
     [not found] <mailman.6.1282562668.29657.help-gnu-emacs@gnu.org>
2010-08-23 11:58 ` Marc Mientki

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=AANLkTik8zK7AMihpMhKV1Ri4yqkRfnLReq-FEEfa_et_@mail.gmail.com \
    --to=deniz.a.m.dogan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pocmatos@gmail.com \
    /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.