# HG changeset patch # User Simon Marshall # Date 823354712 0 # Node ID 63540fa4367450c3d45f6ee717e69584b04c7d6c # Parent d08e488ceb2e91c0b4fb2f9f63cfac9b7b39423b Resync directories properly for the ksh. diff -r d08e488ceb2e -r 63540fa43674 lisp/shell.el --- a/lisp/shell.el Sat Feb 03 03:25:42 1996 +0000 +++ b/lisp/shell.el Sat Feb 03 13:38:32 1996 +0000 @@ -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 ;; Maintainer: Simon Marshall @@ -114,7 +114,7 @@ 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 @@ (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 @@ (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 @@ (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.")))))))