571 |
(define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) |
(define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) |
572 |
(define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) |
(define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) |
573 |
(define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) |
(define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) |
574 |
(define-key comint-mode-map "\C-c\C-m" 'comint-copy-old-input) |
(define-key comint-mode-map "\C-c\C-m" 'comint-insert-input) |
575 |
(define-key comint-mode-map "\C-c\C-o" 'comint-delete-output) |
(define-key comint-mode-map "\C-c\C-o" 'comint-delete-output) |
576 |
(define-key comint-mode-map "\C-c\C-r" 'comint-show-output) |
(define-key comint-mode-map "\C-c\C-r" 'comint-show-output) |
577 |
(define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) |
(define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) |
582 |
(define-key comint-mode-map "\C-c\C-s" 'comint-write-output) |
(define-key comint-mode-map "\C-c\C-s" 'comint-write-output) |
583 |
(define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) |
(define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) |
584 |
;; Mouse Buttons: |
;; Mouse Buttons: |
585 |
(define-key comint-mode-map [mouse-2] 'comint-insert-clicked-input) |
(define-key comint-mode-map [mouse-2] 'comint-mouse-insert-input) |
586 |
;; Menu bars: |
;; Menu bars: |
587 |
;; completion: |
;; completion: |
588 |
(define-key comint-mode-map [menu-bar completion] |
(define-key comint-mode-map [menu-bar completion] |
615 |
(define-key comint-mode-map [menu-bar inout kill-input] |
(define-key comint-mode-map [menu-bar inout kill-input] |
616 |
'("Kill Current Input" . comint-kill-input)) |
'("Kill Current Input" . comint-kill-input)) |
617 |
(define-key comint-mode-map [menu-bar inout copy-input] |
(define-key comint-mode-map [menu-bar inout copy-input] |
618 |
'("Copy Old Input" . comint-copy-old-input)) |
'("Copy Old Input" . comint-insert-input)) |
619 |
(define-key comint-mode-map [menu-bar inout forward-matching-history] |
(define-key comint-mode-map [menu-bar inout forward-matching-history] |
620 |
'("Forward Matching Input..." . comint-forward-matching-input)) |
'("Forward Matching Input..." . comint-forward-matching-input)) |
621 |
(define-key comint-mode-map [menu-bar inout backward-matching-history] |
(define-key comint-mode-map [menu-bar inout backward-matching-history] |
798 |
(set-process-coding-system proc decoding encoding)) |
(set-process-coding-system proc decoding encoding)) |
799 |
proc)) |
proc)) |
800 |
|
|
801 |
|
(defun comint-insert-input () |
802 |
(defun comint-insert-clicked-input (event) |
"In a Comint buffer, set the current input to the previous input at point." |
803 |
"In a Comint buffer, set the current input to the clicked-on previous input." |
(interactive) |
804 |
(interactive "e") |
(let ((pos (point))) |
|
(let ((pos (posn-point (event-end event)))) |
|
805 |
(if (not (eq (get-char-property pos 'field) 'input)) |
(if (not (eq (get-char-property pos 'field) 'input)) |
806 |
;; No input at POS, fall back to the global definition. |
;; No input at POS, fall back to the global definition. |
807 |
(let* ((keys (this-command-keys)) |
(let* ((keys (this-command-keys)) |
815 |
(or (marker-position comint-accum-marker) |
(or (marker-position comint-accum-marker) |
816 |
(process-mark (get-buffer-process (current-buffer)))) |
(process-mark (get-buffer-process (current-buffer)))) |
817 |
(point)) |
(point)) |
818 |
;; Insert the clicked-upon input |
;; Insert the input at point |
819 |
(insert (buffer-substring-no-properties |
(insert (buffer-substring-no-properties |
820 |
(previous-single-char-property-change (1+ pos) 'field) |
(previous-single-char-property-change (1+ pos) 'field) |
821 |
(next-single-char-property-change pos 'field)))))) |
(next-single-char-property-change pos 'field)))))) |
822 |
|
|
823 |
|
(defun comint-mouse-insert-input (event) |
824 |
|
"In a Comint buffer, set the current input to the previous input you click on." |
825 |
|
(interactive "e") |
826 |
|
(mouse-set-point event) |
827 |
|
(comint-insert-input)) |
828 |
|
|
829 |
|
|
830 |
;; Input history processing in a buffer |
;; Input history processing in a buffer |
1862 |
(comint-bol) |
(comint-bol) |
1863 |
(buffer-substring-no-properties (point) (line-end-position))))) |
(buffer-substring-no-properties (point) (line-end-position))))) |
1864 |
|
|
|
(defun comint-copy-old-input () |
|
|
"Insert after prompt old input at point as new input to be edited. |
|
|
Calls `comint-get-old-input' to get old input." |
|
|
(interactive) |
|
|
(let ((input (funcall comint-get-old-input)) |
|
|
(process (get-buffer-process (current-buffer)))) |
|
|
(if (not process) |
|
|
(error "Current buffer has no process") |
|
|
(goto-char (process-mark process)) |
|
|
(insert input)))) |
|
|
|
|
1865 |
(defun comint-skip-prompt () |
(defun comint-skip-prompt () |
1866 |
"Skip past the text matching regexp `comint-prompt-regexp'. |
"Skip past the text matching regexp `comint-prompt-regexp'. |
1867 |
If this takes us past the end of the current line, don't skip at all." |
If this takes us past the end of the current line, don't skip at all." |