On 2002.02.04, in <[EMAIL PROTECTED]>,
        "Charles Jie" <[EMAIL PROTECTED]> wrote:
>    - If you code something to achieve it, you lose the COLORs.

But losing the colors is a *good thing*. :) color_ls hurts my eyes.
Ouch.


> *3. Mutt's file browser - also mix up directories and files, which hurts
>    eyes.
>    - We also want an option to IGNORE the cases of file/folder names in
>      sorting.
> 
> -> any patch can help?

Here's a simple patch that makes the browser's string collation sort
according to the user's locale. (It just defines a mutt_strcoll() and
makes the browser's string collator use it instead of strcmp().)

This will probably do what you want, and it's probably the right thing
for mutt to do here, IMO.

Patch is against mut 1.3.27 but probably applies nicely on many
versions, since it affects relatively stable code.

-- 
 -D.    [EMAIL PROTECTED]        NSIT    University of Chicago
 Colons and slashes and dots, oh my!
diff -Pur mutt-1.3.27-base/browser.c mutt-1.3.27/browser.c
--- mutt-1.3.27-base/browser.c  Tue Dec 18 09:12:48 2001
+++ mutt-1.3.27/browser.c       Mon Feb  4 11:49:24 2002
@@ -75,7 +75,7 @@
   struct folder_file *pa = (struct folder_file *) a;
   struct folder_file *pb = (struct folder_file *) b;
 
-  int r = mutt_strcmp (pa->name, pb->name);
+  int r = mutt_strcoll (pa->name, pb->name);
 
   return ((BrowserSort & SORT_REVERSE) ? -r : r);
 }
diff -Pur mutt-1.3.27-base/lib.c mutt-1.3.27/lib.c
--- mutt-1.3.27-base/lib.c      Mon Feb 12 04:30:08 2001
+++ mutt-1.3.27/lib.c   Mon Feb  4 11:49:24 2002
@@ -584,6 +584,11 @@
   return a ? strlen (a) : 0;
 }
 
+int mutt_strcoll(const char *a, const char *b)
+{
+  return strcoll(NONULL(a), NONULL(b));
+}
+
 const char *mutt_stristr (const char *haystack, const char *needle)
 {
   const char *p, *q;
diff -Pur mutt-1.3.27-base/lib.h mutt-1.3.27/lib.h
--- mutt-1.3.27-base/lib.h      Thu Jun  7 15:00:05 2001
+++ mutt-1.3.27/lib.h   Mon Feb  4 11:49:24 2002
@@ -107,6 +107,7 @@
 int mutt_strcmp (const char *, const char *);
 int mutt_strncasecmp (const char *, const char *, size_t);
 int mutt_strncmp (const char *, const char *, size_t);
+int mutt_strcoll (const char *, const char *);
 int safe_open (const char *, int);
 int safe_symlink (const char *, const char *);
 int safe_rename (const char *, const char *);

Reply via email to