unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: uzibalqa via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Apply replacement on word occurring at point using a lisp function
Date: Fri, 12 Aug 2022 19:48:20 +0000	[thread overview]
Message-ID: <fWc23eVrpYY9bu_sWs2GFOdmbpdYBopRL91g6-DPAAk5vdK9x3nzWdf6K4D_jJEJRYk6-4DTCXMG8dTQx8u2En86ioddag4y7QAvia9E_DA=@proton.me> (raw)

I want to insert the letter `k' for words with initial `cog', `col', `com', `con', `cor', `coun', `cum'."

For this I have written

(replace-regexp "\\<\\(co[glmnr]\\|coun\\|cum\\)" "k")

What I want to do is apply the replacement on the word occurring at point using a lisp function. How can this be achieved?

             reply	other threads:[~2022-08-12 19:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 19:48 uzibalqa via Users list for the GNU Emacs text editor [this message]
2022-08-12 20:24 ` Apply replacement on word occurring at point using a lisp function Jean Louis
2022-08-12 20:28   ` uzibalqa
2022-08-12 20:37     ` Jean Louis
2022-08-12 20:59       ` uzibalqa
2022-08-13 10:24         ` Jean Louis
2022-08-13 14:17           ` uzibalqa

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='fWc23eVrpYY9bu_sWs2GFOdmbpdYBopRL91g6-DPAAk5vdK9x3nzWdf6K4D_jJEJRYk6-4DTCXMG8dTQx8u2En86ioddag4y7QAvia9E_DA=@proton.me' \
    --to=help-gnu-emacs@gnu.org \
    --cc=uzibalqa@proton.me \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).