Changeset 4079 for trunk/lisp/comint.el
- Timestamp:
- 05/13/06 11:31:18 (3 years ago)
- Files:
-
- trunk/lisp/comint.el (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/comint.el
r4073 r4079 459 459 (define-key map "\C-c\C-z" 'comint-stop-subjob) 460 460 (define-key map "\C-c\C-\\" 'comint-quit-subjob) 461 (define-key map "\C-c\C-m" 'comint- insert-input)461 (define-key map "\C-c\C-m" 'comint-copy-old-input) 462 462 (define-key map "\C-c\C-o" 'comint-delete-output) 463 463 (define-key map "\C-c\C-r" 'comint-show-output) … … 503 503 '("Kill Current Input" . comint-kill-input)) 504 504 (define-key map [menu-bar inout copy-input] 505 '("Copy Old Input" . comint- insert-input))505 '("Copy Old Input" . comint-copy-old-input)) 506 506 (define-key map [menu-bar inout forward-matching-history] 507 507 '("Forward Matching Input..." . comint-forward-matching-input)) … … 798 798 proc)) 799 799 800 (defun comint-insert-input ( &optionalevent)800 (defun comint-insert-input (event) 801 801 "In a Comint buffer, set the current input to the previous input at point." 802 802 ;; This doesn't use "e" because it is supposed to work 803 803 ;; for events without parameters. 804 (interactive (list last-input-event)) 804 (interactive "e") 805 (mouse-set-point event) 805 806 (let ((pos (point))) 806 (if event (posn-set-point (event-end event))) 807 (if (not (eq (get-char-property (point) 'field) 'input)) 807 (if (not (eq (field-at-pos pos) 'input)) 808 808 ;; No input at POS, fall back to the global definition. 809 809 (let* ((keys (this-command-keys)) 810 810 (last-key (and (vectorp keys) (aref keys (1- (length keys))))) 811 811 (fun (and last-key (lookup-key global-map (vector last-key))))) 812 (goto-char pos)813 812 (and fun (call-interactively fun))) 814 (setq pos (point))815 813 ;; There's previous input at POS, insert it at the end of the buffer. 816 814 (goto-char (point-max)) … … 821 819 (point)) 822 820 ;; Insert the input at point 823 (insert (buffer-substring-no-properties 824 (previous-single-char-property-change (1+ pos) 'field) 825 (next-single-char-property-change pos 'field)))))) 821 (insert (field-string-no-properties pos))))) 826 822 827 823 … … 1902 1898 (buffer-substring-no-properties (point) (line-end-position))))) 1903 1899 1900 (defun comint-copy-old-input () 1901 "Insert after prompt old input at point as new input to be edited. 1902 Calls `comint-get-old-input' to get old input." 1903 (interactive) 1904 (let ((input (funcall comint-get-old-input)) 1905 (process (get-buffer-process (current-buffer)))) 1906 (if (not process) 1907 (error "Current buffer has no process") 1908 (goto-char (process-mark process)) 1909 (insert input)))) 1910 1904 1911 (defun comint-skip-prompt () 1905 1912 "Skip past the text matching regexp `comint-prompt-regexp'.
