Mercurial > hg > xemacs-beta
comparison lisp/prim/isearch-mode.el @ 197:acd284d43ca1 r20-3b25
Import from CVS: tag r20-3b25
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:00:02 +0200 |
parents | f53b5ca2e663 |
children |
comparison
equal
deleted
inserted
replaced
196:58e0786448ca | 197:acd284d43ca1 |
---|---|
201 ;; Several non-printing chars change the searching behavior. | 201 ;; Several non-printing chars change the searching behavior. |
202 ;; | 202 ;; |
203 (define-key map "\C-s" 'isearch-repeat-forward) | 203 (define-key map "\C-s" 'isearch-repeat-forward) |
204 (define-key map "\M-\C-s" 'isearch-repeat-forward) | 204 (define-key map "\M-\C-s" 'isearch-repeat-forward) |
205 (define-key map "\C-r" 'isearch-repeat-backward) | 205 (define-key map "\C-r" 'isearch-repeat-backward) |
206 (define-key map "\177" 'isearch-delete-char) | |
207 (define-key map "\C-g" 'isearch-abort) | 206 (define-key map "\C-g" 'isearch-abort) |
208 | 207 |
209 (define-key map "\C-q" 'isearch-quote-char) | 208 (define-key map "\C-q" 'isearch-quote-char) |
210 | 209 |
211 (define-key map "\C-m" 'isearch-exit) | 210 (define-key map "\C-m" 'isearch-exit) |
224 ;; Some bindings you may want to put in your isearch-mode-hook. | 223 ;; Some bindings you may want to put in your isearch-mode-hook. |
225 ;; Suggest some alternates... | 224 ;; Suggest some alternates... |
226 ;; (define-key map "\C-t" 'isearch-toggle-regexp) | 225 ;; (define-key map "\C-t" 'isearch-toggle-regexp) |
227 ;; (define-key map "\C-^" 'isearch-edit-string) | 226 ;; (define-key map "\C-^" 'isearch-edit-string) |
228 | 227 |
229 ;; backspace deletes, but C-h is help. | 228 ;; delete and backspace delete backward, f1 is help, and C-h can be either |
229 (define-key map 'delete 'isearch-delete-char) | |
230 (define-key map 'backspace 'isearch-delete-char) | 230 (define-key map 'backspace 'isearch-delete-char) |
231 (define-key map '(control h) 'isearch-mode-help) | 231 (define-key map '(control h) 'isearch-help-or-delete-char) |
232 (define-key map 'f1 'isearch-mode-help) | |
233 (define-key map 'help 'isearch-mode-help) | |
232 | 234 |
233 (define-key map "\M-n" 'isearch-ring-advance) | 235 (define-key map "\M-n" 'isearch-ring-advance) |
234 (define-key map "\M-p" 'isearch-ring-retreat) | 236 (define-key map "\M-p" 'isearch-ring-retreat) |
235 (define-key map "\M- " 'isearch-whitespace-chars) | 237 (define-key map "\M- " 'isearch-whitespace-chars) |
236 (define-key map "\M-\t" 'isearch-complete) | 238 (define-key map "\M-\t" 'isearch-complete) |
617 item in the search ring. | 619 item in the search ring. |
618 \\[isearch-ring-retreat-edit] to replace the search string with the next\ | 620 \\[isearch-ring-retreat-edit] to replace the search string with the next\ |
619 item in the search ring. | 621 item in the search ring. |
620 \\[isearch-complete-edit] to complete the search string from the search ring." | 622 \\[isearch-complete-edit] to complete the search string from the search ring." |
621 | 623 |
622 ;; Editing doesnt back up the search point. Should it? | 624 ;; Editing doesn't back up the search point. Should it? |
623 (interactive) | 625 (interactive) |
624 | 626 |
625 (condition-case nil | 627 (condition-case nil |
626 (let ((minibuffer-local-map minibuffer-local-isearch-map) | 628 (let ((minibuffer-local-map minibuffer-local-isearch-map) |
627 isearch-nonincremental ; should search nonincrementally? | 629 isearch-nonincremental ; should search nonincrementally? |
849 (if (null (cdr isearch-cmds)) | 851 (if (null (cdr isearch-cmds)) |
850 (ding nil 'isearch-quit) | 852 (ding nil 'isearch-quit) |
851 (isearch-pop-state)) | 853 (isearch-pop-state)) |
852 (isearch-update)) | 854 (isearch-update)) |
853 | 855 |
856 (defun isearch-help-or-delete-char () | |
857 "Show Isearch help or delete backward in the search string. | |
858 Deletes when `delete-key-deletes-forward' is t and C-h is used for deleting | |
859 backwards." | |
860 (interactive) | |
861 (if (and delete-key-deletes-forward | |
862 (case (device-type) | |
863 ('tty (eq tty-erase-char ?\C-h)) | |
864 ('x (not (x-keysym-on-keyboard-p "BackSpace"))))) | |
865 (isearch-delete-char) | |
866 (isearch-mode-help))) | |
854 | 867 |
855 (defun isearch-yank (chunk) | 868 (defun isearch-yank (chunk) |
856 ;; Helper for isearch-yank-* functions. CHUNK can be a string or a | 869 ;; Helper for isearch-yank-* functions. CHUNK can be a string or a |
857 ;; function. | 870 ;; function. |
858 (let ((word (if (stringp chunk) | 871 (let ((word (if (stringp chunk) |
1108 (cond | 1121 (cond |
1109 ((eq completion t) | 1122 ((eq completion t) |
1110 ;; isearch-string stays the same | 1123 ;; isearch-string stays the same |
1111 t) | 1124 t) |
1112 ((or completion ; not nil, must be a string | 1125 ((or completion ; not nil, must be a string |
1113 (= 0 (length isearch-string))) ; shouldnt have to say this | 1126 (= 0 (length isearch-string))) ; shouldn't have to say this |
1114 (if (equal completion isearch-string) ;; no extension? | 1127 (if (equal completion isearch-string) ;; no extension? |
1115 (if completion-auto-help | 1128 (if completion-auto-help |
1116 (with-output-to-temp-buffer "*Isearch completions*" | 1129 (with-output-to-temp-buffer "*Isearch completions*" |
1117 (display-completion-list | 1130 (display-completion-list |
1118 (all-completions isearch-string alist)))) | 1131 (all-completions isearch-string alist)))) |
1298 (put 'isearch-printing-char 'isearch-command t) | 1311 (put 'isearch-printing-char 'isearch-command t) |
1299 (put 'isearch-return-char 'isearch-command t) | 1312 (put 'isearch-return-char 'isearch-command t) |
1300 (put 'isearch-repeat-forward 'isearch-command t) | 1313 (put 'isearch-repeat-forward 'isearch-command t) |
1301 (put 'isearch-repeat-backward 'isearch-command t) | 1314 (put 'isearch-repeat-backward 'isearch-command t) |
1302 (put 'isearch-delete-char 'isearch-command t) | 1315 (put 'isearch-delete-char 'isearch-command t) |
1316 (put 'isearch-help-or-delete-char 'isearch-command t) | |
1303 (put 'isearch-abort 'isearch-command t) | 1317 (put 'isearch-abort 'isearch-command t) |
1304 (put 'isearch-quote-char 'isearch-command t) | 1318 (put 'isearch-quote-char 'isearch-command t) |
1305 (put 'isearch-exit 'isearch-command t) | 1319 (put 'isearch-exit 'isearch-command t) |
1306 (put 'isearch-printing-char 'isearch-command t) | 1320 (put 'isearch-printing-char 'isearch-command t) |
1307 (put 'isearch-printing-char 'isearch-command t) | 1321 (put 'isearch-printing-char 'isearch-command t) |