Re: Wish about mutt's file browser

2002-02-06 Thread David T-G

John, et al --

...and then John Buttery said...
% 
...
%   Anyway, without getting into a technical discussion about locale
% settings and GNU ls...if you want ls to sort stuff the old way, put
% this into your shell startup file:

How about, still without getting into a technical discussion, a pointer to
where to learn about how to play with LC_COLLATE to make ls do different
things?  I'm interested in how to have directories at the top, just for
fun, and how to ignore case in particular.


% 
...
% patch someone suggested a few posts back in the message
% [EMAIL PROTECTED], that should make mutt
% collate the same way.

I haven't read up on this, in case this is the only way to put dirs
together at the top.  I'd love it if it weren't.


TIA  HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg24220/pgp0.pgp
Description: PGP signature


Re: Wish about mutt's file browser

2002-02-06 Thread John Buttery

On Wed, Feb 06, 2002 at 06:58:10AM -0500, David T-G wrote:
John, et al --

...and then John Buttery said...
% 
...
%   Anyway, without getting into a technical discussion about locale
% settings and GNU ls...if you want ls to sort stuff the old way, put
% this into your shell startup file:

How about, still without getting into a technical discussion, a pointer to
where to learn about how to play with LC_COLLATE to make ls do different
things?  I'm interested in how to have directories at the top, just for
fun, and how to ignore case in particular.

  There is WAY more information than any sane person would ever want
to see about locale environment variables (which makes it the perfect
fit for this group *grin*) at this URL:

http://www.opengroup.org/onlinepubs/7908799/xbd/locale.html

  You'll probably want to scroll down to the section on LC_COLLATE; all
the LC_* environment variables are examined in painstaking detail there.

-- 

 John Buttery

   You know, when I was in the Boy Scouts they told us the
 best way to get warm was to get naked, and get in a
sleeping bag with someone else who was already naked.

  Well, maybe you'll get lucky and
 it'll start raining sleeping bags.

   X-Files

 (Web page temporarily unavailable)

uncolor body/header/subliminalmessage



Re: Wish about mutt's file browser

2002-02-06 Thread David T-G

John --

...and then John Buttery said...
% 
% On Wed, Feb 06, 2002 at 06:58:10AM -0500, David T-G wrote:
% 
...
% where to learn about how to play with LC_COLLATE to make ls do different
...
% 
%   There is WAY more information than any sane person would ever want
% to see about locale environment variables (which makes it the perfect
% fit for this group *grin*) at this URL:

*grin* indeed.


% 
% http://www.opengroup.org/onlinepubs/7908799/xbd/locale.html

Cool; thanks!


% 
%   You'll probably want to scroll down to the section on LC_COLLATE; all
% the LC_* environment variables are examined in painstaking detail there.

Oh, goodie :-)


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg24227/pgp0.pgp
Description: PGP signature


Re: [OT] Re: Wish about mutt's file browser

2002-02-05 Thread Charles Jie

Hi, Justin,

I wish I could find any diagnostic tool for my KDE of Mandrake 8.1. It
does have some problems, like the damn small and vague fonts. It hangs
w/o apparent reason from time to time. You use XKill to kill a window on
strike, then the whole desktop gets on strike. I don't think it's more
stable than MS windows. :-) Though for sure, its kernel is more robust
that I can still telnet and login from another machine to reboot it.

The bad thing is that the current KDE is not like what I learned from
Running Linux. Now I don't really trust the gui configuration tool,
which doesn't look doing the right job, changes files under the surface
that I have no chance to backup, verify or restore.

I need some right documents about KDE so that I can handle and improve
the situation. It's not yet time to enjoy. :-)

best regards,
charlie

On Mon, Feb 04, 2002 at 11:56:01AM -0500, Justin R. Miller wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Said Charles Jie on Tue, Feb 05, 2002 at 12:46:17AM +0800:

  1. The file manager Konqueror is not mature (crash so oftern)

 If it crashes, then your setup has issues.  It has been stable for
 years... even for opening big directories like /dev.




