unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: rustom <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: some vi equivalents please?
Date: Wed, 5 Nov 2008 23:08:47 -0800 (PST)	[thread overview]
Message-ID: <9b816dd4-7769-45cc-8edb-00a075e9049a@v13g2000pro.googlegroups.com> (raw)
In-Reply-To: 4912ee0b@news.greennet.net

On Nov 5, 6:41 pm, Ken Goldman <kg...@watson.ibm.com> wrote:
> rustom wrote:
> > 1. In vi I can delete a line that contains a <pat> with :g/<pat>/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/<pat>/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.


  reply	other threads:[~2008-11-06  7:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 15:08 some vi equivalents please? rustom
2008-10-31 15:01 ` Toby Cubitt
2008-11-01 13:32   ` Kevin Rodgers
2008-11-01 18:47     ` Reiner Steib
2008-10-31 15:53 ` Teemu Likonen
2008-10-31 15:59 ` Drew Adams
2008-10-31 16:01 ` Parker, Matthew
2008-10-31 16:53 ` Giorgos Keramidas
2008-10-31 17:22   ` Joost Kremers
2008-10-31 17:34     ` Giorgos Keramidas
2008-10-31 22:49       ` Xah
     [not found] ` <mailman.2577.1225468814.25473.help-gnu-emacs@gnu.org>
2008-11-01 14:45   ` rustom
2008-11-01 14:52     ` rustom
2008-11-01 16:40       ` Giorgos Keramidas
2008-11-01 17:07     ` Drew Adams
     [not found]     ` <mailman.2646.1225559243.25473.help-gnu-emacs@gnu.org>
2008-11-02 15:30       ` rustom
2008-11-02 16:12         ` Drew Adams
     [not found]         ` <mailman.2710.1225642363.25473.help-gnu-emacs@gnu.org>
2008-11-03  7:19           ` rustom
2008-11-03  9:10             ` Drew Adams
2008-11-03 16:24             ` Giorgos Keramidas
2008-11-05 13:41 ` Ken Goldman
2008-11-06  7:08   ` rustom [this message]
2008-11-06 16:50     ` Drew Adams
2008-11-07 17:12       ` Johan Bockgård
2008-11-07 17:38         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b816dd4-7769-45cc-8edb-00a075e9049a@v13g2000pro.googlegroups.com \
    --to=rustompmody@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).