help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I enter query-replace in GNU Emacs using a repeatable function


From: Tim Visher
Subject: How can I enter query-replace in GNU Emacs using a repeatable function based on values in the line currently at point. - Super User
Date: Mon, 21 Jun 2010 10:35:14 -0400

Hi Everyone,

I'd like to take the following data and query-replace occurences of
each word identifier with the corresponding numeric identifier using
some sort of repeatable function.

    -1 ACT/CNS
    -2 AG NFC
    -3 AID
    -4 BBG
    -5 BIA
    -6 BLM
    -7 BOC
    -8 BPD
    -9 CCC
    -10 CDC
    -11 Census

In other words, with point at

    -1 ACT/CNS
    ^

I'd like to be able to hit a key and launch into the following command

    query-replace RET ACT/CNS RET -1 RET

I tried defining a keyboard macro but there seems to be enough jumping
between buffers and M-x calls to confuse the kbmacro and make it
unusable.

Thoughts?

Write up also here:

http://superuser.com/questions/155017/how-can-i-enter-query-replace-in-gnu-emacs-using-a-repeatable-function-based-on-v



reply via email to

[Prev in Thread] Current Thread [Next in Thread]