/[emacs]/emacs/lisp/shell.el
ViewVC logotype

Diff of /emacs/lisp/shell.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.109 by walters, Mon Mar 11 21:13:14 2002 UTC revision 1.110 by rms, Wed Apr 3 15:23:41 2002 UTC
# Line 415  buffer." Line 415  buffer."
415    (make-local-variable 'list-buffers-directory)    (make-local-variable 'list-buffers-directory)
416    (setq list-buffers-directory (expand-file-name default-directory))    (setq list-buffers-directory (expand-file-name default-directory))
417    ;; shell-dependent assignments.    ;; shell-dependent assignments.
418    (let ((shell (file-name-nondirectory (car    (unless comint-input-ring
419                   (process-command (get-buffer-process (current-buffer)))))))      (let ((shell (file-name-nondirectory (car
420      (setq comint-input-ring-file-name                     (process-command (get-buffer-process (current-buffer)))))))
421            (or (getenv "HISTFILE")        (setq comint-input-ring-file-name
422                (cond ((string-equal shell "bash") "~/.bash_history")              (or (getenv "HISTFILE")
423                      ((string-equal shell "ksh") "~/.sh_history")                  (cond ((string-equal shell "bash") "~/.bash_history")
424                      (t "~/.history"))))                        ((string-equal shell "ksh") "~/.sh_history")
425      (if (or (equal comint-input-ring-file-name "")                        (t "~/.history"))))
426              (equal (file-truename comint-input-ring-file-name)        (if (or (equal comint-input-ring-file-name "")
427                     (file-truename "/dev/null")))                (equal (file-truename comint-input-ring-file-name)
428          (setq comint-input-ring-file-name nil))                       (file-truename "/dev/null")))
429      ;; Arrange to write out the input ring on exit, if the shell doesn't            (setq comint-input-ring-file-name nil))
430      ;; do this itself.        ;; Arrange to write out the input ring on exit, if the shell doesn't
431      (if (and comint-input-ring-file-name        ;; do this itself.
432               (string-match shell-dumb-shell-regexp shell))        (if (and comint-input-ring-file-name
433          (set-process-sentinel (get-buffer-process (current-buffer))                 (string-match shell-dumb-shell-regexp shell))
434                                #'shell-write-history-on-exit))            (set-process-sentinel (get-buffer-process (current-buffer))
435      (setq shell-dirstack-query                                  #'shell-write-history-on-exit))
436            (cond ((string-equal shell "sh") "pwd")        (setq shell-dirstack-query
437                  ((string-equal shell "ksh") "echo $PWD ~-")              (cond ((string-equal shell "sh") "pwd")
438                  (t "dirs"))))                    ((string-equal shell "ksh") "echo $PWD ~-")
439    (comint-read-input-ring t))                    (t "dirs"))))
440        (comint-read-input-ring t)))
441    
442  (defun shell-write-history-on-exit (process event)  (defun shell-write-history-on-exit (process event)
443    "Called when the shell process is stopped.    "Called when the shell process is stopped.

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26