From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#31800: suggestion of improvement for sort-numeric-fields function. Date: Fri, 24 Jan 2020 16:30:10 +0100 Message-ID: <87y2tweut9.fsf@gnus.org> References: <874l3qy517.fsf@mouse.gnus.org> <87v9p5rjhj.fsf@marxist.se> <87v9p3vc57.fsf@gnus.org> <87zheefcrf.fsf@marxist.se> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="39964"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: SK Kim , 31800@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 24 16:31:24 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 1iv0vb-000ALz-Rt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jan 2020 16:31:23 +0100 Original-Received: from localhost ([::1]:43676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv0vb-0005Wh-0i for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jan 2020 10:31:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54021) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv0vH-0005Up-3H for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 10:31:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv0vF-0005WF-W5 for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 10:31:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48658) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iv0vF-0005W6-Rx for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 10:31:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iv0vF-000548-Ll for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 10:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jan 2020 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31800 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31800-submit@debbugs.gnu.org id=B31800.157987982117364 (code B ref 31800); Fri, 24 Jan 2020 15:31:01 +0000 Original-Received: (at 31800) by debbugs.gnu.org; 24 Jan 2020 15:30:21 +0000 Original-Received: from localhost ([127.0.0.1]:54631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv0ub-0004Vf-Ay for submit@debbugs.gnu.org; Fri, 24 Jan 2020 10:30:21 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:40146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv0ua-0004Q9-1f for 31800@debbugs.gnu.org; Fri, 24 Jan 2020 10:30:20 -0500 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iv0uR-0007tf-IS; Fri, 24 Jan 2020 16:30:14 +0100 In-Reply-To: <87zheefcrf.fsf@marxist.se> (Stefan Kangas's message of "Thu, 23 Jan 2020 15:50:12 +0100") 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175227 Archived-At: Stefan Kangas writes: > Lars Ingebrigtsen writes: > >>>> - (sort-skip-fields field) >>>> + (unless (string-match-p "^\\s-*$" (thing-at-point 'line)) >>>> + (sort-skip-fields field)) >> >> I don't think this patch makes sense as is -- I think that's a >> convoluted way of saying `looking-at'? But it makes conceptual sense, I >> think. > > I'm not sure. Do you mean to use: > > (looking-at "\\s*$") > > Are we sure point is at the beginning of line here though? The above > code doesn't require that, but also seems to be wrong if region is in > the middle of a line. But I'm not sure how people typically use this > in that case. I assumed that (thing-at-point 'line) returns the current line, but I haven't actually looked at the code, but you're right -- we don't know where point is, so that has to be moved before checking. In any case, using thing-at-point is not the right thing. > BTW, shouldn't we also fix the same bug in sort-fields while we're at > it? Yes. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no