all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* viewing random list of files in dired
@ 2009-01-18 13:04 Andreas Politz
  2009-01-18 13:54 ` Rupert Swarbrick
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Politz @ 2009-01-18 13:04 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

is it possible to view a random list of files with dired ?

What I really want is to examine a couple 100 of images from
different directories as thumbnails with associated filename.
The names come from the command line. None of the programs I
have tried (gthumb,gqview,xzgv,feh) can do it.

Thanks,

-ap


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: viewing random list of files in dired
  2009-01-18 13:04 viewing random list of files in dired Andreas Politz
@ 2009-01-18 13:54 ` Rupert Swarbrick
  2009-01-18 15:10   ` Andreas Politz
  2009-02-17 14:16   ` David Combs
  0 siblings, 2 replies; 10+ messages in thread
From: Rupert Swarbrick @ 2009-01-18 13:54 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

Andreas Politz <politza@fh-trier.de> writes:

> Hi,
>
> is it possible to view a random list of files with dired ?
>
> What I really want is to examine a couple 100 of images from
> different directories as thumbnails with associated filename.
> The names come from the command line. None of the programs I
> have tried (gthumb,gqview,xzgv,feh) can do it.
>
> Thanks,
>
> -ap

I don't know whether dired will do this directly, but for a similar
problem in the past I used the following approach: create a temporary
directory and make symbolic links to each of the files in the list (if
you really mean random, you can pipe your command through eg shuf),
naming them 00001 00002 etc.

The result will be ordered however you choose (based on the ordering you
fed to your "counter") and you can just wipe the temporary directory
when done.

Rupert

