Show
Ignore:
Timestamp:
05/13/06 11:31:18 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/comint.el

    r4073 r4079  
    459459    (define-key map "\C-c\C-z"    'comint-stop-subjob) 
    460460    (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) 
    462462    (define-key map "\C-c\C-o"    'comint-delete-output) 
    463463    (define-key map "\C-c\C-r"    'comint-show-output) 
     
    503503      '("Kill Current Input" . comint-kill-input)) 
    504504    (define-key map [menu-bar inout copy-input] 
    505       '("Copy Old Input" . comint-insert-input)) 
     505      '("Copy Old Input" . comint-copy-old-input)) 
    506506    (define-key map [menu-bar inout forward-matching-history] 
    507507      '("Forward Matching Input..." . comint-forward-matching-input)) 
     
    798798    proc)) 
    799799 
    800 (defun comint-insert-input (&optional event) 
     800(defun comint-insert-input (event) 
    801801  "In a Comint buffer, set the current input to the previous input at point." 
    802802  ;; This doesn't use "e" because it is supposed to work 
    803803  ;; for events without parameters. 
    804   (interactive (list last-input-event)) 
     804  (interactive "e") 
     805  (mouse-set-point event) 
    805806  (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)) 
    808808        ;; No input at POS, fall back to the global definition. 
    809809        (let* ((keys (this-command-keys)) 
    810810               (last-key (and (vectorp keys) (aref keys (1- (length keys))))) 
    811811               (fun (and last-key (lookup-key global-map (vector last-key))))) 
    812           (goto-char pos) 
    813812          (and fun (call-interactively fun))) 
    814       (setq pos (point)) 
    815813      ;; There's previous input at POS, insert it at the end of the buffer. 
    816814      (goto-char (point-max)) 
     
    821819       (point)) 
    822820      ;; 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))))) 
    826822 
    827823  
     
    19021898      (buffer-substring-no-properties (point) (line-end-position))))) 
    19031899 
     1900(defun comint-copy-old-input () 
     1901  "Insert after prompt old input at point as new input to be edited. 
     1902Calls `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 
    19041911(defun comint-skip-prompt () 
    19051912  "Skip past the text matching regexp `comint-prompt-regexp'.