Re: Wish about mutt's file browser

2002-02-05 Thread John Buttery

On Tue, Feb 05, 2002 at 12:46:17AM +0800, Charles Jie wrote:
Now let's see linux (for me, Mandrake 8.1):
2. The 'ls' don't group directories/files into two part.
   - If you code something to achieve it, you lose the COLORs.
*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?

File system is everything. If we can not deal with it smoothly, life is
tough.

best regards,
charlie

  That is true, if you can't interact with the filesystem, life
is tough.  Actually, things were sorted the way you're referring to
until recently.  The issue you're referring to isn't a Mandrake
issue, it's a GNU issue...with the new version of GNU ls, they are
finally observing the locale settings that they were supposed to be
observing from the beginning.  :)
  Anyway, without getting into a technical discussion about locale
settings and GNU ls...if you want ls to sort stuff the old way, put
this into your shell startup file:

~/.cshrc (csh) or ~/.tcshrc (tcsh):
 setenv LC_COLLATE posix

~/.profile (sh) or ~/.bashrc (bash) or ~/.zprofile (zsh)
 export LC_COLLATE=posix

  That will fix things with ls, and then if you combine that with the
patch someone suggested a few posts back in the message
[EMAIL PROTECTED], that should make mutt
collate the same way.
  klaxonNote to people who have LC_ALL set/klaxon: In case someone
else tries this; LC_ALL is not a default variable, it's an override
variable.  You must unset it before any of the sub LC_* variables will
have an effect.
  All of this talk of piping ls to sort, or aliasing it to find, is
giving me twitches.  :)

-- 

 John Buttery

 Man, that Shaft is a bad mutha...
  Shut yo' mouth!
  I'm just talkin' 'bout Shaft...

 (Web page temporarily unavailable)

psst...uncolor (body|header)...  pretty please? :)



Wish about mutt's file browser

2002-02-04 Thread Charles Jie

There do be something I miss since I moved from MS-windows to linux -
the file manager. (But I mean the old style one instead of the web-style.)

Its features:
  . A directory tree at left side - very easy to trace down a branch
  . A listing of directory content at right side, while
- A list of sorted folders come first
- A list of sorted files follow.
  . You can click any title (Name, Ext, Size, Date...) to sort them
- But folders and files are always put separated - that's a good
  practice

And the pop-up dialog for file selection is pretty convenient:
  . A 'back' button allows you to go up one level of directory
  . A 'new' button allows you to create new directory
  . A file (or folder) name template - copy the file name you select so
that you can edit it.


Now let's see linux (for me, Mandrake 8.1):
1. The file manager Konqueror is not mature (crash so oftern)
2. The 'ls' don't group directories/files into two part.
   - If you code something to achieve it, you lose the COLORs.
*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?

File system is everything. If we can not deal with it smoothly, life is
tough.

best regards,
charlie



Re: Wish about mutt's file browser

2002-02-04 Thread Philip Mak

On Tue, Feb 05, 2002 at 12:46:17AM +0800, Charles Jie wrote:
 2. The 'ls' don't group directories/files into two part.
- If you code something to achieve it, you lose the COLORs.

Try typing this and see if it does what you want:

ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0`

You could put this in your .bashrc (or equivalent file):

alias dir=ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0`

and then just type dir and you will see the directories, followed by
the files, and it's sorted and has color.

Warning: It might not work right for directories that have a huge
number of files due to limits in argument list length.



Re: Wish about mutt's file browser

2002-02-04 Thread Dave Smith

On Tue, Feb 05, 2002 at 12:46:17AM +0800, [EMAIL PROTECTED] wrote:
 There do be something I miss since I moved from MS-windows to linux -
 the file manager. (But I mean the old style one instead of the web-style.)
