From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: replace-string for 1 line Date: Thu, 17 Aug 2006 09:35:25 -0700 Message-ID: References: <5853003.post@talk.nabble.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1155832578 942 80.91.229.2 (17 Aug 2006 16:36:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 Aug 2006 16:36:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 17 18:36:15 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GDkqW-0006wW-JN for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Aug 2006 18:35:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GDkqW-0005UN-17 for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Aug 2006 12:35:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GDkqH-0005Sn-Ue for help-gnu-emacs@gnu.org; Thu, 17 Aug 2006 12:35:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GDkqE-0005Ru-AK for Help-gnu-emacs@gnu.org; Thu, 17 Aug 2006 12:35:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GDkqE-0005Rr-6t for Help-gnu-emacs@gnu.org; Thu, 17 Aug 2006 12:35:34 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1GDkwk-0006OT-FH for Help-gnu-emacs@gnu.org; Thu, 17 Aug 2006 12:42:18 -0400 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k7HGZVVV023859 for ; Thu, 17 Aug 2006 10:35:32 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmgw1.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k7HGZUVv026311 for ; Thu, 17 Aug 2006 10:35:31 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <5853003.post@talk.nabble.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:36733 Archived-At: 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'.