[-- Attachment #2: Type: application/pgp-signature, Size: 314 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: viewing random list of files in dired
  2009-01-18 13:54 ` Rupert Swarbrick
@ 2009-01-18 15:10   ` Andreas Politz
  2009-01-18 16:15     ` Drew Adams
  2009-02-17 14:16   ` David Combs
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Politz @ 2009-01-18 15:10 UTC (permalink / raw)
  To: help-gnu-emacs

Rupert Swarbrick wrote:
> Andreas Politz <politza@fh-trier.de> writes:
> 
>> Hi,
>>
>> is it possible to view a random list of files with dired ?
>>
>> What I really want is to examine a couple 100 of images from
>> different directories as thumbnails with associated filename.
>> The names come from the command line. None of the programs I
>> have tried (gthumb,gqview,xzgv,feh) can do it.
>>
>> Thanks,
>>
>> -ap
> 
> I don't know whether dired will do this directly, but for a similar
> problem in the past I used the following approach: create a temporary
> directory and make symbolic links to each of the files in the list (if
> you really mean random, you can pipe your command through eg shuf),
> naming them 00001 00002 etc.

By random I ment that the files have no particular common property
(like coming from the same directory).
Creating links in a new directory seems to be the best bet. After
the frustration from trying 5 different programs settled down, I
modified dired-image to accept a list of files. While the results
are pleasing, it just takes to long for > 1000 files.

-ap

> 
> The result will be ordered however you choose (based on the ordering you
> fed to your "counter") and you can just wipe the temporary directory
> when done.
> 
> Rupert


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: viewing random list of files in dired
  2009-01-18 15:10   ` Andreas Politz
@ 2009-01-18 16:15     ` Drew Adams
  2009-01-18 17:00       ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2009-01-18 16:15 UTC (permalink / raw)
  To: 'Andreas Politz', help-gnu-emacs

> >> is it possible to view a random list of files with dired ?
> >>
> >> What I really want is to examine a couple 100 of images from
> >> different directories as thumbnails with associated filename.
> >> The names come from the command line. None of the programs I
> >> have tried (gthumb,gqview,xzgv,feh) can do it.
...
> By random I ment that the files have no particular common property
> (like coming from the same directory).
> Creating links in a new directory seems to be the best bet. After
> the frustration from trying 5 different programs settled down, I
> modified dired-image to accept a list of files. While the results
> are pleasing, it just takes to long for > 1000 files.

Yes, and you don't need to create symlinks or otherwise modify your file system.

If you use Icicles, you can define a set of arbitrary file or directory names
and later open Dired for just that set. You can save the set persistently, if
you like.

You can create the list of file names any way you like - it's just a list of
names. The names could originally "come from the command line", for instance. 

You can also create or add to such a set of file names using the files that are
marked in Dired buffers.

http://www.emacswiki.org/emacs/Icicles_-_Dired_Enhancements






^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: viewing random list of files in dired
  2009-01-18 16:15     ` Drew Adams
@ 2009-01-18 17:00       ` Drew Adams
  2009-01-18 17:38         ` Harry Putnam
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2009-01-18 17:00 UTC (permalink / raw)
  To: 'Andreas Politz', help-gnu-emacs

> > >> is it possible to view a random list of files with dired ?
> > >>
> > >> What I really want is to examine a couple 100 of images from
> > >> different directories as thumbnails with associated filename.
> > >> The names come from the command line. None of the programs I
> > >> have tried (gthumb,gqview,xzgv,feh) can do it.
> ...
> > By random I ment that the files have no particular common property
> > (like coming from the same directory).
> > Creating links in a new directory seems to be the best bet. After
> > the frustration from trying 5 different programs settled down, I
> > modified dired-image to accept a list of files. While the results
> > are pleasing, it just takes to long for > 1000 files.
> 
> Yes, and you don't need to create symlinks or otherwise 
> modify your file system.
> 
> If you use Icicles, you can define a set of arbitrary file or 
> directory names and later open Dired for just that set. You can
> save the set persistently, if you like.
> 
> You can create the list of file names any way you like - it's 
> just a list of names. The names could originally "come from the
> command line", for instance. 
> 
> You can also create or add to such a set of file names using 
> the files that are marked in Dired buffers.
> 
> http://www.emacswiki.org/emacs/Icicles_-_Dired_Enhancements


I should add that you can also do this without Icicles - Icicles just makes
things easier.

Function `dired' will accept a list of file names as its first argument. That is
the key here. This is all you need, to open Dired using a list `file-names':

(dired (cons (generate-new-buffer-name "My Dired")
             (nreverse (mapcar (lambda (file)
                                 (if (file-name-absolute-p file)
                                     (expand-file-name file)
                                   file))
                               file-names))))






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: viewing random list of files in dired
  2009-01-18 17:00       ` Drew Adams
@ 2009-01-18 17:38         ` Harry Putnam
  2009-01-18 17:48           ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Harry Putnam @ 2009-01-18 17:38 UTC (permalink / raw)
  To: help-gnu-emacs

"Drew Adams" <drew.adams@oracle.com> writes:

> Function `dired' will accept a list of file names as its first
> argument. That is the key here. This is all you need, to open Dired
> using a list `file-names':
>
> (dired (cons (generate-new-buffer-name "My Dired")
>              (nreverse (mapcar (lambda (file)
>                                  (if (file-name-absolute-p file)
>                                      (expand-file-name file)
>                                    file))
>                                file-names))))

Sorry to butt in right at the end here... but is something more that I
would need to do for your example to work?

Just evaluating it give me "Symbol's value as variable is void: file-names"





^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: viewing random list of files in dired
  2009-01-18 17:38         ` Harry Putnam
@ 2009-01-18 17:48           ` Drew Adams
  2009-01-18 18:28             ` Harry Putnam
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2009-01-18 17:48 UTC (permalink / raw)
  To: 'Harry Putnam', help-gnu-emacs

> > Function `dired' will accept a list of file names as its first
> > argument. That is the key here. This is all you need, to open Dired
> > using a list `file-names':
> >
> > (dired (cons (generate-new-buffer-name "My Dired")
> >              (nreverse (mapcar (lambda (file)
> >                                  (if (file-name-absolute-p file)
> >                                      (expand-file-name file)
> >                                    file))
> >                                file-names))))
> 
> Sorry to butt in right at the end here... but is something more that I
> would need to do for your example to work?
> 
> Just evaluating it give me "Symbol's value as variable is 
> void: file-names"

Just set `file-names' to a list of files. E.g.:
(setq file-names '("some-file-in-def-dir.el" "/some/abs/file/foo.el"))

No matter how the list of file names is created, it should work.

(FWIW, in Icicles you can create a list of files (in any directories) by
choosing them interactively.)





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: viewing random list of files in dired
  2009-01-18 17:48           ` Drew Adams
@ 2009-01-18 18:28             ` Harry Putnam
  2009-01-18 18:45               ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Harry Putnam @ 2009-01-18 18:28 UTC (permalink / raw)
  To: help-gnu-emacs

"Drew Adams" <drew.adams@oracle.com> writes:

> Just set `file-names' to a list of files. E.g.:
> (setq file-names '("some-file-in-def-dir.el" "/some/abs/file/foo.el"))
>
> No matter how the list of file names is created, it should work.

Pretty slick... thanks





^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: viewing random list of files in dired
  2009-01-18 18:28             ` Harry Putnam
@ 2009-01-18 18:45               ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2009-01-18 18:45 UTC (permalink / raw)
  To: 'Harry Putnam', help-gnu-emacs

> > Just set `file-names' to a list of files. E.g.:
> > (setq file-names '("some-file-in-def-dir.el" 
> >                    "/some/abs/file/foo.el"))
> >
> > No matter how the list of file names is created, it should work.
> 
> Pretty slick... thanks

I don't know why this is undocumented (beyond the source code itself). It is
mentioned in neither the Emacs manual nor theh Elisp manual. I've just filed a
doc enhancement request. It would be good to mention this in the Emacs manual,
node `Dired Enter'.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: viewing random list of files in dired
  2009-01-18 13:54 ` Rupert Swarbrick
  2009-01-18 15:10   ` Andreas Politz
@ 2009-02-17 14:16   ` David Combs
  1 sibling, 0 replies; 10+ messages in thread
From: David Combs @ 2009-02-17 14:16 UTC (permalink / raw)
  To: help-gnu-emacs

In article <gkvcbi$ltf$1@news.albasani.net>,
Rupert Swarbrick  <rswarbrick@gmail.com> wrote:
>-=-=-=-=-=-
>
>Andreas Politz <politza@fh-trier.de> writes:
>
>> Hi,
>>
>> is it possible to view a random list of files with dired ?
>>
>> What I really want is to examine a couple 100 of images from
>> different directories as thumbnails with associated filename.
>> The names come from the command line. None of the programs I
>> have tried (gthumb,gqview,xzgv,feh) can do it.
>>
>> Thanks,
>>
>> -ap
>
>I don't know whether dired will do this directly, but for a similar
>problem in the past I used the following approach: create a temporary
>directory and make symbolic links to each of the files in the list (if
>you really mean random, you can pipe your command through eg shuf),
>naming them 00001 00002 etc.
>
>The result will be ordered however you choose (based on the ordering you
>fed to your "counter") and you can just wipe the temporary directory
             ^^^^^^^^^
>when done.
>
>Rupert
>
>-=-=-=-=-=-
>[Attachment type=application/pgp-signature, name=unknown]
>-=-=-=-=-=-

What's this "counter" you mention as a help in a dired-order?

Thanks!

David




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-02-17 14:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-18 13:04 viewing random list of files in dired Andreas Politz
2009-01-18 13:54 ` Rupert Swarbrick
2009-01-18 15:10   ` Andreas Politz
2009-01-18 16:15     ` Drew Adams
2009-01-18 17:00       ` Drew Adams
2009-01-18 17:38         ` Harry Putnam
2009-01-18 17:48           ` Drew Adams
2009-01-18 18:28             ` Harry Putnam
2009-01-18 18:45               ` Drew Adams
2009-02-17 14:16   ` David Combs

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.