Commit 4138e600 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(sort-float-fields): Commented out.

parent 885020c5
...@@ -248,8 +248,7 @@ Fields are separated by whitespace and numbered from 1 up. ...@@ -248,8 +248,7 @@ Fields are separated by whitespace and numbered from 1 up.
Specified field must contain a number in each line of the region. 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. With a negative arg, sorts by the ARGth field counted from the right.
Called from a program, there are three arguments: 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") (interactive "p\nr")
(sort-fields-1 field beg end (sort-fields-1 field beg end
(function (lambda () (function (lambda ()
...@@ -264,26 +263,26 @@ If you want to sort floating-point numbers, try `sort-float-fields'." ...@@ -264,26 +263,26 @@ If you want to sort floating-point numbers, try `sort-float-fields'."
(point)))))) (point))))))
nil)) nil))
;;;###autoload ;;;;;###autoload
(defun sort-float-fields (field beg end) ;;(defun sort-float-fields (field beg end)
"Sort lines in region numerically by the ARGth field of each line. ;; "Sort lines in region numerically by the ARGth field of each line.
Fields are separated by whitespace and numbered from 1 up. Specified field ;;Fields are separated by whitespace and numbered from 1 up. Specified field
must contain a floating point number in each line of the region. With a ;;must contain a floating point number in each line of the region. With a
negative arg, sorts by the ARGth field counted from the right. Called from 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 ;;program, there are three arguments: FIELD, BEG and END. BEG and END specify
region to sort." ;;region to sort."
(interactive "p\nr") ;; (interactive "p\nr")
(sort-fields-1 field beg end ;; (sort-fields-1 field beg end
(function (lambda () ;; (function (lambda ()
(sort-skip-fields field) ;; (sort-skip-fields field)
(string-to-number ;; (string-to-number
(buffer-substring ;; (buffer-substring
(point) ;; (point)
(save-excursion ;; (save-excursion
(re-search-forward ;; (re-search-forward
"[+-]?[0-9]*\.?[0-9]*\\([eE][+-]?[0-9]+\\)?") ;; "[+-]?[0-9]*\.?[0-9]*\\([eE][+-]?[0-9]+\\)?")
(point)))))) ;; (point))))))
nil)) ;; nil))
;;;###autoload ;;;###autoload
(defun sort-fields (field beg end) (defun sort-fields (field beg end)
......
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