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

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

RE: replace-string for 1 line


From: Drew Adams
Subject: RE: replace-string for 1 line
Date: Thu, 17 Aug 2006 09:35:25 -0700

    Say I want to carry out a replace command, but just for 1 line
    and not the rest of the docuemnt, is there a way to do that?

If you use transient-mark-mode (I recommend it), then just select the line,
then do the replacement. Many other commands and functions also operate on
the region, if it is active.

If you don't use transient-mark-mode, then narrow to that line: Select the
line, then `C-x n n'. Then do your replacement - only the region is visible,
so only the region is affected. Use `C-x n w' to widen, afterward. To do
this in Emacs Lisp, use `narrow-to-region' and `widen'.






reply via email to

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