A little complement to make @YoungFrog answer a bit more practical.
Clearly at the end of the lines there might be some random white spaces you not even notice. Not clearing them means replaced text is randomly like that:
ic_m_sales _inactive
ic_m_activity_report _inactive
ic_m_messanges _inactive
ic_m_products_name _inactive
ic_m_change_store _inactive
ic_m_faq _inactive
...
Clearing the spaces is even more boring than adding the suffixes.
However, you can select the region to suffix and use the command C-M-%
or M-x query-replace-regexp
, then just type:
SPACE*$ENTER_inactive
Now you are replacing the spaces before the newlines, if any.
If the regexp above is inconvenient to type/remember, just define once and for all the function:
(defun region-suffix (r1 r2)
(interactive "r")
(perform-replace " *$"
(read-string "Enter suffix:")
nil 'regexp nil nil nil r1 r2 nil nil))
Now, when you select the region to suffix and type M-x region-suffix
, you are prompted to enter the suffix and you are done.
If that is a common operation for you, bind the region-suffix
function to some spare keys, e.g:
(global-set-key (kbd "C-x p") 'region-suffix)