unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* change working directory in emacs
@ 2006-06-30 18:20 danielx
  2006-06-30 18:53 ` Drew Adams
  2006-06-30 21:27 ` Peter Dyballa
  0 siblings, 2 replies; 6+ messages in thread
From: danielx @ 2006-06-30 18:20 UTC (permalink / raw)



When you find file in emacs, how does it it decide which directory you will
begin finding? Usually, it's the directory where you started emacs, but if
you've already opened some other files, you begin finding elsewhere. Also,
how can I tell emacs where I want to begin finding? Thanks!
-- 
View this message in context: http://www.nabble.com/change-working-directory-in-emacs-tf1874584.html#a5124734
Sent from the Emacs - Help forum at Nabble.com.

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

* RE: change working directory in emacs
  2006-06-30 18:20 change working directory in emacs danielx
@ 2006-06-30 18:53 ` Drew Adams
  2006-06-30 21:27 ` Peter Dyballa
  1 sibling, 0 replies; 6+ messages in thread
From: Drew Adams @ 2006-06-30 18:53 UTC (permalink / raw)


    When you find file in emacs, how does it it decide which
    directory you will
    begin finding? Usually, it's the directory where you started
    emacs, but if
    you've already opened some other files, you begin finding
    elsewhere. Also,
    how can I tell emacs where I want to begin finding? Thanks!

Each file buffer has an associated directory - it is the buffer-local value
of variable `default-directory'. This value is normally the directory of the
file associated with the buffer.

You can change the working directory using Emacs command `cd', just as in
Unix or GNU/Linux.

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

* Re: change working directory in emacs
       [not found] <mailman.3585.1151692923.9609.help-gnu-emacs@gnu.org>
@ 2006-06-30 19:00 ` Maarten Bergvelt
  2006-07-02 18:57   ` danielx
  0 siblings, 1 reply; 6+ messages in thread
From: Maarten Bergvelt @ 2006-06-30 19:00 UTC (permalink / raw)


In article <mailman.3585.1151692923.9609.help-gnu-emacs@gnu.org>, 
danielx wrote:
> 
> When you find file in emacs, how does it it decide which directory you will
> begin finding? Usually, it's the directory where you started emacs, but if
> you've already opened some other files, you begin finding elsewhere. Also,
> how can I tell emacs where I want to begin finding? Thanks!

M-x pwd tells you what the default directory for the buffer is and you
use M-x cd to change it, see the emacs manual, section on file names.

-- 
Maarten Bergvelt		

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

* Re: change working directory in emacs
  2006-06-30 18:20 change working directory in emacs danielx
  2006-06-30 18:53 ` Drew Adams
@ 2006-06-30 21:27 ` Peter Dyballa
  2006-06-30 21:41   ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Dyballa @ 2006-06-30 21:27 UTC (permalink / raw)
  Cc: Help-gnu-emacs


Am 30.06.2006 um 20:20 schrieb danielx:
> When you find file in emacs, how does it it decide which directory  
> you will
> begin finding? Usually, it's the directory where you started emacs,

No! Not in Mac OS X, a FreeBSD based UNIX. Here it's either the  
current working directory of the shell in *shell* (and probably also  
*terminal*) buffer, the directory in the which the file resides from  
which you invoked find-grep, or it's the HOME directory for buffers  
like *scratch* or *calendar* ... From a *compile* buffer it's  
probably also its working directory and from the *Completions* buffer  
it's a bit "context sensible" -- if the buffer lists completions for  
a file to choose for loading from some directory, the search begins  
in this directory.

You can find out this also! Just do M-x find-grep RET and you'll see  
the starting point listed in the beginning of the *grep* buffer. No  
file be hurt, not even a directory.

> but if you've already opened some other files, you begin finding  
> elsewhere. Also,
> how can I tell emacs where I want to begin finding? Thanks!

Substitute ``.´´ in the actual find command with another directory name!

--
Greetings

   Pete

"We have to expect it, otherwise we would be surprised."

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

* Re: change working directory in emacs
  2006-06-30 21:27 ` Peter Dyballa
@ 2006-06-30 21:41   ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2006-06-30 21:41 UTC (permalink / raw)


> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Fri, 30 Jun 2006 23:27:26 +0200
> Cc: Help-gnu-emacs@gnu.org
> 
> Am 30.06.2006 um 20:20 schrieb danielx:
> > When you find file in emacs, how does it it decide which directory  
> > you will
> > begin finding? Usually, it's the directory where you started emacs,
> 
> No! Not in Mac OS X, a FreeBSD based UNIX. Here it's either the  
> current working directory of the shell in *shell* (and probably also  
> *terminal*) buffer, the directory in the which the file resides from  
> which you invoked find-grep, or it's the HOME directory for buffers  
> like *scratch* or *calendar* ...

Really?  I seriously doubt that: on GNU/Linux, *scratch*'s default
directory is the directory where you started Emacs.  And the same goes
for *calendar*.  (Of course, if you start it in your home directory,
then this is the same as HOME.)

Basically, I believe the Windows and Unix versions of Emacs behave the
same in this regard.

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

* Re: change working directory in emacs
  2006-06-30 19:00 ` Maarten Bergvelt
@ 2006-07-02 18:57   ` danielx
  0 siblings, 0 replies; 6+ messages in thread
From: danielx @ 2006-07-02 18:57 UTC (permalink / raw)



Thanks, guys. You gave me exactly what I'm looking for: cd, pwd, and the
thing about the directory associated with the current buffer (I've always
been baffeled at what shows up in the mini-buffer when I find). I'm really
grateful for the help, because I usually don't get a positive response when
I write to mailing lists/forums.
-- 
View this message in context: http://www.nabble.com/change-working-directory-in-emacs-tf1874584.html#a5142529
Sent from the Emacs - Help forum at Nabble.com.

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

end of thread, other threads:[~2006-07-02 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-30 18:20 change working directory in emacs danielx
2006-06-30 18:53 ` Drew Adams
2006-06-30 21:27 ` Peter Dyballa
2006-06-30 21:41   ` Eli Zaretskii
     [not found] <mailman.3585.1151692923.9609.help-gnu-emacs@gnu.org>
2006-06-30 19:00 ` Maarten Bergvelt
2006-07-02 18:57   ` danielx

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).