From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: keep|flush-lines, how-many to be used backward. Date: Sun, 30 Sep 2007 01:48:44 +0300 Organization: JURTA Message-ID: <87lkapm9sr.fsf@jurta.org> References: <87d4w8ujux.fsf@cadilhac.name> <871wcmjx8s.fsf@cadilhac.name> <871wcmxy4j.fsf@jurta.org> <87sl52ihmj.fsf@cadilhac.name> <871wcmquw6.fsf@jurta.org> <87lkardtk8.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191106387 3141 80.91.229.12 (29 Sep 2007 22:53:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2007 22:53:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 30 00:53:03 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IblBG-0008BY-52 for ged-emacs-devel@m.gmane.org; Sun, 30 Sep 2007 00:53:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IblBC-00017f-5F for ged-emacs-devel@m.gmane.org; Sat, 29 Sep 2007 18:52:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ibl9L-0007no-Qf for emacs-devel@gnu.org; Sat, 29 Sep 2007 18:51:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ibl9K-0007mT-Lm for emacs-devel@gnu.org; Sat, 29 Sep 2007 18:51:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ibl9K-0007mE-Db for emacs-devel@gnu.org; Sat, 29 Sep 2007 18:51:02 -0400 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ibl9J-0005dO-QX for emacs-devel@gnu.org; Sat, 29 Sep 2007 18:51:02 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1Ibl9H-0009br-FB; Sun, 30 Sep 2007 01:51:00 +0300 In-Reply-To: <87lkardtk8.fsf@cadilhac.name> (=?iso-8859-1?Q?=22Micha=EBl?= Cadilhac"'s message of "Fri\, 28 Sep 2007 11\:32\:07 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Scanner-Signature: 5e2df25549de819b25d1bfd51e9f52eb X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1523 [September 28 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 25 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-Detected-Kernel: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80032 Archived-At: > What I fail to agree with, is that a prefix argument can be a > three-state boolean: present, negative or positive. I think it's just > a hack, and should not be used like that. A user that sees that C-u and > C-- has different behavior will try to figure out what C-9 will do, but > it'd be nonsense. Don't you agree? I think until the meaning of the positive numeric argument is implemented, it should do nothing special, i.e. do not change the default behavior. >> Using C-u now to change the direction will prevent these commands from >> extending to do more useful things in future. > > If I continue in your way, I think you are suggesting that we don't use > the prefix value 2 in M-x search because it can be used for future > features. It's a little bit extreme, but wanting to differentiate = 0, < 0 > and > 0 will eventually lead to this. If you mean the prefix value 2 of a search command, it makes sense to use it as a number N to find the N-th occurrence of the search string starting from the current position. > To sum up, I think the prefix argument has only two use cases: > - As a boolean (present/absent), > - As a number. > > Wanting to mix those two is, to me, a hack. The last case can be subdivided into a positive, negative number and zero. M-0 often is a special case (like e.g. in `M-0 w' in dired to copy the absolute file name). For keep-lines, flush-lines M-0 could be interpreted as operating on the whole buffer. I miss this functionality very much. I always want for these commands to operate on the whole buffer no matter where point is located before calling these commands, but I need every time to put point to the beginning of the buffer. With a special argument to operate on the whole buffer these commands will be easier to use. >> Please also note that usually the command should have parameters it reads >> in its function arguments. So it's better to change > >> (defun keep-lines (regexp &optional rstart rend interactive direction) > > Well, this is another matter. I want to do the following with those > three functions: > - Remove the `interactive' flag (it's silly), > - Remove the `optional'. > > That way, `direction' is not needed, as the caller should provide rstart > and rend (like in nearly all the functions that take a region -- as a > first count, 90%). The direction is just an interactive help. It's a good idea to remove the `interactive' flag. If Richard will agree to your change, please replace it. -- Juri Linkov http://www.jurta.org/emacs/