From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rustom Newsgroups: gmane.emacs.help Subject: Re: some vi equivalents please? Date: Wed, 5 Nov 2008 23:08:47 -0800 (PST) Organization: http://groups.google.com Message-ID: <9b816dd4-7769-45cc-8edb-00a075e9049a@v13g2000pro.googlegroups.com> References: <4912ee0b@news.greennet.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225957245 18586 80.91.229.12 (6 Nov 2008 07:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2008 07:40:45 +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 Nov 06 08:41:48 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 1KxzUy-0005zf-1R for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Nov 2008 08:41:48 +0100 Original-Received: from localhost ([127.0.0.1]:50304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxzTq-0000SR-Um for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Nov 2008 02:40:38 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v13g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: 220.225.70.2 Original-X-Trace: posting.google.com 1225955327 31967 127.0.0.1 (6 Nov 2008 07:08:47 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 6 Nov 2008 07:08:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v13g2000pro.googlegroups.com; posting-host=220.225.70.2; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui User-Agent: G2/1.0 X-HTTP-Via: 1.1 PT-PROXY1, 1.1 PT-PROXY2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164164 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:59497 Archived-At: On Nov 5, 6:41 pm, Ken Goldman wrote: > rustom wrote: > > 1. In vi I can delete a line that contains a with :g//d > > Others have posted the best way do do this. However, rather than > searching for infrequently used commands, I typically just define a > keyboard macro and replay it. > > In this case, the macro would be: > > - search for the pattern > - go to the beginning of the line > - kill the line Well... I have some technical and some non-technical responses to this. Technical 1. Your macro is not equivalent to the vi :g//d unless it is embedded into a loop. The loop could be programmatic or interactive (keep doing Cx e) Technical 2. Overall it turns out faster (without the infrequently used flush- lines) to Save-buffer in emacs Finish off the 1 liner in vi revert-buffer in emacs Non-technical 1 I work in an environment where I am the old-timer using the strange old clunky emacs. I have a hell of a time convincing my half-my-age coworkers to use emacs. Confirming the clunkyness (because I dont know a command) does not help my cause :-) Non-technical 2 Funnily enough, this requirement came up in a large scale edit that required adding a single line to 200 classes in 37 files. I did this (for these coworkers) by writing 3 elisp functions that implemented an iterator that sequentially went through the 200 classes. Producing the file:lineNo list of those 200 cases was where the original request (for deleting lines) came up. So, no, Im not averse to writing emacs macros or elisp code; just like to use the right tool for the job.