+(defvar lazy-highlight-face 'lazy-highlight)
+\f
+;; Define isearch help map.
+
+(defvar isearch-help-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [t] 'isearch-other-control-char)
+ (define-key map (char-to-string help-char) 'isearch-help-for-help)
+ (define-key map [help] 'isearch-help-for-help)
+ (define-key map [f1] 'isearch-help-for-help)
+ (define-key map "?" 'isearch-help-for-help)
+ (define-key map "b" 'isearch-describe-bindings)
+ (define-key map "k" 'isearch-describe-key)
+ (define-key map "m" 'isearch-describe-mode)
+ (define-key map "q" 'help-quit)
+ map)
+ "Keymap for characters following the Help key for Isearch mode.")
+
+(eval-when-compile (require 'help-macro))
+
+(make-help-screen isearch-help-for-help-internal
+ (purecopy "Type a help option: [bkm] or ?")
+ "You have typed %THIS-KEY%, the help character. Type a Help option:
+\(Type \\<help-map>\\[help-quit] to exit the Help command.)
+
+b Display all Isearch key bindings.
+k KEYS Display full documentation of Isearch key sequence.
+m Display documentation of Isearch mode.
+
+You can't type here other help keys available in the global help map,
+but outside of this help window when you type them in Isearch mode,
+they exit Isearch mode before displaying global help."
+ isearch-help-map)
+
+(defun isearch-help-for-help ()
+ "Display Isearch help menu."
+ (interactive)
+ (let (same-window-buffer-names same-window-regexps)
+ (isearch-help-for-help-internal))
+ (isearch-update))
+
+(defun isearch-describe-bindings ()
+ "Show a list of all keys defined in Isearch mode, and their definitions.
+This is like `describe-bindings', but displays only Isearch keys."
+ (interactive)
+ (let (same-window-buffer-names same-window-regexps)
+ (with-help-window "*Help*"
+ (with-current-buffer standard-output
+ (princ "Isearch Mode Bindings:\n")
+ (princ (substitute-command-keys "\\{isearch-mode-map}"))))))
+
+(defun isearch-describe-key ()
+ "Display documentation of the function invoked by isearch key."
+ (interactive)
+ (let (same-window-buffer-names same-window-regexps)
+ (call-interactively 'describe-key))
+ (isearch-update))
+
+(defun isearch-describe-mode ()
+ "Display documentation of Isearch mode."
+ (interactive)
+ (let (same-window-buffer-names same-window-regexps)
+ (describe-function 'isearch-forward))
+ (isearch-update))
+
+(defalias 'isearch-mode-help 'isearch-describe-mode)
+