# HG changeset patch # User Richard M. Stallman # Date 807056515 0 # Node ID cadb9c7a15018aba0b834b43722b909180a995f7 # Parent ad18c3ad23b3fdccc02411911d9c0e73f97d3232 (isearch-mode-map): Don't bind tab, return, kp-N, etc. (isearch-other-meta-char): Special handling for keys like tab, etc. diff -r ad18c3ad23b3 -r cadb9c7a1501 lisp/isearch.el --- a/lisp/isearch.el Sat Jul 29 22:20:35 1995 +0000 +++ b/lisp/isearch.el Sat Jul 29 22:21:55 1995 +0000 @@ -231,37 +231,6 @@ (define-key map "\C-w" 'isearch-yank-word) (define-key map "\C-y" 'isearch-yank-line) - ;; Bind the ASCII-equivalent "function keys" explicitly to nil - ;; so that the default binding does not apply. - ;; As a result, these keys translate thru function-key-map - ;; as normal, and they have the effect of the equivalent ASCII char. - ;; We bind [escape] below. - (define-key map [tab] 'nil) - (define-key map [kp-0] 'nil) - (define-key map [kp-1] 'nil) - (define-key map [kp-2] 'nil) - (define-key map [kp-3] 'nil) - (define-key map [kp-4] 'nil) - (define-key map [kp-5] 'nil) - (define-key map [kp-6] 'nil) - (define-key map [kp-7] 'nil) - (define-key map [kp-8] 'nil) - (define-key map [kp-9] 'nil) - (define-key map [kp-add] 'nil) - (define-key map [kp-subtract] 'nil) - (define-key map [kp-multiply] 'nil) - (define-key map [kp-divide] 'nil) - (define-key map [kp-decimal] 'nil) - (define-key map [kp-separator] 'nil) - (define-key map [kp-equal] 'nil) - (define-key map [kp-tab] 'nil) - (define-key map [kp-space] 'nil) - (define-key map [kp-enter] 'nil) - (define-key map [delete] 'nil) - (define-key map [backspace] 'nil) - (define-key map [return] 'nil) - (define-key map [newline] 'nil) - ;; Define keys for regexp chars * ? |. ;; Nothing special for + because it matches at least once. (define-key map "*" 'isearch-*-char) @@ -1037,7 +1006,20 @@ (let* ((key (this-command-keys)) (main-event (aref key 0)) (keylist (listify-key-sequence key))) - (cond ( + (cond ((and (= (length key) 1) + (lookup-key function-key-map key)) + ;; Handle a function key that translates into something else. + ;; If the key has a global definition too, + ;; exit and unread the key itself, so its global definition runs. + ;; Otherwise, unread the translation, + ;; so that the translated key takes effect within isearch. + (if (lookup-key global-map key) + (progn + (isearch-done) + (apply 'isearch-unread keylist)) + (apply 'isearch-unread + (listify-key-sequence (lookup-key function-key-map key))))) + ( ;; Handle an undefined shifted control character ;; by downshifting it if that makes it defined. ;; (As read-key-sequence would normally do,