[snip]

There are loads of X and text-based file managers around.  I'm an xterm
junkie myself, but lots of people like Midnight Commander (mc).  Otherwise,
do some web searches for file manager, perhaps on www.google.com/linux.

You'll probably find one that you like.

HTH...

-- 
David Smith   Tel: +44 (0)1454 462380 (direct)
STMicroelectronicsFax: +44 (0)1454 617910
1000 Aztec WestTINA (ST only): (065) 2380
Almondsbury  Home: 01454 616963
BRISTOLMobile: 07932 642724
BS32 4SQ   Work Email: [EMAIL PROTECTED]
   Home Email: [EMAIL PROTECTED]



[OT] Re: Wish about mutt's file browser

2002-02-04 Thread Justin R. Miller

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Said Charles Jie on Tue, Feb 05, 2002 at 12:46:17AM +0800:

 1. The file manager Konqueror is not mature (crash so oftern)

If it crashes, then your setup has issues.  It has been stable for
years... even for opening big directories like /dev.

- -- 
[!] Justin R. Miller [EMAIL PROTECTED]
PGP 0xC9C40C31 -=- http://codesorcery.net

http://drcnet.org/wol/222.html#superbowlads
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8Xr0h94d6K8nEDDERAgBkAJ96JcNL3Hf1TxQsr/Fg/rzlRgkkMwCfUGrT
cs0owLSH4d+18SmhF8Smuos=
=Qoaa
-END PGP SIGNATURE-



Re: [OT] Re: Wish about mutt's file browser

2002-02-04 Thread Thomas E. Dickey

On Mon, 4 Feb 2002, Justin R. Miller wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Said Charles Jie on Tue, Feb 05, 2002 at 12:46:17AM +0800:

  1. The file manager Konqueror is not mature (crash so oftern)

 If it crashes, then your setup has issues.  It has been stable for
 years... even for opening big directories like /dev.

which reminds me of a case where I was helping someone fix a problem with
his email (in 1988 on an Apollo).  My directory editor didn't much like
that he had 1185 files in his home directory (it was increasing the
file-array by one for each realloc - making it perform badly).

-- 
T.E.Dickey [EMAIL PROTECTED]
http://invisible-island.net
ftp://invisible-island.net




Re: Wish about mutt's file browser

2002-02-04 Thread David Champion

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]NSITUniversity 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 *);



Re: Wish about mutt's file browser

2002-02-04 Thread David T-G

Rob, et al --

