From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: How to replace string for a block? Date: Wed, 27 May 2009 21:03:53 -0400 Organization: A noiseless patient Spider Message-ID: References: <1243369356.13000.19.camel@qi.unbc.ca> <7cmy8y6i13.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1243474919 5310 80.91.229.12 (28 May 2009 01:41:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 May 2009 01:41:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 28 03:41:57 2009 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 1M9Ud1-0000IG-Ia for geh-help-gnu-emacs@m.gmane.org; Thu, 28 May 2009 03:41:55 +0200 Original-Received: from localhost ([127.0.0.1]:47719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9Ud0-0008Vq-Sd for geh-help-gnu-emacs@m.gmane.org; Wed, 27 May 2009 21:41:54 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!weretis.net!feeder2.news.weretis.net!feeder.motzarella.org!news.motzarella.org!news.eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 67 Original-X-Trace: news.eternal-september.org U2FsdGVkX1++L8kQp2KHpbWYXjySFIyh8bs2IgV0mbJmaufp68u7juZvPHcCsBHU1cAabaoG3bx6V3SCLfKi5MI0NtHrQyr4I2y1vxrlcYVK3uuTWmb6/eSD6MjmIuDECs/ySrzzMbZDH/hGN6E5RQ== Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Thu, 28 May 2009 01:03:53 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/DB3uzDyM/7sP5psPLxVbX+wcuSvlBMZw= Cancel-Lock: sha1:tc3fS42E2NMMK5nABY18U2/dB2I= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:169554 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:64786 Archived-At: In article , Vagn Johansen wrote: > Barry Margolin writes: > > > In article , > > Alan Mackenzie wrote: > > > >> > There's no need to narrow the buffer: just set the mark and the point > >> > and M-x replace-{string,regexp} won't go beyond, as documented. Well, > >> > you've activated transient-mark-mode, of course. Who would disable it? > >> > >> I would. Actually, I have. transient-mark-mode is an ill thought out > >> conflation of several logically unrelated features, some of which have > >> names which can only have been thought up when their namers were smoking > >> something soothing, complicated to use, and utterly at variance with > >> Emacs's ethos of elegant simplicity and keeping out of the user's way. > >> > >> Some people seem to like it, though. ;-) > > > > I've been an Emacs user for almost 30 years. For at least half that > > time transient-mark-mode didn't even exist, and after it was added (for > > the benefit of converts from PC word processors, I believe) I resisted > > enabling it for a long time, it seemed like sacrilege. But I finally > > gave in a couple of years ago when I started using Emacs in GUI mode > > heavily at work, and I'm happy I did. > > Why? What did you gain? > > I immediately disabled it when was introduced. Mostly due to a > (possibly unfounded) fear of having to press C-g all the time to > disable the mark. It mostly goes away by itself. > > > I particularly like when commands automatically operate on either > > the buffer or region depending on whether it's enabled. I installed > > shell-command.el, which makes shell-command-on-region do this > > automagically. > > shell-command-on-region is a part Emacs (simple.el). The > shell-command.el I know of augments this with completion features. I installed shell-command.el to get the completion features. But it also adds the feature that shell-command-on-region automatically operates on the buffer if the region is not active, so you don't have to do C-x h first. > But anyway, you don't even need transient-mark-mode enabled to do > this. > > Calling set-mark twice (C-SPC C-SPC) enables transient-mark > temporarily (~ transient-transient-mark-mode :-) ). I use it all the > time with M-; (comment-dwim) I just learned about this and C-u C-x C-x recently. But the thing I like about having transient-mark-mode enabled globally is NOT having to type something extra when I want to operate on the region. The act of setting the mark and then moving point usually activates the region, so all I then have to do is execute the command that uses it. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***