Index: lisp/isearch.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v retrieving revision 1.276 diff -u -r1.276 isearch.el --- lisp/isearch.el 24 Nov 2005 09:59:11 -0000 1.276 +++ lisp/isearch.el 24 Nov 2005 17:30:35 -0000 @@ -193,7 +193,7 @@ "Index in `regexp-search-ring' of last string reused. It is nil if none yet.") -(defcustom search-ring-update nil +(defcustom isearch-ring-update nil "*Non-nil if advancing or retreating in the search ring should cause search. Default value, nil, means edit the string instead." :type 'boolean @@ -370,7 +370,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-mode-help) (define-key map "\M-n" 'isearch-ring-advance) (define-key map "\M-p" 'isearch-ring-retreat) @@ -609,6 +610,12 @@ (defun isearch-mode-help () (interactive) (describe-function 'isearch-forward) + (save-excursion + (set-buffer "*Help*") + (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)) @@ -1702,6 +1709,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)) + (other-window 1) + (setq other-buffer-is-help (equal (buffer-name) "*Help*")) + (other-window -1) + (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)) @@ -1843,13 +1862,14 @@ (defun isearch-ring-adjust (advance) ;; Helper for isearch-ring-advance and isearch-ring-retreat (isearch-ring-adjust1 advance) - (if search-ring-update + ;; Changed because isearch-edit-string calls isearch-push-state + ;; but isearch-search does not + (if isearch-ring-update (progn (isearch-search) + (isearch-push-state) (isearch-update)) - (isearch-edit-string) - ) - (isearch-push-state)) + (isearch-edit-string))) (defun isearch-ring-advance () "Advance to the next search string in the ring."