* gnus-util.el (gnus-string<): New function.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 15 Oct 2007 09:37:45 +0000 (09:37 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 15 Oct 2007 09:37:45 +0000 (09:37 +0000)
* gnus-sum.el (gnus-article-sort-by-author, gnus-article-sort-by-recipient)
 (gnus-article-sort-by-subject): Use it.

lisp/ChangeLog
lisp/gnus-sum.el
lisp/gnus-util.el

index 9ef9efb..e525ee2 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-util.el (gnus-string<): New function.
+
+       * gnus-sum.el (gnus-article-sort-by-author)
+       (gnus-article-sort-by-recipient, gnus-article-sort-by-subject): Use it.
+
 2007-10-15  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-win.el (gnus-configure-windows): Focus on the frame for which
index 094141f..cd95db0 100644 (file)
@@ -4821,7 +4821,7 @@ using some other form will lead to serious barfage."
 
 (defsubst gnus-article-sort-by-author (h1 h2)
   "Sort articles by root author."
-  (string-lessp
+  (gnus-string<
    (let ((extract (funcall
                   gnus-extract-address-components
                   (mail-header-from h1))))
@@ -4838,7 +4838,7 @@ using some other form will lead to serious barfage."
 
 (defsubst gnus-article-sort-by-recipient (h1 h2)
   "Sort articles by recipient."
-  (string-lessp
+  (gnus-string<
    (let ((extract (funcall
                   gnus-extract-address-components
                   (or (cdr (assq 'To (mail-header-extra h1))) ""))))
@@ -4855,7 +4855,7 @@ using some other form will lead to serious barfage."
 
 (defsubst gnus-article-sort-by-subject (h1 h2)
   "Sort articles by root subject."
-  (string-lessp
+  (gnus-string<
    (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
    (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
 
index 3d59e93..80c36e2 100644 (file)
@@ -254,6 +254,16 @@ is slower."
   (not (or (string< s1 s2)
           (string= s1 s2))))
 
+(defun gnus-string< (s1 s2)
+  "Return t if first arg string is less than second in lexicographic order.
+Case is significant if and only if `case-fold-search' is nil.
+Symbols are also allowed; their print names are used instead."
+  (if (symbolp s1) (setq s1 (symbol-name s1)))
+  (if (symbolp s2) (setq s2 (symbol-name s2)))
+  (if case-fold-search
+      (string-lessp (downcase s1) (downcase s2))
+    (string-lessp s1 s2)))
+
 ;;; Time functions.
 
 (defun gnus-file-newer-than (file date)