Index: isearch.el =================================================================== RCS file: /sources/emacs/emacs/lisp/isearch.el,v retrieving revision 1.315 diff -u -b -r1.315 isearch.el --- isearch.el 16 Mar 2008 17:44:11 -0000 1.315 +++ isearch.el 16 Apr 2008 22:26:43 -0000 @@ -391,6 +391,8 @@ ;; Turned off because I find I expect to get the global definition--rms. ;; ;; Instead bind C-h to special help command for isearch-mode. ;; (define-key map "\C-h" 'isearch-mode-help) + (define-key map "\C-h" 'isearch-mode-help) + (define-key map [(f1)] 'isearch-maybe-mode-help) (define-key map "\M-n" 'isearch-ring-advance) (define-key map "\M-p" 'isearch-ring-retreat) @@ -629,10 +631,46 @@ (defun isearch-mode-help () + "Show isearch mode help." (interactive) (describe-function 'isearch-forward) + (with-current-buffer (help-buffer) + (let ((inhibit-read-only t)) + (insert (substitute-command-keys + "To scroll help use \\[scroll-other-window-down] and \\[scroll-other-window].\n\n")))) (isearch-update)) +(defun isearch-maybe-mode-help () + "Maybe show isearch mode help." + (interactive) + (let ((invoked-by-f1 (equal (this-command-keys-vector) [f1])) + normal-help + (wait-time 4)) + (when invoked-by-f1 + (with-timeout (wait-time (setq normal-help nil)) + (setq normal-help + (read-char + (propertize + (format + (concat "Type a char for Emacs help." + " Or, wait %.0d seconds for isearch help: ") + wait-time) + 'face 'highlight) + nil)))) + (case normal-help + ((nil) + ;;(message "Tab completion state help") + ;;(describe-function 'tabkey2-show-completion-state-help) + (isearch-mode-help) + ) + (?c + (call-interactively 'describe-key-briefly)) + (?k + (call-interactively 'describe-key)) + (t + (isearch-mode -1) + (setq unread-command-events (append (this-command-keys) nil)))))) + ;; isearch-mode only sets up incremental search for the minor mode. ;; All the work is done by the isearch-mode commands. @@ -1758,6 +1796,18 @@ ((eq search-exit-option 'edit) (apply 'isearch-unread keylist) (isearch-edit-string)) + ;; Always scroll other window if help buffer + ((let ((binding (key-binding key)) + other-buffer-is-help) + (when (or (eq binding 'scroll-other-window-down) + (eq binding 'scroll-other-window)) + (save-selected-window + (other-window 1) + (setq other-buffer-is-help (equal (buffer-name) "*Help*"))) + (when other-buffer-is-help + (command-execute binding) + (isearch-update) + t)))) ;; Handle a scrolling function. ((and isearch-allow-scroll (progn (setq key (isearch-reread-key-sequence-naturally keylist)) @@ -2027,10 +2077,12 @@ (if isearch-forward "" " backward") (if current-input-method (concat " [" current-input-method-title "]: ") - ": ") - ))) - (propertize (concat (upcase (substring m 0 1)) (substring m 1)) - 'face 'minibuffer-prompt))) + ": "))) + m2) + (setq m2 (apply 'propertize + (concat (upcase (substring m 0 1)) (substring m 1)) + minibuffer-prompt-properties)) + (propertize m2 'read-only nil))) (defun isearch-message-suffix (&optional c-q-hack ellipsis) (concat (if c-q-hack "^Q" "")