changeset 33555:a77843a1f4e4

(sort-columns): If sort-fold-case it non-nil, invoke sort(1) with the `-f' argument.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 16 Nov 2000 16:43:52 +0000
parents 8cc4c4ff3f88
children d3d9942c7619
files lisp/sort.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/sort.el	Thu Nov 16 16:42:10 2000 +0000
+++ b/lisp/sort.el	Thu Nov 16 16:43:52 2000 +0000
@@ -493,18 +493,20 @@
 	  ;; 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.
-	  (call-process-region beg1 end1 "sort" t t nil
-			       (if reverse "-rt\n" "-t\n")
-			       (concat "+0." col-start)
-			       (concat "-0." col-end))
+	  (let ((sort-args (list (if reverse "-rt\n" "-t\n")
+				 (concat "+0." col-start)
+				 (concat "-0." col-end))))
+	    (when sort-fold-case
+	      (push "-f" sort-args))
+	    (apply #'call-process-region beg1 end1 "sort" t t nil sort-args))
 	;; On VMS, use Emacs's own facilities.
 	(save-excursion
 	  (save-restriction
 	    (narrow-to-region beg1 end1)
 	    (goto-char beg1)
 	    (sort-subr reverse 'forward-line 'end-of-line
-		       (function (lambda () (move-to-column col-start) nil))
-		       (function (lambda () (move-to-column col-end) nil)))))))))
+		       #'(lambda () (move-to-column col-start) nil)
+		       #'(lambda () (move-to-column col-end) nil))))))))
 
 ;;;###autoload
 (defun reverse-region (beg end)