Commit a4b13e10 authored by Jim Blandy's avatar Jim Blandy

* sort.el (sort-float-fields, sort-numeric-fields): Use

	string-to-number, not string-to-float or string-to-int.

	* sort.el (sort-float-fields): Make this autoloaded.

	* sort.el (sort-numeric-fields): Doc fix.
parent 6da3b16b
......@@ -239,12 +239,13 @@ Fields are separated by whitespace and numbered from 1 up.
Specified field must contain a number in each line of the region.
With a negative arg, sorts by the ARGth field counted from the right.
Called from a program, there are three arguments:
FIELD, BEG and END. BEG and END specify region to sort."
FIELD, BEG and END. BEG and END specify region to sort.
If you want to sort floating-point numbers, try `sort-float-fields'."
(interactive "p\nr")
(sort-fields-1 field beg end
(function (lambda ()
(sort-skip-fields (1- field))
(string-to-int
(string-to-number
(buffer-substring
(point)
(save-excursion
......@@ -254,6 +255,7 @@ FIELD, BEG and END. BEG and END specify region to sort."
(point))))))
nil))
;;;###autoload
(defun sort-float-fields (field beg end)
"Sort lines in region numerically by the ARGth field of each line.
Fields are separated by whitespace and numbered from 1 up. Specified field
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment