unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Dired like functionality on a custom text file
@ 2008-05-19 18:38 Jesse
  2008-05-19 19:26 ` harven
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Jesse @ 2008-05-19 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

I have a situation where I have a lot of common files i need to edit
but they are all in various directories spread across my hard drive.
I was trying to come up with a way where I could make a text file that
has all the paths to the files I commonly need and somehow open that
file into a dired like mode.  Is there anyway I can do this, or even
alternatively possibly easily pass the current line my cursor is on in
that file to the mini buffer when I put in the visit command?


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

* Re: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
@ 2008-05-19 19:26 ` harven
  2008-05-19 20:38   ` Drew Adams
  2008-05-19 21:57 ` David Kastrup
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: harven @ 2008-05-19 19:26 UTC (permalink / raw)
  To: help-gnu-emacs

On May 19, 8:38 pm, Jesse <jesse.br...@gmail.com> wrote:
> I have a situation where I have a lot of common files i need to edit
> but they are all in various directories spread across my hard drive.
> I was trying to come up with a way where I could make a text file that
> has all the paths to the files I commonly need and somehow open that
> file into a dired like mode.  Is there anyway I can do this, or even
> alternatively possibly easily pass the current line my cursor is on in
> that file to the mini buffer when I put in the visit command?

M-x find-name-dired prompts for the name of a directory
and a filename wildcard, and fetch in a Dired buffer all
files in the subdirectories matching the wildcard.

M-x find-grep-dired fetches files which contain strings matching a
regular expression, recursively starting from
a given directory.

Finally, dired-x is an extension to dired which provides a feature
called "Virtual Dired". This feature puts a buffer with Dired-like
contents in Dired mode. Have a look at the dired-x manual (C-h i m
dired-x), which comes with a basic emacs install. You need first to
enable dired-x with something like
 (add-hook 'dired-load-hook  (lambda ()
                 (load "dired-x")))


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

* RE: Dired like functionality on a custom text file
  2008-05-19 19:26 ` harven
@ 2008-05-19 20:38   ` Drew Adams
  0 siblings, 0 replies; 15+ messages in thread
From: Drew Adams @ 2008-05-19 20:38 UTC (permalink / raw)
  To: 'harven', help-gnu-emacs

> > I have a situation where I have a lot of common files i need to edit
> > but they are all in various directories spread across my hard drive.
> > I was trying to come up with a way where I could make a 
> > text file that has all the paths to the files I commonly need and
> > somehow open that file into a dired like mode.  Is there anyway I
> > can do this, or even alternatively possibly easily pass the current
> > line my cursor is on in that file to the mini buffer when I put in
> > the visit command?
> 
> M-x find-name-dired prompts for the name of a directory
> and a filename wildcard, and fetch in a Dired buffer all
> files in the subdirectories matching the wildcard.
> 
> M-x find-grep-dired fetches files which contain strings matching a
> regular expression, recursively starting from a given directory.
> 
> Finally, dired-x is an extension to dired which provides a feature
> called "Virtual Dired". This feature puts a buffer with Dired-like
> contents in Dired mode. Have a look at the dired-x manual (C-h i m
> dired-x), which comes with a basic emacs install. You need first to
> enable dired-x with something like
>  (add-hook 'dired-load-hook  (lambda ()
>                  (load "dired-x")))

Here's another approach you might want to consider: 

1. Choose the files and subdirectories you want to access together. This is a
one-time operation, but you can modify the list later if you want.

2. Use that set of files and directories as completion candidates for file
operations.

You can do this with Icicles. See, for instance:
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Support_for_Projects

There are links on that page for how to use such a defined set of files to do
various things, such as find and replace.





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

* Re: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
  2008-05-19 19:26 ` harven
@ 2008-05-19 21:57 ` David Kastrup
  2008-05-20  5:01 ` Dmitri Minaev
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: David Kastrup @ 2008-05-19 21:57 UTC (permalink / raw)
  To: help-gnu-emacs

Jesse <jesse.brown@gmail.com> writes:

> I have a situation where I have a lot of common files i need to edit
> but they are all in various directories spread across my hard drive.
> I was trying to come up with a way where I could make a text file that
> has all the paths to the files I commonly need and somehow open that
> file into a dired like mode.

Well, you could do

M-! xargs -a your-text-file ls -ld

and then do

M-: (dired-mode) RET

on the resulting Shell output window.

Untested.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


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

* Re: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
  2008-05-19 19:26 ` harven
  2008-05-19 21:57 ` David Kastrup
@ 2008-05-20  5:01 ` Dmitri Minaev
  2008-05-20 11:16 ` Chris McMahan
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Dmitri Minaev @ 2008-05-20  5:01 UTC (permalink / raw)
  To: Jesse; +Cc: help-gnu-emacs

On Mon, May 19, 2008 at 11:38 PM, Jesse <jesse.brown@gmail.com> wrote:
> Is there anyway I can do this, or even
> alternatively possibly easily pass the current line my cursor is on in
> that file to the mini buffer when I put in the visit command?

You could use the hyperlinks in Org-mode or Muse:

[[file:/path/to/directory][my first directory]] -- for Org;
[[/path/to/directory][my first directory]] -- for Muse.

Clicking on the link will open dired on the directory. Of course, you
can also add links to files.

-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com




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

* Re: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
                   ` (2 preceding siblings ...)
  2008-05-20  5:01 ` Dmitri Minaev
@ 2008-05-20 11:16 ` Chris McMahan
  2008-05-20 12:07 ` Bernardo Bacic
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chris McMahan @ 2008-05-20 11:16 UTC (permalink / raw)
  To: help-gnu-emacs


Look at the function `dired-virtual` -- part of the virtual-dired mode
in dired-x.

The short version is you use dired to view a directory you're
interested in, then save that dired buffer to a file. You can then add
other dired listings to this file to build the collection you're
interested in. When you open the file the next time, use M-x
dired-virtual to put it in dired mode.

- Chris

Jesse <jesse.brown@gmail.com> writes:

> I have a situation where I have a lot of common files i need to edit
> but they are all in various directories spread across my hard drive.
> I was trying to come up with a way where I could make a text file that
> has all the paths to the files I commonly need and somehow open that
> file into a dired like mode.  Is there anyway I can do this, or even
> alternatively possibly easily pass the current line my cursor is on in
> that file to the mini buffer when I put in the visit command?

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================


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

* Re: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
                   ` (3 preceding siblings ...)
  2008-05-20 11:16 ` Chris McMahan
@ 2008-05-20 12:07 ` Bernardo Bacic
  2008-05-20 15:03   ` reader
  2008-05-20 13:31 ` Drew Adams
  2008-05-20 17:35 ` Ilya Zakharevich
  6 siblings, 1 reply; 15+ messages in thread
From: Bernardo Bacic @ 2008-05-20 12:07 UTC (permalink / raw)
  To: Jesse; +Cc: help-gnu-emacs

it was a dark and stormy night when Jesse said, On 05/20/2008 04:38 AM:
> I have a situation where I have a lot of common files i need to edit
> but they are all in various directories spread across my hard drive.
> I was trying to come up with a way where I could make a text file that
> has all the paths to the files I commonly need and somehow open that
> file into a dired like mode.  


 > Is there anyway I can do this, or even
> alternatively possibly easily pass the current line my cursor is on in
> that file to the mini buffer when I put in the visit command?

could it be that find-file-at-point (M-x ffap) is what you are looking for here?




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

* RE: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
                   ` (4 preceding siblings ...)
  2008-05-20 12:07 ` Bernardo Bacic
@ 2008-05-20 13:31 ` Drew Adams
  2008-05-20 20:54   ` Drew Adams
  2008-05-20 17:35 ` Ilya Zakharevich
  6 siblings, 1 reply; 15+ messages in thread
From: Drew Adams @ 2008-05-20 13:31 UTC (permalink / raw)
  To: 'Jesse', help-gnu-emacs

> easily pass the current line my cursor is on in
> that file to the mini buffer when I put in the visit command?

See ffap.el for that. See node FFAP in the Emacs manual for an explanation.





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

* Re: Dired like functionality on a custom text file
  2008-05-20 12:07 ` Bernardo Bacic
@ 2008-05-20 15:03   ` reader
  2008-05-21 11:39     ` Bernardo Bacic
  0 siblings, 1 reply; 15+ messages in thread
From: reader @ 2008-05-20 15:03 UTC (permalink / raw)
  To: help-gnu-emacs

Bernardo Bacic <bernardo.bacic@pobox.com> writes:

> it was a dark and stormy night when Jesse said, On 05/20/2008 04:38 AM:
>> I have a situation where I have a lot of common files i need to edit
>> but they are all in various directories spread across my hard drive.
>> I was trying to come up with a way where I could make a text file that
>> has all the paths to the files I commonly need and somehow open that
>> file into a dired like mode.  

[...]

If I might butt in here a moment:

Bernardo writes:
> could it be that find-file-at-point (M-x ffap) is what you are looking for here?

I don't see much of anything happen using that...

First compile a list of files

find dir -type f >dir/file

Now load file into emacs.

With cursor on this line:
dir/new.txt

Pressing M-x ffap shows
Find file or URL: ~/dir/

And that's it.  Completion doesn't go anywhere either.

I thought this was supposed to load the file name.





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

* Re: Dired like functionality on a custom text file
  2008-05-19 18:38 Dired like functionality on a custom text file Jesse
                   ` (5 preceding siblings ...)
  2008-05-20 13:31 ` Drew Adams
@ 2008-05-20 17:35 ` Ilya Zakharevich
  6 siblings, 0 replies; 15+ messages in thread
From: Ilya Zakharevich @ 2008-05-20 17:35 UTC (permalink / raw)
  To: help-gnu-emacs

[A complimentary Cc of this posting was sent to
Jesse 
<jesse.brown@gmail.com>], who wrote in article <683a41e6-1009-4c2e-9354-b748c6f7ad95@t12g2000prg.googlegroups.com>:
> I have a situation where I have a lot of common files i need to edit
> but they are all in various directories spread across my hard drive.
> I was trying to come up with a way where I could make a text file that
> has all the paths to the files I commonly need and somehow open that
> file into a dired like mode.  Is there anyway I can do this, or even
> alternatively possibly easily pass the current line my cursor is on in
> that file to the mini buffer when I put in the visit command?

I'm puzzled why you do not consider a solution like

  emacs `cat list-of-files`

Maybe the files have spaces in their names?  Or is the total size
larger than what Emacs may handle?

Yours,
Ilya


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

* RE: Dired like functionality on a custom text file
  2008-05-20 13:31 ` Drew Adams
@ 2008-05-20 20:54   ` Drew Adams
  0 siblings, 0 replies; 15+ messages in thread
From: Drew Adams @ 2008-05-20 20:54 UTC (permalink / raw)
  To: 'Jesse', help-gnu-emacs

> > easily pass the current line my cursor is on in
> > that file to the mini buffer when I put in the visit command?
> 
> See ffap.el for that. See node FFAP in the Emacs manual for 
> an explanation.

I should also have suggested this:
http://www.emacswiki.org/cgi-bin/wiki/FindFileAtPoint





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

* Re: Dired like functionality on a custom text file
  2008-05-20 15:03   ` reader
@ 2008-05-21 11:39     ` Bernardo Bacic
  2008-05-21 14:10       ` reader
       [not found]       ` <mailman.11963.1211387800.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 15+ messages in thread
From: Bernardo Bacic @ 2008-05-21 11:39 UTC (permalink / raw)
  To: reader; +Cc: help-gnu-emacs


>> could it be that find-file-at-point (M-x ffap) is what you are looking for here?
> 
> I don't see much of anything happen using that...
> 
> First compile a list of files
> 
> find dir -type f >dir/file
> 
> Now load file into emacs.
> 
> With cursor on this line:
> dir/new.txt
> 
> Pressing M-x ffap shows
> Find file or URL: ~/dir/
> 
> And that's it.  Completion doesn't go anywhere either.
> 
> I thought this was supposed to load the file name.
i'm only guessing - it could be due to relative path names;
try changing your command to:
    find `pwd`/dir -type f >dir/file

