(defun my-shell-mode () (interactive) (shell) (process-kill-without-query (get-process "shell")) (if (emacs-version-compare 19 27 '<) (my-shell-bindings-old) (progn (my-shell-bindings) (setq comint-output-filter-functions (append comint-output-filter-functions (list 'shell-strip-ctrl-m))) (setq comint-process-echoes t) (setq comint-prompt-regexp (concat (getenv "HOSTNAME") "-gfisher\\[[0-9]*\\]: ")) ) ) ) (defun my-shell-bindings () (interactive) ; (message "in my-shell-bindings") (message (concat "buffer name =" (buffer-name))) (local-unset-key "n") (local-unset-key "p") (local-unset-key " ") (local-set-key "" 'comint-next-input) (local-set-key "" 'comint-previous-input) ) (defun my-shell-bindings-old () (interactive) ; (message "in my-shell-bindings") ; (message (concat "buffer name =" (buffer-name))) (load "kshell.el") (local-unset-key "n") (local-unset-key "p") (local-set-key "" 'shell-next-command) (local-set-key "" 'shell-previous-command) (local-set-key " " 'shell-filename-expand) (local-set-key "" 'shell-beginning-of-line) ; (setq comint-prompt-regexp "phoenix-gfisher\\[[0-9]*\\]: ") ) (defun my-shell-mode-file () (interactive) (switch-to-buffer "*shell*") (insert-file "shell") (kill-buffer "shell") (write-file "shell") (end-of-buffer) (shell) (set-mark (point)) )