[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: some vi equivalents please?

From: Giorgos Keramidas
Subject: Re: some vi equivalents please?
Date: Mon, 03 Nov 2008 18:24:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Sun, 2 Nov 2008 23:19:00 -0800 (PST), rustom <address@hidden> wrote:
> On Nov 2, 9:12 pm, "Drew Adams" <address@hidden> wrote:
> But there is one thing which is more appropriate here (I think) When I
> put n!!sort to sort the next n lines I was putting that merely as an
> example of a 2-way pipe.  ie a command that takes its input from a
> bunch of vi lines and whose output goes in as a replacement.
> Of course its good to know about sort-lines but that is hardly
> general.  One could want sort|uniq or sort|uniq|pr with all kinds of
> unixy command-line args peppered in -- a unix-shell programmer never
> ceases to find new pipelines that he never had imagined before.

A more general way would be to `mark a region' and then filter the
region through a shell command with `M-! command' or `C-u M-! command'.

I have modified `ViEmacsTable' on the wiki, to include info about these
two, and a pointer to `ExecuteExternalCommand'.

> Also Xah mentioned that flush-lines is obsolete compared to
> delete-matching-lines.  Since I'm hearing of both for the first time
> I'll leave it to others to decide which is the recommended name.
> Frankly flush makes me think of fflush in C (or something less
> mentionable)

IMO, Xah is right that `delete-matching-lines' is a more mnemonic name.

The equivalence table seems to be:

    delete-matching-lines       => flush-lines
    delete-non-matching-lines   => keep-lines

We don't have a `keep-matching-lines' too, but it would probably make
sense to add it as an alias of `keep-lines' :)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]