From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#13521: `sort-lines' on the empty region Date: Thu, 20 Aug 2020 18:18:34 -0700 Message-ID: References: <20130122085354.75ced82538551655e724e0ea@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000000ccced05ad5904dc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Xue Fuqiao , Glenn Morris , 13521@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 21 03:19:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8vi1-00044o-Pb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Aug 2020 03:19:09 +0200 Original-Received: from localhost ([::1]:47314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8vi0-00082D-Pi for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Aug 2020 21:19:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8vhu-00081z-Rw for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 21:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8vhu-0000TG-Id for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 21:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8vhu-0003zF-CS for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 21:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Aug 2020 01:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13521 X-GNU-PR-Package: emacs Original-Received: via spool by 13521-submit@debbugs.gnu.org id=B13521.159797272315292 (code B ref 13521); Fri, 21 Aug 2020 01:19:02 +0000 Original-Received: (at 13521) by debbugs.gnu.org; 21 Aug 2020 01:18:43 +0000 Original-Received: from localhost ([127.0.0.1]:44540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8vha-0003ya-KO for submit@debbugs.gnu.org; Thu, 20 Aug 2020 21:18:42 -0400 Original-Received: from mail-yb1-f171.google.com ([209.85.219.171]:39961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8vhY-0003yG-Kk for 13521@debbugs.gnu.org; Thu, 20 Aug 2020 21:18:41 -0400 Original-Received: by mail-yb1-f171.google.com with SMTP id q3so185171ybp.7 for <13521@debbugs.gnu.org>; Thu, 20 Aug 2020 18:18:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=5EOwuC7sYu39+6R6db3PJkN0PYLf3zc368mti4Iona4=; b=QziKd1+sS0GFWF87FhpT1an5oveFwSwVDwecW46404Q3LubrLwNz5BpjL24vZe6kBu udjjw1azwwWosdBk6vAEDu65hEokF/u8c7yzovsBkBQ8/DlxIun4/57ZESK3Utnu6tXg cojjPwucznF21/TrEnDsm7hJj1O9g8e5vD36+qpyLT+Zk8PJjnz2KkjTwtkQUeoJ8Ocm 9OJmpMnU11lsMdc2CSYnbTFodonG58aJ2cIl6ARkKmgwZVQtcg4sWbQsa/jjpFebubf4 5WadkeaCyGvl5e0lOhnZQkW9A4OUrXXUFJD14ZEmJXr82AOEr3DMC2eRYNKuda4hBWZE l4LQ== X-Gm-Message-State: AOAM532rgnDd4yobLOAIlU2v/qSWl6gL80GmvfKJH9/MelXrIJrJV8o+ vpeKCnI3VDoaDVeeoY5hNl4/UtooWf8zwRslRds= X-Google-Smtp-Source: ABdhPJxjDhATSvBEPiPT6Mn5mrxfq3t+5VqmPhqOWVdJWxJWFSBXiS2zRy27U8Fnzs7c6AnZDJRhsn9BLHj4lD3dK1I= X-Received: by 2002:a25:9843:: with SMTP id k3mr690040ybo.466.1597972715186; Thu, 20 Aug 2020 18:18:35 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 20 Aug 2020 18:18:34 -0700 In-Reply-To: (Stefan Monnier's message of "Tue, 22 Jan 2013 14:04:02 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185803 Archived-At: --0000000000000ccced05ad5904dc Content-Type: text/plain; charset="UTF-8" tags 13521 + patch thanks Stefan Monnier writes: >>> That seems to be considering a different case: not the case of an empty >>> region, but the case where there's no active region. >>> Currently, this case signals an error, but I think I agree it makes >>> sense to let it apply to the whole buffer if there is no active region. >> flush-lines, keep-lines instead operate on all lines after point. > > Yes, we have an inconsistency in this respect: some commands use "the > whole buffer" and others use "everything after point". Whichever choice > we make for sort-lines, it will be inconsistent with some of the > existing commands ;-) > > I personally prefer the "whole buffer", but whoever makes the change > gets to make the choice. The attached patch makes 'sort-lines' sort the entire buffer when there is no region. Any comments? Best regards, Stefan Kangas --0000000000000ccced05ad5904dc Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Make-sort-lines-sort-entire-buffer-without-active-re.patch" Content-Disposition: attachment; filename="0001-Make-sort-lines-sort-entire-buffer-without-active-re.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 1b40315dcff26846_0.1 RnJvbSA2YzFkNmViMWRjODMwNmY5OWZkMDFiYTg0ODIxMzYzMmFjNmNkOTczIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5rYW5nYXNAZ21haWwuY29t PgpEYXRlOiBGcmksIDIxIEF1ZyAyMDIwIDAzOjA2OjE2ICswMjAwClN1YmplY3Q6IFtQQVRDSF0g TWFrZSAnc29ydC1saW5lcycgc29ydCBlbnRpcmUgYnVmZmVyIHdpdGhvdXQgYWN0aXZlIHJlZ2lv bgoKKiBsaXNwL3NvcnQuZWwgKHNvcnQtbGluZXMpOiBTb3J0IGVudGlyZSBidWZmZXIgaWYgdGhl cmUgaXMgbm8gYWN0aXZlCnJlZ2lvbi4gIERvYyBmaXguICAoQnVnIzEzNTIxKQoqIHRlc3QvbGlz cC9zb3J0LXRlc3RzLmVsIChzb3J0LXRlc3RzLS1saW5lcy9lbnRpcmUtYnVmZmVyKTogTmV3IHRl c3QuCiogZXRjL05FV1M6IEFubm91bmNlIHRoZSBhYm92ZSBjaGFuZ2UuCi0tLQogZXRjL05FV1Mg ICAgICAgICAgICAgICAgfCAgMyArKysKIGxpc3Avc29ydC5lbCAgICAgICAgICAgIHwgMTIgKysr KysrKysrKystCiB0ZXN0L2xpc3Avc29ydC10ZXN0cy5lbCB8ICA2ICsrKysrKwogM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