summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorSimon Marshall <simon@gnu.org>1996-02-03 13:38:32 +0000
committerSimon Marshall <simon@gnu.org>1996-02-03 13:38:32 +0000
commitcb911783e6b9c227faaa74f95560e722a21f83c9 (patch)
tree7a0aaaeb865aaf41935c2534002fddaf5f095953 /lisp/shell.el
parent2e49643d42ccedcb7c588ae810e027d854c6c85e (diff)
downloademacs-cb911783e6b9c227faaa74f95560e722a21f83c9.tar.gz
Resync directories properly for the ksh.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 06a7293af4a..36051003624 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -1,6 +1,6 @@
;;; shell.el --- specialized comint.el for running the shell.
-;; Copyright (C) 1988, 1993, 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
;; Author: Olin Shivers <shivers@cs.cmu.edu>
;; Maintainer: Simon Marshall <simon@gnu.ai.mit.edu>
@@ -114,7 +114,7 @@ This variable is used to initialise `comint-prompt-regexp' in the
shell buffer.
The pattern should probably not match more than one line. If it does,
-shell-mode may become confused trying to distinguish prompt from input
+Shell mode may become confused trying to distinguish prompt from input
on lines which don't start with a prompt.
This is a fine thing to set in your `.emacs' file.")
@@ -341,7 +341,9 @@ buffer."
(equal (file-truename comint-input-ring-file-name) "/dev/null"))
(setq comint-input-ring-file-name nil))
(setq shell-dirstack-query
- (if (string-match "^k?sh$" shell) "pwd" "dirs")))
+ (cond ((string-equal shell "sh") "pwd")
+ ((string-equal shell "ksh") "echo $PWD ~-")
+ (t "dirs"))))
(run-hooks 'shell-mode-hook)
(comint-read-input-ring t))
@@ -516,8 +518,7 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(shell-dirstack
(let ((old default-directory))
(shell-cd (car shell-dirstack))
- (setq shell-dirstack
- (cons old (cdr shell-dirstack)))
+ (setq shell-dirstack (cons old (cdr shell-dirstack)))
(shell-dirstack-message)))
(t
(message "Directory stack empty."))))
@@ -617,7 +618,8 @@ command again."
(let ((ds (nreverse ds)))
(condition-case nil
(progn (shell-cd (car ds))
- (setq shell-dirstack (cdr ds))
+ (setq shell-dirstack (cdr ds)
+ shell-last-dir (car shell-dirstack))
(shell-dirstack-message))
(error (message "Couldn't cd.")))))))