From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: some vi equivalents please? Date: Mon, 3 Nov 2008 01:10:28 -0800 Message-ID: <00a201c93d94$040b18a0$0200a8c0@us.oracle.com> References: <987e361b-2efc-421b-8b36-4dcc67f1971e@z6g2000pre.googlegroups.com><2f5cb1cc-c6ae-4f69-9589-d91ee639b042@i18g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225703636 18399 80.91.229.12 (3 Nov 2008 09:13:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2008 09:13:56 +0000 (UTC) To: "'rustom'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 03 10:14:58 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 1KwvWT-0006tH-9m for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 10:14:57 +0100 Original-Received: from localhost ([127.0.0.1]:39533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwvVM-0000Fm-78 for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 04:13:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwvUz-0000Fh-Ei for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 04:13:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwvUw-0000FV-Lz for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 04:13:24 -0500 Original-Received: from [199.232.76.173] (port=44865 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwvUw-0000FI-Ik for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 04:13:22 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:5037) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KwvUw-0006P7-LF for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 04:13:22 -0500 Original-Received: from rcsinet13.oracle.com ([148.87.113.125] helo=rgminet13.oracle.com) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KwvUv-0000ec-Jf for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 04:13:21 -0500 Original-Received: from rgminet15.oracle.com (mail-router.oracle.com [148.87.113.117]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id mA39DOXM016419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Nov 2008 09:13:26 GMT Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id mA39DG94013722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2008 09:13:17 GMT Original-Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id mA39A1aN002392; Mon, 3 Nov 2008 02:10:02 -0700 Original-Received: from dradamslap1 (/24.23.165.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 03 Nov 2008 09:10:01 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: Ack9h5n6WsNNemZWQWuNH+PDV5uqPgABblSw X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Source-IP: rgmgw2.us.oracle.com [138.1.186.111] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A09020B.490EC0AA.02FA:SCFSTAT928724,ss=1,fgs=0 X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:59372 Archived-At: > Well Ok. Ive added somethings there and corrected some omissions. Great. You can see from the activity on the page that it sparked some interest and has no doubt helped others already. > 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. Not sure what you're asking here (and why here?). I didn't add `sort-lines' to your table. Someone else did, presumably trying to help fill in the table. I don't use vi, so I can't say whether it is appropriate or adequate. But you are free to correct any info that someone enters - on pretty much any wiki page. Go for it. You might want to mention piping with UNIX `sort'. You might want to link to the Emacs manual, node Sorting (which see, BTW - there is lots more than `sort-lines'). The choice is yours. The wiki is yours. > Also Xah mentioned that flush-lines is obsolete compared to delete- > matching-lines. Nonsense. `flush-lines' is in fact the defun name. It is `delete-matching-lines' that is an alias for `flush-lines'. But neither is obsolete. You don't need to refer to Xah or Drew or anyone else for this. Just do `C-h f' for each of `flush-lines' and `delete-matching-lines', and see what is said about them. Or check the Emacs manual (it is only `flush-lines' that is documented there, BTW, but both are listed in the Index). But the doc strings and manual are not infallible. The source code (linked from the `C-h f' display) and doc together are the best authority about what is. But even what is is not necessarily what should be. Emacs is open - to you. Often things are ultimately a matter of opinion and persuasion (and customization). And Emacs evolves (and that evolution is not always linear or progressive). But starting with the doc is always a good idea. > Since Im hearing of both for the first time I'll leave > it to others to decide which is the recommended name. They are two names for the same command. Neither is the recommended name, AFAIK. Use whichever you like. And even if one or the other were recommended, use whichever you like. ;-) > Frankly flush makes me think of fflush in C (or something less > mentionable) FWIW, if you enter the command name interactively, via `M-x', it is quicker to use `flush-lines' than `delete-matching-lines'. `M-x flu TAB', five keystrokes, suffices. Eight keystrokes are needed for `M-x dele TAB m TAB'. Personally, I suspect that's one reason many people use `flush-lines'. Another reason might be that "flush" has long been used in connection with purging things like buffers. (Another reason might be that some people like to mention unmentionables such as "flush" and "purge".) On the other hand, `delete-(non-)matching-lines' has the advantage of being easy to remember and perhaps more accessible to `apropos' because it uses `match'. Take your pick. There is no right or wrong answer here. That's the only right answer. ;-)