[comp.emacs] View mode and Shell questions: summary

sull@biocat.chem.usu.edu (Sullivan Beck) (06/04/90)

A few days ago, I asked a couple of questions (unfortunately I deleted
the original file so I can't quote myself exactly.

> In view-mode, ocasionally it sets the goal-column to zero.  Is there
> a fix for this?

I got some replies, but my question is still unanswered.  By the way, I
am running Emacs 18.55 on a Sun 4 with SunOS 4.0.3.

> Finally, in *shell*, if I type 'cd a' it automatically sets the default
> path to './a' but if I type a (alias a cd a) it leaves the default
> path set to '.'.  Has anyone written an extended shell.el which watches
> for this?  If so, I'd really like to get a copy.

Thanks to David Eckelkamp, I have been able to figure this one out.  There
is a way to alias the cd command.  Just add the command in .emacs
   (setq shell-cd-regexp "cd\\|sd")
or something like that.  Then, any time you type 'cd' or 'sd', it will set
the default path.

The problem is, it expects the path to be passed as a parameter IN THE SAME
LINE.  So if you have sd aliased to 'cd foo' for example, typing 'sd' in
the *shell* will put you in the foo directory but will set your default
path to ~/ since you didn't put a path in the line.  Basically, the only
thing this is good for is to alias the basic 'cd' command.  Also, the alias
can be at most 3 letters long since shell.el checks over 3 spaces in the
line to see what the new path is.  So, if you put in your .emacs file
   (setq shell-cd-regexp "cd\\|longcd")
and had longcd aliased to cd and then typed 'longcd foo' in the *shell*,
it would put you in the foo directory but would leave your path unchanged
since you don't have a path "gcd foo" in your directory.

Anyway, as far as I can tell, the only way I'm going to be able to
make this work is to rewrite the shell.el command where this happens
and instead of checking for arguments only on the command line, it will
check for the arguments in the .chsrc file.  I think I will eventually
get around to doing it, but it is low priority right now.

Thanks for all you help.

S. Beck

  sull@biocat.chem.usu.edu
  slz7p@cc.usu.edu (slz7p@usu.bitnet)