Bug 182282 - coreutils "sort" command now incompatible with "sort-columns" function in sort.el
Summary: coreutils "sort" command now incompatible with "sort-columns" function in sor...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: rawhide
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jens Petersen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-02-21 16:40 UTC by Richard Ryniker
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 21.4-14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-28 03:59:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Richard Ryniker 2006-02-21 16:40:26 UTC
Description of problem:

The "sort" command from coreutils (coreutils-5.93-7) no longer accepts
the "+...-+ form of key definition.  This change was made to comply
with the POSIX specification for "sort".

The emacs "sort-columns" command in sort.el fails when it uses this
form of key definition.  The proper fix is upstream (I've posted to
bug-gnu-emacs) but make this report for users of Fedora Core.

This problem exists in the current (1.52) version of emacs from
savannah.gnu.org.

Version-Release number of selected component (if applicable):
emacs-common-21.4-11 emacs-el-21.4-11


Additional info:  fix for sort.el

[ryniker@r400 ~]$ diff -u /usr/share/emacs/21.4/lisp/sort.el sort.el
--- /usr/share/emacs/21.4/lisp/sort.el	2001-07-15 12:15:34.000000000 -0400
+++ sort.el	2006-02-20 00:21:17.000000000 -0500
@@ -493,9 +493,13 @@
 	  ;; Use the sort utility if we can; it is 4 times as fast.
 	  ;; Do not use it if there are any properties in the region,
 	  ;; since the sort utility would lose the properties.
+	  ;; POSIX does not allow older sort programs' zero-origin,
+	  ;;  "+...-" key specification; use one-origin "-k" argument instead.
 	  (let ((sort-args (list (if reverse "-rt\n" "-t\n")
-				 (concat "+0." (int-to-string col-start))
-				 (concat "-0." (int-to-string col-end)))))
+				 (concat "-k 1."
+					 (int-to-string (1+ col-start))
+					 ",1."
+					 (int-to-string (1+ col-end)) ) )))
 	    (when sort-fold-case
 	      (push "-f" sort-args))
 	    (apply #'call-process-region beg1 end1 "sort" t t nil sort-args))
[ryniker@r400 ~]$

Comment 1 Jens Petersen 2006-02-27 13:45:49 UTC
Thanks.  Fix should be in 21.4-13.


Note You need to log in before you can comment on or make changes to this bug.