diff options
| author | Richard M. Stallman | 2002-04-03 15:23:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-04-03 15:23:59 +0000 |
| commit | ee8107c0ea11f5b2ee4b58c25dd43e227c9665e5 (patch) | |
| tree | 97e34b47dbf93c7b9f4276a0cc6b397c03b3bdda /lisp | |
| parent | 8bd800dbd965a12d7ced4eb3172871f1f38b156e (diff) | |
| download | emacs-ee8107c0ea11f5b2ee4b58c25dd43e227c9665e5.tar.gz emacs-ee8107c0ea11f5b2ee4b58c25dd43e227c9665e5.zip | |
(shell-mode): Don't reinit comint-input-ring if that was already done.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/shell.el | 45 |
2 files changed, 28 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 60f0ce948aa..b309e920fc9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2002-04-03 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * shell.el (shell-mode): Don't reinit comint-input-ring | ||
| 4 | if that was already done. | ||
| 5 | |||
| 1 | 2002-04-03 Edward M. Reingold <reingold@emr.cs.iit.edu> | 6 | 2002-04-03 Edward M. Reingold <reingold@emr.cs.iit.edu> |
| 2 | 7 | ||
| 3 | * solar.el (solar-spring-or-summer-season): Deleted. | 8 | * solar.el (solar-spring-or-summer-season): Deleted. |
diff --git a/lisp/shell.el b/lisp/shell.el index 5ff107bb8c2..fb427aa9f72 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -415,28 +415,29 @@ buffer." | |||
| 415 | (make-local-variable 'list-buffers-directory) | 415 | (make-local-variable 'list-buffers-directory) |
| 416 | (setq list-buffers-directory (expand-file-name default-directory)) | 416 | (setq list-buffers-directory (expand-file-name default-directory)) |
| 417 | ;; shell-dependent assignments. | 417 | ;; shell-dependent assignments. |
| 418 | (let ((shell (file-name-nondirectory (car | 418 | (unless comint-input-ring |
| 419 | (process-command (get-buffer-process (current-buffer))))))) | 419 | (let ((shell (file-name-nondirectory (car |
| 420 | (setq comint-input-ring-file-name | 420 | (process-command (get-buffer-process (current-buffer))))))) |
| 421 | (or (getenv "HISTFILE") | 421 | (setq comint-input-ring-file-name |
| 422 | (cond ((string-equal shell "bash") "~/.bash_history") | 422 | (or (getenv "HISTFILE") |
| 423 | ((string-equal shell "ksh") "~/.sh_history") | 423 | (cond ((string-equal shell "bash") "~/.bash_history") |
| 424 | (t "~/.history")))) | 424 | ((string-equal shell "ksh") "~/.sh_history") |
| 425 | (if (or (equal comint-input-ring-file-name "") | 425 | (t "~/.history")))) |
| 426 | (equal (file-truename comint-input-ring-file-name) | 426 | (if (or (equal comint-input-ring-file-name "") |
| 427 | (file-truename "/dev/null"))) | 427 | (equal (file-truename comint-input-ring-file-name) |
| 428 | (setq comint-input-ring-file-name nil)) | 428 | (file-truename "/dev/null"))) |
| 429 | ;; Arrange to write out the input ring on exit, if the shell doesn't | 429 | (setq comint-input-ring-file-name nil)) |
| 430 | ;; do this itself. | 430 | ;; Arrange to write out the input ring on exit, if the shell doesn't |
| 431 | (if (and comint-input-ring-file-name | 431 | ;; do this itself. |
| 432 | (string-match shell-dumb-shell-regexp shell)) | 432 | (if (and comint-input-ring-file-name |
| 433 | (set-process-sentinel (get-buffer-process (current-buffer)) | 433 | (string-match shell-dumb-shell-regexp shell)) |
| 434 | #'shell-write-history-on-exit)) | 434 | (set-process-sentinel (get-buffer-process (current-buffer)) |
| 435 | (setq shell-dirstack-query | 435 | #'shell-write-history-on-exit)) |
| 436 | (cond ((string-equal shell "sh") "pwd") | 436 | (setq shell-dirstack-query |
| 437 | ((string-equal shell "ksh") "echo $PWD ~-") | 437 | (cond ((string-equal shell "sh") "pwd") |
| 438 | (t "dirs")))) | 438 | ((string-equal shell "ksh") "echo $PWD ~-") |
| 439 | (comint-read-input-ring t)) | 439 | (t "dirs")))) |
| 440 | (comint-read-input-ring t))) | ||
| 440 | 441 | ||
| 441 | (defun shell-write-history-on-exit (process event) | 442 | (defun shell-write-history-on-exit (process event) |
| 442 | "Called when the shell process is stopped. | 443 | "Called when the shell process is stopped. |