Bug 182282 - coreutils "sort" command now incompatible with "sort-columns" function in sort.el
coreutils "sort" command now incompatible with "sort-columns" function in sor...
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jens Petersen
Depends On:
  Show dependency treegraph
Reported: 2006-02-21 11:40 EST by Richard Ryniker
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 21.4-14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-27 22:59:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Richard Ryniker 2006-02-21 11:40:26 EST
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

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 08:45:49 EST
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.