Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4138e600
Commit
4138e600
authored
Jan 03, 1994
by
Richard M. Stallman
Browse files
(sort-float-fields): Commented out.
parent
885020c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
lisp/sort.el
lisp/sort.el
+21
-22
No files found.
lisp/sort.el
View file @
4138e600
...
...
@@ -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.
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.
If you want to sort floating-point numbers, try `sort-float-fields'."
FIELD, BEG and END. BEG and END specify region to sort."
(
interactive
"p\nr"
)
(
sort-fields-1
field
beg
end
(
function
(
lambda
()
...
...
@@ -264,26 +263,26 @@ If you want to sort floating-point numbers, try `sort-float-fields'."
(
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
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
program, there are three arguments: FIELD, BEG and END. BEG and END specify
region to sort."
(
interactive
"p\nr"
)
(
sort-fields-1
field
beg
end
(
function
(
lambda
()
(
sort-skip-fields
field
)
(
string-to-number
(
buffer-substring
(
point
)
(
save-excursion
(
re-search-forward
"[+-]?[0-9]*\.?[0-9]*\\([eE][+-]?[0-9]+\\)?"
)
(
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
;;
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
;;
program, there are three arguments: FIELD, BEG and END. BEG and END specify
;;
region to sort."
;;
(interactive "p\nr")
;;
(sort-fields-1 field beg end
;;
(function (lambda ()
;;
(sort-skip-fields field)
;;
(string-to-number
;;
(buffer-substring
;;
(point)
;;
(save-excursion
;;
(re-search-forward
;;
"[+-]?[0-9]*\.?[0-9]*\\([eE][+-]?[0-9]+\\)?")
;;
(point))))))
;;
nil))
;;;###autoload
(
defun
sort-fields
(
field
beg
end
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment