unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: SK Kim <tttuuu888@gmail.com>, 31800@debbugs.gnu.org
Subject: bug#31800: suggestion of improvement for sort-numeric-fields function.
Date: Fri, 24 Jan 2020 16:30:10 +0100	[thread overview]
Message-ID: <87y2tweut9.fsf@gnus.org> (raw)
In-Reply-To: <87zheefcrf.fsf@marxist.se> (Stefan Kangas's message of "Thu, 23 Jan 2020 15:50:12 +0100")

Stefan Kangas <stefan@marxist.se> writes:

> Lars Ingebrigtsen <larsi@gnus.org> 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





  reply	other threads:[~2020-01-24 15:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 16:09 bug#31800: suggestion of improvement for sort-numeric-fields function SK Kim
2019-07-13  3:41 ` Lars Ingebrigtsen
2019-07-13  8:21   ` SK Kim
2020-01-20 19:55     ` Stefan Kangas
2020-01-22 13:44       ` Lars Ingebrigtsen
2020-01-23 14:50         ` Stefan Kangas
2020-01-24 15:30           ` Lars Ingebrigtsen [this message]
2022-02-03 19:34 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2tweut9.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=31800@debbugs.gnu.org \
    --cc=stefan@marxist.se \
    --cc=tttuuu888@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).