GNU bug report logs - #21785
25.0.50; sort-fields fails if region ends in a newline and sort-paragraph fails if it doesn't

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Thu, 29 Oct 2015 12:39:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 25.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> mouse.gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; sort-fields fails if region ends in a newline and
 sort-paragraph fails if it doesn't
Date: Thu, 29 Oct 2015 12:38:26 +0000
I noticed this while writing tests for sort.el

With the following buffer contents (the text between the dashes,
including a final newline), issue `C-x h M-x sort-numeric-fields'.
You'll get the error that the last line doesn't have enough fields. I
think that error should not be thrown because of a final newline.

---------------------
1 hi
2 bye

----------------------

Meanwhile take the following buffer contents,
--------------------
paragraph 2

paragraph 1
--------------------

If you issue `sort-paragraphs' on the whole buffer, you'll get this:
--------------------
paragraph 1
paragraph 2

-------------------

In my opinion both behavior are bugs. But surely one of them is, as
the functions should be somewhat consistent on demanding final
newlines.




This bug report was last modified 5 years and 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.