-(if comint-mode-map
- nil
- ;; Keys:
- (setq comint-mode-map (make-sparse-keymap))
- (define-key comint-mode-map "\ep" 'comint-previous-input)
- (define-key comint-mode-map "\en" 'comint-next-input)
- (define-key comint-mode-map [C-up] 'comint-previous-input)
- (define-key comint-mode-map [C-down] 'comint-next-input)
- (define-key comint-mode-map "\er" 'comint-previous-matching-input)
- (define-key comint-mode-map "\es" 'comint-next-matching-input)
- (define-key comint-mode-map [?\C-c ?\M-r] 'comint-previous-matching-input-from-input)
- (define-key comint-mode-map [?\C-c ?\M-s] 'comint-next-matching-input-from-input)
- (define-key comint-mode-map "\e\C-l" 'comint-show-output)
- (define-key comint-mode-map "\C-m" 'comint-send-input)
- (define-key comint-mode-map "\C-d" 'comint-delchar-or-maybe-eof)
- (define-key comint-mode-map "\C-c " 'comint-accumulate)
- (define-key comint-mode-map "\C-c\C-x" 'comint-get-next-from-history)
- (define-key comint-mode-map "\C-c\C-a" 'comint-bol-or-process-mark)
- (define-key comint-mode-map "\C-c\C-u" 'comint-kill-input)
- (define-key comint-mode-map "\C-c\C-w" 'backward-kill-word)
- (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob)
- (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob)
- (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob)
- (define-key comint-mode-map "\C-c\C-m" 'comint-copy-old-input)
- (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output)
- (define-key comint-mode-map "\C-c\C-r" 'comint-show-output)
- (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output)
- (define-key comint-mode-map "\C-c\C-l" 'comint-dynamic-list-input-ring)
- (define-key comint-mode-map "\C-c\C-n" 'comint-next-prompt)
- (define-key comint-mode-map "\C-c\C-p" 'comint-previous-prompt)
- (define-key comint-mode-map "\C-c\C-d" 'comint-send-eof)
- (define-key comint-mode-map "\C-c\C-s" 'comint-write-output)
- (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument)
- ;; Mouse Buttons:
- (define-key comint-mode-map [mouse-2] 'comint-insert-clicked-input)
- ;; Menu bars:
- ;; completion:
- (define-key comint-mode-map [menu-bar completion]
- (cons "Complete" (make-sparse-keymap "Complete")))
- (define-key comint-mode-map [menu-bar completion complete-expand]
- '("Expand File Name" . comint-replace-by-expanded-filename))
- (define-key comint-mode-map [menu-bar completion complete-listing]
- '("File Completion Listing" . comint-dynamic-list-filename-completions))
- (define-key comint-mode-map [menu-bar completion complete-file]
- '("Complete File Name" . comint-dynamic-complete-filename))
- (define-key comint-mode-map [menu-bar completion complete]
- '("Complete Before Point" . comint-dynamic-complete))
- ;; Input history:
- (define-key comint-mode-map [menu-bar inout]
- (cons "In/Out" (make-sparse-keymap "In/Out")))
- (define-key comint-mode-map [menu-bar inout delete-output]
- '("Delete Current Output Group" . comint-delete-output))
- (define-key comint-mode-map [menu-bar inout append-output-to-file]
- '("Append Current Output Group to File" . comint-append-output-to-file))
- (define-key comint-mode-map [menu-bar inout write-output]
- '("Write Current Output Group to File" . comint-write-output))
- (define-key comint-mode-map [menu-bar inout next-prompt]
- '("Forward Output Group" . comint-next-prompt))
- (define-key comint-mode-map [menu-bar inout previous-prompt]
- '("Backward Output Group" . comint-previous-prompt))
- (define-key comint-mode-map [menu-bar inout show-maximum-output]
- '("Show Maximum Output" . comint-show-maximum-output))
- (define-key comint-mode-map [menu-bar inout show-output]
- '("Show Current Output Group" . comint-show-output))
- (define-key comint-mode-map [menu-bar inout kill-input]
- '("Kill Current Input" . comint-kill-input))
- (define-key comint-mode-map [menu-bar inout copy-input]
- '("Copy Old Input" . comint-copy-old-input))
- (define-key comint-mode-map [menu-bar inout forward-matching-history]
- '("Forward Matching Input..." . comint-forward-matching-input))
- (define-key comint-mode-map [menu-bar inout backward-matching-history]
- '("Backward Matching Input..." . comint-backward-matching-input))
- (define-key comint-mode-map [menu-bar inout next-matching-history]
- '("Next Matching Input..." . comint-next-matching-input))
- (define-key comint-mode-map [menu-bar inout previous-matching-history]
- '("Previous Matching Input..." . comint-previous-matching-input))
- (define-key comint-mode-map [menu-bar inout next-matching-history-from-input]
- '("Next Matching Current Input" . comint-next-matching-input-from-input))
- (define-key comint-mode-map [menu-bar inout previous-matching-history-from-input]
- '("Previous Matching Current Input" . comint-previous-matching-input-from-input))
- (define-key comint-mode-map [menu-bar inout next-history]
- '("Next Input" . comint-next-input))
- (define-key comint-mode-map [menu-bar inout previous-history]
- '("Previous Input" . comint-previous-input))
- (define-key comint-mode-map [menu-bar inout list-history]
- '("List Input History" . comint-dynamic-list-input-ring))
- (define-key comint-mode-map [menu-bar inout expand-history]
- '("Expand History Before Point" . comint-replace-by-expanded-history))
- ;; Signals
- (define-key comint-mode-map [menu-bar signals]
- (cons "Signals" (make-sparse-keymap "Signals")))
- (define-key comint-mode-map [menu-bar signals eof]
- '("EOF" . comint-send-eof))
- (define-key comint-mode-map [menu-bar signals kill]
- '("KILL" . comint-kill-subjob))
- (define-key comint-mode-map [menu-bar signals quit]
- '("QUIT" . comint-quit-subjob))
- (define-key comint-mode-map [menu-bar signals cont]
- '("CONT" . comint-continue-subjob))
- (define-key comint-mode-map [menu-bar signals stop]
- '("STOP" . comint-stop-subjob))
- (define-key comint-mode-map [menu-bar signals break]
- '("BREAK" . comint-interrupt-subjob))
- ;; Put them in the menu bar:
- (setq menu-bar-final-items (append '(completion inout signals)
- menu-bar-final-items))
- )
-