Commits

Anonymous committed 4c00160

Sync with normal package tree. ie Ben's recent changes.
I slightly modified the change to XEmacs.rules to reflect the new
directory structure.

Comments (0)

Files changed (3)

+2001-05-11  Ben Wing  <ben@xemacs.org>
+
+	* compile.el (compilation-find-file): warning fix.
+	
+	* sort.el:
+	* sort.el (sort-regexp-history): New.
+	* sort.el (sort-regexp-fields):
+	* sort.el (sort-regexp-fields-numerically):
+	* sort.el (sort-columns-subprocess): snarf the region before asking questions.
+
 2001-04-23  Ben Wing  <ben@xemacs.org>
 
 	* compile.el (compilation-shell-minor-mode):
     (let* ((dirs compilation-search-path)
 	   (true-file-name (file-name-nondirectory filename))
 	   (buffer (get-buffer true-file-name)) 
-	   fi thisdir fmts name)
+	   thisdir fmts name)
       (flet ((push-file-name-history (name)
 	       (setq file-name-history
 		     (if minibuffer-history-uniquify
 	   t)
 	 (goto-char (match-beginning 0)))))
 
+;; History used for sort regexps.
+(defvar sort-regexp-history nil)
+
 ;;;###autoload
 (defun sort-regexp-fields (reverse record-regexp key-regexp beg end
 				   &optional comparefun)
   ;; using negative prefix arg to mean "reverse" is now inconsistent with
   ;; other sort-.*fields functions but then again this was before, since it
   ;; didn't use the magnitude of the arg to specify anything.
-  (interactive "P\nsRegexp specifying records to sort: 
-sRegexp specifying key within record: \nr")
+  (interactive
+   ;; retrieve the region first, since pasting into the minibuffer will
+   ;; deactivate it. (YUCK! should have per-buffer regions.)
+   (let ((beg (region-beginning))
+	 (end (region-end)))
+     (list current-prefix-arg
+	   (read-string "Regexp specifying records to sort: "
+			nil 'sort-regexp-history)
+	   (read-string "Regexp specifying key within record: "
+			nil 'sort-regexp-history)
+	   beg end)))
   (cond ((or (equal key-regexp "") (equal key-regexp "\\&"))
 	 (setq key-regexp 0))
 	((string-match "\\`\\\\[1-9]\\'" key-regexp)
   ;; using negative prefix arg to mean "reverse" is now inconsistent with
   ;; other sort-.*fields functions but then again this was before, since it
   ;; didn't use the magnitude of the arg to specify anything.
-  (interactive "P\nsRegexp specifying records to sort: 
-sRegexp specifying key within record: \nr")
+  (interactive
+   ;; retrieve the region first, since pasting into the minibuffer will
+   ;; deactivate it. (YUCK! should have per-buffer regions.)
+   (let ((beg (region-beginning))
+	 (end (region-end)))
+     (list current-prefix-arg
+	   (read-string "Regexp specifying records to sort: "
+			nil 'sort-regexp-history)
+	   (read-string "Regexp specifying key within record: "
+			nil 'sort-regexp-history)
+	   beg end)))
   (sort-regexp-fields reverse record-regexp key-regexp beg end
 		      #'(lambda (a b)
-			  (dp a)
-			  (dp b)
 			  (< (string-to-number a) (string-to-number b)))))