Show
Ignore:
Timestamp:
05/03/06 18:37:43 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk

    • Property svn:ignore changed from
      bin
      to
      bin
      site-lisp
  • trunk/lisp/comint.el

    r4058 r4073  
    559559The command \\[comint-accumulate] sets this.") 
    560560 
     561(defvar comint-stored-incomplete-input nil 
     562  "Stored input for history cycling.") 
     563 
    561564(put 'comint-replace-by-expanded-history 'menu-enable 'comint-input-autoexpand) 
    562565(put 'comint-input-ring 'permanent-local t) 
     
    639642  (make-local-variable 'comint-move-point-for-output) 
    640643  (make-local-variable 'comint-scroll-show-maximum-output) 
     644  (make-local-variable 'comint-stored-incomplete-input) 
    641645  ;; This makes it really work to keep point at the bottom. 
    642646  (make-local-variable 'scroll-conservatively) 
     
    10161020         arg))) 
    10171021 
     1022(defun comint-restore-input () 
     1023  "Restore unfinished input." 
     1024  (interactive) 
     1025  (when comint-input-ring-index 
     1026    (comint-delete-input) 
     1027    (when (> (length comint-stored-incomplete-input) 0) 
     1028      (insert comint-stored-incomplete-input) 
     1029      (message "Input restored")) 
     1030    (setq comint-input-ring-index nil))) 
     1031 
    10181032(defun comint-search-start (arg) 
    10191033  "Index to start a directional search, starting at `comint-input-ring-index'." 
     
    10361050 
    10371051(defun comint-previous-input (arg) 
    1038   "Cycle backwards through input history." 
     1052  "Cycle backwards through input history, saving input." 
    10391053  (interactive "*p") 
    1040   (comint-previous-matching-input "." arg)) 
     1054  (if (and comint-input-ring-index  
     1055           (or                 ;; leaving the "end" of the ring 
     1056            (and (< arg 0)              ; going down 
     1057                 (eq comint-input-ring-index 0)) 
     1058            (and (> arg 0)              ; going up 
     1059                 (eq comint-input-ring-index  
     1060                     (1- (ring-length comint-input-ring))))) 
     1061           comint-stored-incomplete-input) 
     1062      (comint-restore-input) 
     1063    (comint-previous-matching-input "." arg))) 
    10411064 
    10421065(defun comint-next-input (arg) 
     
    10781101        n))) 
    10791102 
     1103(defun comint-delete-input () 
     1104  "Delete all input between accumulation or process mark and point." 
     1105  (delete-region 
     1106   ;; Can't use kill-region as it sets this-command 
     1107   (or  (marker-position comint-accum-marker) 
     1108        (process-mark (get-buffer-process (current-buffer)))) 
     1109   (point-max))) 
     1110 
    10801111(defun comint-previous-matching-input (regexp n) 
    10811112  "Search backwards through input history for match for REGEXP. 
     
    10891120    (if (null pos) 
    10901121        (error "Not found") 
     1122      ;; If leaving the edit line, save partial input 
     1123      (if (null comint-input-ring-index)        ;not yet on ring 
     1124          (setq comint-stored-incomplete-input 
     1125                (funcall comint-get-old-input))) 
    10911126      (setq comint-input-ring-index pos) 
    10921127      (message "History item: %d" (1+ pos)) 
    1093       (delete-region 
    1094        ;; Can't use kill-region as it sets this-command 
    1095        (or  (marker-position comint-accum-marker) 
    1096             (process-mark (get-buffer-process (current-buffer)))) 
    1097        (point)) 
     1128      (comint-delete-input) 
    10981129      (insert (ring-ref comint-input-ring pos))))) 
    10991130 
     
    26732704 
    26742705(defun comint-match-partial-filename () 
    2675   "Return the filename at point, or nil if non is found. 
     2706  "Return the filename at point, or nil if none is found. 
    26762707Environment variables are substituted.  See `comint-word'." 
    26772708  (let ((filename (comint-word comint-file-name-chars)))