[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Re: Re: [Ranger-users] is there a way to quickly "mark" by patte

From: David Woodfall
Subject: Re: Re: Re: Re: [Ranger-users] is there a way to quickly "mark" by pattern?
Date: Wed, 28 Apr 2010 19:46:22 +0100
User-agent: Mutt/1.5.19 (2009-01-05)

On (18:29 28/04/10), David Woodfall <address@hidden> put forth the proposition:
On (14:41 28/04/10), Roman Z. <address@hidden> put forth the proposition:
I would be interested in selecting and other operations by file type
actually. It would be useful for a few things, and opening files by

Gonna have to think about how to elegantly implement that.  Someone else
suggested adding the keys { and } which move you to the next logical
section, i.e. If you sort by filetype, it moves you to the previous/next file
with a different filetype.

By combining it with a selection key, you could select whole sections,
like all images in a directory, etc.

I'll think about it

the output of 'file' command, rather than extension would be nice
for associating say 'mutt -f' with an mbox file.

That's already possible.  Use the attribute "filetype" to get the mime
type returned by the file command.  It's used in the default apps.py to
identify text files:

if f.document or f.filetype.startswith('text'):

You could adapt this for mbox files.  Patches are welcome. =P

Yes I just found how to do this (sort of):

         if f.document or f.filetype.find('mail') != -1:
             return self.app_mutt(c)

     def app_mutt(self, c):
         return tup('mutt', '-f', c.file.path)

I have tested a little and it seems ok. I'm unsure if .find('mail') is the best way of doing it. Would there be other files containing it?
I did try startswith('mail text') but that went nowhere. Here are a few
examples of running file on my mboxes:

mail/mbox:          ASCII mail text
mail/museum:        ASCII mail text, with very long lines
mail/ou-mailings:   data (???!)
mail/redhat:        UTF-8 Unicode mail text, with very long lines
mail/reminders:     ASCII mail text
mail/sent:          directory
mail/shops:         ISO-8859 mail text, with very long lines
mail/unrealize:     Lisp/Scheme program text (???!)

I'm now thinking that I should find a way of converting some of

Well I just tried using the recode app but it doesn't change anything.
How would I go about specifying that in ~/mail all files should be
opened with mutt?

By the way I also tried to implement a ':file' command, not very
successfully, to print filetype, but I'll make a new thread about that.

Don't look back, the lemmings are gaining on you.

Don't look back, the lemmings are gaining on you.

Attachment: pgpTnD4K7_Pc8.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]