all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to do search and replace with a lookup
@ 2017-12-11  8:49 Angus Comber
  2017-12-11 10:03 ` tomas
  0 siblings, 1 reply; 2+ messages in thread
From: Angus Comber @ 2017-12-11  8:49 UTC (permalink / raw)
  To: help-gnu-emacs

I have log file output like this:

Received device state message: pen state = 11 - uig state 10

where pen state and uig state are enums.

I want to do a search and replace where if for example pen state 11 enum is diagnostics and uig state 10 enum is starting, then I want the line to be updated to:

Received device state message: pen state = diagnostics - uig state starting

What is the easiest way to do this?

I can do search and replace using c-m-% and change for each permutation of number to string but that would be fairly labour intensive if enums were fairly long.  Can I combine that with a lookup somehow?  What is best way to do it?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-11 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-11  8:49 How to do search and replace with a lookup Angus Comber
2017-12-11 10:03 ` tomas

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.