or just manually edit entries in your 'dir/file' and see if that makes any 
difference




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

* Re: Dired like functionality on a custom text file
  2008-05-21 11:39     ` Bernardo Bacic
@ 2008-05-21 14:10       ` reader
       [not found]       ` <mailman.11963.1211387800.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 15+ messages in thread
From: reader @ 2008-05-21 14:10 UTC (permalink / raw)
  To: help-gnu-emacs

Bernardo Bacic <bernardo.bacic@pobox.com> writes:

>>> could it be that find-file-at-point (M-x ffap) is what you are looking for here?
>>
>> I don't see much of anything happen using that...
>>
>> First compile a list of files
>>
>> find dir -type f >dir/file
>>
>> Now load file into emacs.
>>
>> With cursor on this line:
>> dir/new.txt
>>
>> Pressing M-x ffap shows
>> Find file or URL: ~/dir/
>>
>> And that's it.  Completion doesn't go anywhere either.
>>
>> I thought this was supposed to load the file name.
> i'm only guessing - it could be due to relative path names;
> try changing your command to:
>    find `pwd`/dir -type f >dir/file
>
> or just manually edit entries in your 'dir/file' and see if that makes
> any difference

Yup, that was it .. thanks




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

* Re: Dired like functionality on a custom text file
       [not found]       ` <mailman.11963.1211387800.18990.help-gnu-emacs@gnu.org>
@ 2008-05-24  5:39         ` Alan
  2008-05-24 15:51           ` Drew Adams
  0 siblings, 1 reply; 15+ messages in thread
From: Alan @ 2008-05-24  5:39 UTC (permalink / raw)
  To: help-gnu-emacs

I have found globalff.el a tremendous help to quickly find files
scattered all over tarnations.  I have to have locate or slocate up to
date, and I had to make sure that the directories I am interested in---
in deep and dark regions of my machine --- are searched and indexed by
updatedb.  It is possible to save the link and open it elsewhere, or
open the files right away.

That being said, I think the virtual dired option will be interesting
for me.  I use a kind of a depot file for org-mode to keep a list of
links to important directories and files all over the place.  What is
lacking is the ability to grep-find...   I use long filenames, though.

Alan


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

* RE: Dired like functionality on a custom text file
  2008-05-24  5:39         ` Alan
@ 2008-05-24 15:51           ` Drew Adams
  0 siblings, 0 replies; 15+ messages in thread
From: Drew Adams @ 2008-05-24 15:51 UTC (permalink / raw)
  To: 'Alan', help-gnu-emacs

> I have found globalff.el a tremendous help to quickly find files
> scattered all over tarnations.  I have to have locate or slocate up to
> date, and I had to make sure that the directories I am interested in---
> in deep and dark regions of my machine --- are searched and indexed by
> updatedb.  It is possible to save the link and open it elsewhere, or
> open the files right away.
> 
> That being said, I think the virtual dired option will be interesting
> for me.  I use a kind of a depot file for org-mode to keep a list of
> links to important directories and files all over the place.  What is
> lacking is the ability to grep-find...   I use long filenames, though.

For globalff and alternatives:
http://www.emacswiki.org/cgi-bin/wiki/LocateFilesAnywhere





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

end of thread, other threads:[~2008-05-24 15:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-19 18:38 Dired like functionality on a custom text file Jesse
2008-05-19 19:26 ` harven
2008-05-19 20:38   ` Drew Adams
2008-05-19 21:57 ` David Kastrup
2008-05-20  5:01 ` Dmitri Minaev
2008-05-20 11:16 ` Chris McMahan
2008-05-20 12:07 ` Bernardo Bacic
2008-05-20 15:03   ` reader
2008-05-21 11:39     ` Bernardo Bacic
2008-05-21 14:10       ` reader
     [not found]       ` <mailman.11963.1211387800.18990.help-gnu-emacs@gnu.org>
2008-05-24  5:39         ` Alan
2008-05-24 15:51           ` Drew Adams
2008-05-20 13:31 ` Drew Adams
2008-05-20 20:54   ` Drew Adams
2008-05-20 17:35 ` Ilya Zakharevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).