From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Shift regions. Date: Wed, 22 Oct 2008 00:53:46 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4d3dedd0-05a3-4614-b469-8e990a9f1a03@y71g2000hsa.googlegroups.com> References: <1224651514.962693@nntp.acecape.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224664973 11804 80.91.229.12 (22 Oct 2008 08:42:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2008 08:42:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 22 10:43:52 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KsZJn-0000XV-TD for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Oct 2008 10:43:52 +0200 Original-Received: from localhost ([127.0.0.1]:51476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsZIi-0000NA-Dx for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Oct 2008 04:42:44 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!y71g2000hsa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1224662026 373 127.0.0.1 (22 Oct 2008 07:53:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 22 Oct 2008 07:53:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y71g2000hsa.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163682 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:59023 Archived-At: On Oct 21, 9:58 pm, Wei Weng wrote: > Hi All. > > How do I shift a highlighted/marked region a tab to right/left? perhaps the following is what u mean? Q: How to add a prefix to every line? (such as # or //) Mark (Ctrl+Space) the beginning of first line and move cursor to the beginning of the last line, then do =E2=80=9CAlt+x string-rectangle=E2=80= =9D (Ctrl+x r t), then type what you want to insert. This command can be used to insert a string across mulitple lines not just at their beginning position, but any position in a block of lines. Alternatively, you can select a region and do =E2=80=9CAlt+;=E2=80=9D to ma= ke the region into a comment or uncomment block specific to your language's mode. Q: How to delete the first few n chars of every line? Mark (Ctrl+Space) the beginning of first line and move cursor to the last line, and move it to the right n chars. Then do =E2=80=9CAlt+x kill- rectangle=E2=80=9D (Ctrl+x r k). This command can be used to delete any rectangular block of text, not just at the beginning of lines. There's also indent-region and indent-rigidly. I have some emacs tutorial on my website you might be interested. Xah =E2=88=91 http://xahlee.org/ =E2=98=84