I wish to create a function to put in my .emacs
(but I am no Elisp expert) in order to perform a certain number of replacements within an Emacs buffer. In particular, I want to:
replace any occurrence of
\pnotes{*}
(where*
is some variable stuff, e.g.\pnotes{1.73}
,\pnotes{1.41}
...) with\notes
followed by a line breakdelete any occurrence of
\ast{*}
(where*
is some variable stuff, e.g.\ast{0.03}
,\ast{.70}
...)replace any occurrence of
\nextvoice
with the same string preceded by a line breakreplace any occurrence of
\ib
with the same string preceded by a line break;replace any occurrence of
|
with the same character preceded by a line breakreplace any occurrence of
&
with the same character preceded by a line breakreplace any occurrence of
\en%
with\en
preceded by a line break
How can I achieve that?
[replace]
. And see the Elisp manual, node Search and Replace.^X(
, then type the emacs commands to do what you want, then^X)
andESC X edit-last-kbd-macro
to see the recorded elisp.