diff options
| author | Nick Roberts | 2004-06-23 18:04:43 +0000 |
|---|---|---|
| committer | Nick Roberts | 2004-06-23 18:04:43 +0000 |
| commit | 13abd69ff9c2407be2b5258f4ddcefff7af1b1a3 (patch) | |
| tree | aa4ec7d0e52a9f878b6ddc62977180f5c2e212f4 | |
| parent | dce417e7f7508860125b3dcd3ed83fed99df03da (diff) | |
| download | emacs-13abd69ff9c2407be2b5258f4ddcefff7af1b1a3.tar.gz emacs-13abd69ff9c2407be2b5258f4ddcefff7af1b1a3.zip | |
(comint-insert-clicked-input, comint-copy-old-input):
Remove.
(comint-insert-input, comint-mouse-insert-input): New functions
based on comint-insert-clicked-input for two bindings but just
one functionality.
| -rw-r--r-- | lisp/comint.el | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 12d8e1fcbb7..8b5a107c7d7 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -571,7 +571,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 571 | (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) | 571 | (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) | 572 | (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) |
| 573 | (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) | 573 | (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) | 574 | (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) | 575 | (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) | 576 | (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) | 577 | (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) |
| @@ -582,7 +582,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 582 | (define-key comint-mode-map "\C-c\C-s" 'comint-write-output) | 582 | (define-key comint-mode-map "\C-c\C-s" 'comint-write-output) |
| 583 | (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) | 583 | (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) |
| 584 | ;; Mouse Buttons: | 584 | ;; Mouse Buttons: |
| 585 | (define-key comint-mode-map [mouse-2] 'comint-insert-clicked-input) | 585 | (define-key comint-mode-map [mouse-2] 'comint-mouse-insert-input) |
| 586 | ;; Menu bars: | 586 | ;; Menu bars: |
| 587 | ;; completion: | 587 | ;; completion: |
| 588 | (define-key comint-mode-map [menu-bar completion] | 588 | (define-key comint-mode-map [menu-bar completion] |
| @@ -615,7 +615,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'." | |||
| 615 | (define-key comint-mode-map [menu-bar inout kill-input] | 615 | (define-key comint-mode-map [menu-bar inout kill-input] |
| 616 | '("Kill Current Input" . comint-kill-input)) | 616 | '("Kill Current Input" . comint-kill-input)) |
| 617 | (define-key comint-mode-map [menu-bar inout copy-input] | 617 | (define-key comint-mode-map [menu-bar inout copy-input] |
| 618 | '("Copy Old Input" . comint-copy-old-input)) | 618 | '("Copy Old Input" . comint-insert-input)) |
| 619 | (define-key comint-mode-map [menu-bar inout forward-matching-history] | 619 | (define-key comint-mode-map [menu-bar inout forward-matching-history] |
| 620 | '("Forward Matching Input..." . comint-forward-matching-input)) | 620 | '("Forward Matching Input..." . comint-forward-matching-input)) |
| 621 | (define-key comint-mode-map [menu-bar inout backward-matching-history] | 621 | (define-key comint-mode-map [menu-bar inout backward-matching-history] |
| @@ -798,11 +798,10 @@ buffer. The hook `comint-exec-hook' is run after each exec." | |||
| 798 | (set-process-coding-system proc decoding encoding)) | 798 | (set-process-coding-system proc decoding encoding)) |
| 799 | proc)) | 799 | proc)) |
| 800 | 800 | ||
| 801 | 801 | (defun comint-insert-input () | |
| 802 | (defun comint-insert-clicked-input (event) | 802 | "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." | 803 | (interactive) |
| 804 | (interactive "e") | 804 | (let ((pos (point))) |
| 805 | (let ((pos (posn-point (event-end event)))) | ||
| 806 | (if (not (eq (get-char-property pos 'field) 'input)) | 805 | (if (not (eq (get-char-property pos 'field) 'input)) |
| 807 | ;; No input at POS, fall back to the global definition. | 806 | ;; No input at POS, fall back to the global definition. |
| 808 | (let* ((keys (this-command-keys)) | 807 | (let* ((keys (this-command-keys)) |
| @@ -816,11 +815,16 @@ buffer. The hook `comint-exec-hook' is run after each exec." | |||
| 816 | (or (marker-position comint-accum-marker) | 815 | (or (marker-position comint-accum-marker) |
| 817 | (process-mark (get-buffer-process (current-buffer)))) | 816 | (process-mark (get-buffer-process (current-buffer)))) |
| 818 | (point)) | 817 | (point)) |
| 819 | ;; Insert the clicked-upon input | 818 | ;; Insert the input at point |
| 820 | (insert (buffer-substring-no-properties | 819 | (insert (buffer-substring-no-properties |
| 821 | (previous-single-char-property-change (1+ pos) 'field) | 820 | (previous-single-char-property-change (1+ pos) 'field) |
| 822 | (next-single-char-property-change pos 'field)))))) | 821 | (next-single-char-property-change pos 'field)))))) |
| 823 | 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)) | ||
| 824 | 828 | ||
| 825 | 829 | ||
| 826 | ;; Input history processing in a buffer | 830 | ;; Input history processing in a buffer |
| @@ -1858,17 +1862,6 @@ the current line with any initial string matching the regexp | |||
| 1858 | (comint-bol) | 1862 | (comint-bol) |
| 1859 | (buffer-substring-no-properties (point) (line-end-position))))) | 1863 | (buffer-substring-no-properties (point) (line-end-position))))) |
| 1860 | 1864 | ||
| 1861 | (defun comint-copy-old-input () | ||
| 1862 | "Insert after prompt old input at point as new input to be edited. | ||
| 1863 | Calls `comint-get-old-input' to get old input." | ||
| 1864 | (interactive) | ||
| 1865 | (let ((input (funcall comint-get-old-input)) | ||
| 1866 | (process (get-buffer-process (current-buffer)))) | ||
| 1867 | (if (not process) | ||
| 1868 | (error "Current buffer has no process") | ||
| 1869 | (goto-char (process-mark process)) | ||
| 1870 | (insert input)))) | ||
| 1871 | |||
| 1872 | (defun comint-skip-prompt () | 1865 | (defun comint-skip-prompt () |
| 1873 | "Skip past the text matching regexp `comint-prompt-regexp'. | 1866 | "Skip past the text matching regexp `comint-prompt-regexp'. |
| 1874 | If this takes us past the end of the current line, don't skip at all." | 1867 | If this takes us past the end of the current line, don't skip at all." |