/[emacs]/emacs/lisp/comint.el
ViewVC logotype

Diff of /emacs/lisp/comint.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.298 by monnier, Wed Jun 2 00:02:18 2004 UTC revision 1.299 by nickrob, Wed Jun 23 18:04:43 2004 UTC
# Line 571  Entry to this mode runs the hooks on `co Line 571  Entry to this mode runs the hooks on `co
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)
# Line 582  Entry to this mode runs the hooks on `co Line 582  Entry to this mode runs the hooks on `co
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]
# Line 615  Entry to this mode runs the hooks on `co Line 615  Entry to this mode runs the hooks on `co
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]
# Line 798  buffer.  The hook `comint-exec-hook' is Line 798  buffer.  The hook `comint-exec-hook' is
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))
# Line 816  buffer.  The hook `comint-exec-hook' is Line 815  buffer.  The hook `comint-exec-hook' is
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
# Line 1858  the current line with any initial string Line 1862  the current line with any initial string
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."

Legend:
Removed from v.1.298  
changed lines
  Added in v.1.299

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26