...and then Feztaa said...
% 
% Alas! Philip Mak spake thus:
%  On Tue, Feb 05, 2002 at 12:46:17AM +0800, Charles Jie wrote:
%   2. The 'ls' don't group directories/files into two part.
%  - If you code something to achieve it, you lose the COLORs.
...
%  ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0`
% 
% Why not just do 'ls -AlF|sort'? That way all lines showing a directory
% will start with 'd', and all lines that are files will start with '-'

That's true.  Of course, you throw away the colors when you pipe the
output, IIRC...


% (also, character devices will start with 'c', block devices will start

Right.


% with 'b', and symlinks will start with 'l'). Then you get an alphabetic
% listing, it automatically puts the directories first.

No, you won't get that -- or at least not with the example above.  You'd
have to tell sort to sort on the first word and then on the 9th or 8th
(depending on whether or not you show group by default), and meanwhile
you have to figure out what to do with the total NN line that
usually comes first.


% 
% If you really don't like all that verbosity, you could tack on a sed
% that only shows what you want to see.

That, too.


% 
% -- 
% Rob 'Feztaa' Park
% [EMAIL PROTECTED]


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg24200/pgp0.pgp
Description: PGP signature


Re: Wish about mutt's file browser

2002-02-04 Thread Rob 'Feztaa' Park

Alas! David T-G spake thus:
 % Why not just do 'ls -AlF|sort'? That way all lines showing a
 % directory will start with 'd', and all lines that are files will
 % start with '-'

 That's true.  Of course, you throw away the colors when you pipe the
 output, IIRC...

That's true, I suppose. 

 % Then you get an alphabetic listing, it automatically puts the
 % directories first.

 No, you won't get that -- or at least not with the example above.
 You'd have to tell sort to sort on the first word and then on the 9th
 or 8th (depending on whether or not you show group by default), and
 meanwhile you have to figure out what to do with the total NN
 line that usually comes first.

I guess I wasn't clear -- what I meant was, 'sort' will sort by the
first letter alphabetically -- so all the lines starting with 'd',
directories, will be before all the lines starting with '-', files.

In other words, the alphabetic listing of the output puts the
directories first just because that's how the alphabet works. The files
themselves will be out of order.

-- 
Rob 'Feztaa' Park
[EMAIL PROTECTED]
--
The difference between fiction and reality is that fiction has to
make sense.
-- Tom Clancy



msg24202/pgp0.pgp
Description: PGP signature


Re: Wish about mutt's file browser

2002-02-04 Thread Charles Jie

Hi, Philip,

Thank you for your idea. This does keep the colors.

I rewrite it as:

function d()
{
x=`find * -type d -maxdepth 0`
[[ -n $x ]]  l -d $x
x=`find * -type l -maxdepth 0`
[[ -n $x ]]  l $x
x=`find * -type f -maxdepth 0`
[[ -n $x ]]  l $x
unset x
}

to avoid redundant output while nothing *found*. It works fine w/o
delay.

* However, I wish mutt's file browser can also improve like this to make
  our life easier. :-)

best regards,
charlie

On Mon, Feb 04, 2002 at 11:53:58AM -0500, Philip Mak wrote:
 On Tue, Feb 05, 2002 at 12:46:17AM +0800, Charles Jie wrote:
  2. The 'ls' don't group directories/files into two part.
 - If you code something to achieve it, you lose the COLORs.

 Try typing this and see if it does what you want:

 ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0`

 You could put this in your .bashrc (or equivalent file):

 alias dir=ls -d `find * -type d -maxdepth 0`; ls `find * -type f -maxdepth 0`

 and then just type dir and you will see the directories, followed by
 the files, and it's sorted and has color.

 Warning: It might not work right for directories that have a huge
 number of files due to limits in argument list length.



Re: Wish about mutt's file browser

2002-02-04 Thread David T-G

Rob --

...and then Feztaa said...
% 
% Alas! David T-G spake thus:
%  % Why not just do 'ls -AlF|sort'? That way all lines showing a
%  % directory will start with 'd', and all lines that are files will
%  % start with '-'
% 
%  That's true.  Of course, you throw away the colors when you pipe the
%  output, IIRC...
% 
% That's true, I suppose. 

Yep.


% 
%  % Then you get an alphabetic listing, it automatically puts the
%  % directories first.
% 
%  No, you won't get that -- or at least not with the example above.
%  You'd have to tell sort to sort on the first word and then on the 9th
%  or 8th (depending on whether or not you show group by default), and
%  meanwhile you have to figure out what to do with the total NN
%  line that usually comes first.
% 
% I guess I wasn't clear -- what I meant was, 'sort' will sort by the
% first letter alphabetically -- so all the lines starting with 'd',

That's true; it will, indeed.


% directories, will be before all the lines starting with '-', files.

Um, you'll be wanting to check that, too :-)


% 
% In other words, the alphabetic listing of the output puts the
% directories first just because that's how the alphabet works. The files

Or second, even, but I get the point.


% themselves will be out of order.

Well, what good will that be?!?


% 
% -- 
% Rob 'Feztaa' Park
% [EMAIL PROTECTED]
% --
% The difference between fiction and reality is that fiction has to
% make sense.
% -- Tom Clancy


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg24207/pgp0.pgp
Description: PGP signature