Changeset 4073 for trunk/lisp/comint.el
- Timestamp:
- 05/03/06 18:37:43 (3 years ago)
- Files:
-
- trunk (modified) (1 prop)
- trunk/lisp/comint.el (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk
- Property svn:ignore changed from
bin
to
bin
site-lisp
- Property svn:ignore changed from
trunk/lisp/comint.el
r4058 r4073 559 559 The command \\[comint-accumulate] sets this.") 560 560 561 (defvar comint-stored-incomplete-input nil 562 "Stored input for history cycling.") 563 561 564 (put 'comint-replace-by-expanded-history 'menu-enable 'comint-input-autoexpand) 562 565 (put 'comint-input-ring 'permanent-local t) … … 639 642 (make-local-variable 'comint-move-point-for-output) 640 643 (make-local-variable 'comint-scroll-show-maximum-output) 644 (make-local-variable 'comint-stored-incomplete-input) 641 645 ;; This makes it really work to keep point at the bottom. 642 646 (make-local-variable 'scroll-conservatively) … … 1016 1020 arg))) 1017 1021 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 1018 1032 (defun comint-search-start (arg) 1019 1033 "Index to start a directional search, starting at `comint-input-ring-index'." … … 1036 1050 1037 1051 (defun comint-previous-input (arg) 1038 "Cycle backwards through input history ."1052 "Cycle backwards through input history, saving input." 1039 1053 (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))) 1041 1064 1042 1065 (defun comint-next-input (arg) … … 1078 1101 n))) 1079 1102 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 1080 1111 (defun comint-previous-matching-input (regexp n) 1081 1112 "Search backwards through input history for match for REGEXP. … … 1089 1120 (if (null pos) 1090 1121 (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))) 1091 1126 (setq comint-input-ring-index pos) 1092 1127 (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) 1098 1129 (insert (ring-ref comint-input-ring pos))))) 1099 1130 … … 2673 2704 2674 2705 (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. 2676 2707 Environment variables are substituted. See `comint-word'." 2677 2708 (let ((filename (comint-word comint-file-name-chars)))
