From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: SK Kim Newsgroups: gmane.emacs.bugs Subject: bug#31800: suggestion of improvement for sort-numeric-fields function. Date: Sat, 13 Jul 2019 17:21:18 +0900 Message-ID: References: <874l3qy517.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000c17468058d8bb640" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="136332"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 31800@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 13 10:22:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmDIF-000ZDp-Rl for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 10:22:08 +0200 Original-Received: from localhost ([::1]:54152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmDIE-0007a2-PR for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 04:22:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35207) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmDIB-0007Zi-PK for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 04:22:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmDIA-0006NL-Hf for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 04:22:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmDIA-0006NA-9v for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 04:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmDIA-0005SW-2s for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 04:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: SK Kim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2019 08:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31800 X-GNU-PR-Package: emacs Original-Received: via spool by 31800-submit@debbugs.gnu.org id=B31800.156300609820951 (code B ref 31800); Sat, 13 Jul 2019 08:22:02 +0000 Original-Received: (at 31800) by debbugs.gnu.org; 13 Jul 2019 08:21:38 +0000 Original-Received: from localhost ([127.0.0.1]:41420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmDHl-0005Rr-S0 for submit@debbugs.gnu.org; Sat, 13 Jul 2019 04:21:38 -0400 Original-Received: from mail-oi1-f179.google.com ([209.85.167.179]:34929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmDHj-0005Re-EH for 31800@debbugs.gnu.org; Sat, 13 Jul 2019 04:21:36 -0400 Original-Received: by mail-oi1-f179.google.com with SMTP id a127so9081235oii.2 for <31800@debbugs.gnu.org>; Sat, 13 Jul 2019 01:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I7bMtquuTrrU8gTF6+dzmt5j962chEalzUVA0eayEoc=; b=V5xM/NFWAnSRyGk+2wrW3zUrQK5fLmt4VoQVo3VQFwY5Rzhbs/Czq08YPlhf4vjSgl H0Cude4GHcdSlDZGgUnKW7RXgUBjsv/swIE8pnKfWYiTlcw/y7Cj85GCCSUfVXLNL1NN wsTV1e32pEYlAmbs+Ddtovf2c+z3MxbEjz7/8bODk97kVDkG5JjS6TaMXmxHJnb6d5Hm PcA0E/IA/5X07Qyr4Tgw4itV7vfsW1xcetMXsXbK27NFZ6edAsILX8HnnmbG/MdK8WZ9 wpG9ISnYORkXyeqNvZxT/oUsBU7D7q/aAtyE1J6SB46tj7ENlkssFuuNH2w7MCpc9U/D sIDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I7bMtquuTrrU8gTF6+dzmt5j962chEalzUVA0eayEoc=; b=SRg7OlsuZwtUGe2YS4ND5UT69xsHyyCk3lSJPNDbdNNhk+2PLBTxnA1NNt+w2wY4+f iDJf6CvcDxRZkyMfN/yV4I3553w39Os8I9fNIJ/jDfrGdk5fE7GMKSzvSn8iie0BDpij xHyE0HwaaHuSvJb9lTiSnexpY7NdAD6qfLCjqEdfHVx91x9vkUXGHqzYY4XE6LyZfQbk oU0kaTucqIuux9fgUCJXeKQh9N07vRDP9tVYcc2f2P9HIiQb57ydu/LOXxUWWtRYKhHM 5lXI9z1DgKOUBqzNIxygzsHjcv75JJexhYhp7oBy/d/ZBnTMJk8lnSeUPSmJmlOXifMg eakA== X-Gm-Message-State: APjAAAUC8R3O3hrR3DfL/D7KhrwFskrN5vJ0wYM3+ZZQj0cAirNyo0Eo oWuPK6GJdlzCJGEyQIShjA6Zas/UGL/Crsmqys4= X-Google-Smtp-Source: APXvYqzNqVT0F2tMWCNkJau4ZZOdgfsmxIaCCzLZzQwWgS51qs0CM0+shtfHecTvdMcwkKrgl/9TSasYURJwLSC5PQY= X-Received: by 2002:aca:be88:: with SMTP id o130mr8026910oif.122.1563006089645; Sat, 13 Jul 2019 01:21:29 -0700 (PDT) In-Reply-To: <874l3qy517.fsf@mouse.gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162856 Archived-At: --000000000000c17468058d8bb640 Content-Type: multipart/alternative; boundary="000000000000c17462058d8bb63e" --000000000000c17462058d8bb63e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I made this patch from github emacs-mirror repository. I hope this will be of help. Thanks. 2019=EB=85=84 7=EC=9B=94 13=EC=9D=BC (=ED=86=A0) =EC=98=A4=ED=9B=84 12:42, = Lars Ingebrigtsen =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > SK Kim writes: > > > This is not likely a bug but sort-numeric-fields function does not > > allow region with blank lines, while sort-lines does. > > > > This was because sort-skip-fields occurs error with blank line. And > > when I added condition for sort-skip-fields like below, > > sort-numeric-fields was working with blank lines too. > > > > (when (not (string-match-p "^\\s-*$" > (thing-at-point 'line))) > > (sort-skip-fields field)) > > > > So, I just hope sort-numeric-fields would work for region with blank > > lines too. > > Can you create a patch for this fix? > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --000000000000c17462058d8bb63e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I made this patch from github emacs-mirror repository.
I hope= this will be of help.

Thanks.

2019=EB=85=84 7=EC=9B=94 13= =EC=9D=BC (=ED=86=A0) =EC=98=A4=ED=9B=84 12:42, Lars Ingebrigtsen <larsi@gnus.org>=EB=8B=98=EC=9D=B4 =EC= =9E=91=EC=84=B1:
SK Kim <tttuuu= 888@gmail.com> writes:

> This is not likely a bug but sort-numeric-fields function does not
> allow region with blank lines, while sort-lines does.
>
> This was because sort-skip-fields occurs error with blank line. And > when I added condition for sort-skip-fields like below,
> sort-numeric-fields was working with blank lines too.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (when (not (string-match-p "^\\s-*$" (thing-at-point '= line)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (sort-skip-fields field))
>
> So, I just hope sort-numeric-fields would work for region with blank > lines too.

Can you create a patch for this fix?

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000c17462058d8bb63e-- --000000000000c17468058d8bb640 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Improve-sort-numeric-fields.patch" Content-Disposition: attachment; filename="0001-Improve-sort-numeric-fields.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jy198c340 RnJvbSBkMDhjNWQzNjgzMzdlZTQ5YmI3MmQ5OTE1YzQwOWVkY2JjNzNiNGUwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTZXVuZ0tpIEtpbSA8dHR0dXV1ODg4QGdtYWlsLmNvbT4KRGF0 ZTogU2F0LCAxMyBKdWwgMjAxOSAxNzoxMjo0NiArMDkwMApTdWJqZWN0OiBbUEFUQ0hdIEltcHJv dmUgYHNvcnQtbnVtZXJpYy1maWVsZHMnCgoqIGxpc3Avc29ydC5lbCAoc29ydC1udW1lcmljLWZp ZWxkcykgOiBBbGxvdyBpbmNsdWRpbmcgZW1wdHkgbGluZXMuCi0tLQogbGlzcC9zb3J0LmVsIHwg MyArKy0KIDEgZmlsZSBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKCmRp ZmYgLS1naXQgYS9saXNw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