all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: emacs current directory when shell commands change
@ 2007-04-24  0:38 David Strozzi
  2007-04-24  8:51 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Strozzi @ 2007-04-24  0:38 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Thanks to those who gave help with this.  I still haven't reached
Nirvana though.  I'd like to use 'regular' shell mode (M-x shell),
unless some other mode is preferred for doing serious bash shelling.
I put this in my .emacs:

(setq shell-cd-regexp "cd.*")

This should make the shell think anything starting with cd is a change
dir. command.  In my .bashrc I set an alias:

alias cder='cd ~/elvis/runs'

>From shell, cder indeed works (i.e., the shell thinks I'm in the new
dir).  However, emacs always thinks I've cd'ed to ~.  The same thing
happens if I write out the full path and don't use ~ in the alias def.

So it seems emacs is interpreting all these aliases as being
equivalent to a bare 'cd', which of course moved to ~.  Maybe I
mis-understood what shell-cd-regexp does....

The functionality I want is having a bunch of 5 or 6 char aliases that
take me to some god-forsaken dirs buried in the filesystem, and I want
emacs to know where I'm going.  How do I do this?

Thanks again,
Dave

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

* Re: emacs current directory when shell commands change
  2007-04-24  0:38 emacs current directory when shell commands change David Strozzi
@ 2007-04-24  8:51 ` Peter Dyballa
  2007-04-24 11:36 ` Kai Grossjohann
  2007-04-24 11:37 ` Kai Grossjohann
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2007-04-24  8:51 UTC (permalink / raw)
  To: David Strozzi; +Cc: help-gnu-emacs


Am 24.04.2007 um 02:38 schrieb David Strozzi:

> So it seems emacs is interpreting all these aliases as being
> equivalent to a bare 'cd', which of course moved to ~.  Maybe I
> mis-understood what shell-cd-regexp does....

IMO this is the case. The variable is meant to make alias names of  
pushd or popd be the same as pushd or popd. When your alias cder is a  
cd plus an argument, a directory's name, then GNU Emacs fails: it  
sees cd – and this means: go home!

The work-around would be to have a stack of directories with you and  
you just pop the one you want to go to. (T)csh has the ~/.cshdirs  
file (or the file $dirsfile is pointing to). Bash has a very  
comfortable dirs command, but I don't see how its DIRSTACK is filled  
at startup ... by simple assignment?

--
Greetings

   Pete

To most people solutions mean finding the answers. But to chemists  
solutions
are things that are still all mixed up.

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

* Re: emacs current directory when shell commands change
  2007-04-24  0:38 emacs current directory when shell commands change David Strozzi
  2007-04-24  8:51 ` Peter Dyballa
@ 2007-04-24 11:36 ` Kai Grossjohann
  2007-04-24 11:37 ` Kai Grossjohann
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Grossjohann @ 2007-04-24 11:36 UTC (permalink / raw)
  To: help-gnu-emacs

"David Strozzi" <david.strozzi@gmail.com> writes:

> The functionality I want is having a bunch of 5 or 6 char aliases that
> take me to some god-forsaken dirs buried in the filesystem, and I want
> emacs to know where I'm going.  How do I do this?

I set environment variables and type "cd $foo".

Perhaps you could change your aliases to do "cd /some/where; pwd"?
Would that work?

There are also extensions to shell-mode that perform directory
tracking.  Perhaps if you google "Emacs shell mode directory tracking
dirtrack", you can find something.

Kai

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

* Re: emacs current directory when shell commands change
  2007-04-24  0:38 emacs current directory when shell commands change David Strozzi
  2007-04-24  8:51 ` Peter Dyballa
  2007-04-24 11:36 ` Kai Grossjohann
@ 2007-04-24 11:37 ` Kai Grossjohann
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Grossjohann @ 2007-04-24 11:37 UTC (permalink / raw)
  To: help-gnu-emacs

"David Strozzi" <david.strozzi@gmail.com> writes:

> Thanks to those who gave help with this.  I still haven't reached
> Nirvana though.  I'd like to use 'regular' shell mode (M-x shell),
> unless some other mode is preferred for doing serious bash shelling.

I am fond of M-x eshell RET, but the resulting shell is not a bash.

Is it better to be eshelling or to be bashing?  I don't know.

Kai

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

end of thread, other threads:[~2007-04-24 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-24  0:38 emacs current directory when shell commands change David Strozzi
2007-04-24  8:51 ` Peter Dyballa
2007-04-24 11:36 ` Kai Grossjohann
2007-04-24 11:37 ` Kai Grossjohann

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.