[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/isearch.el,v
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/isearch.el,v |
Date: |
Tue, 22 Apr 2008 20:30:33 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Juri Linkov <jurta> 08/04/22 20:30:33
Index: isearch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.317
retrieving revision 1.318
diff -u -b -r1.317 -r1.318
--- isearch.el 22 Apr 2008 19:56:17 -0000 1.317
+++ isearch.el 22 Apr 2008 20:30:32 -0000 1.318
@@ -181,7 +181,7 @@
(defvar isearch-success-function 'isearch-success-function-default
"Function to report whether the new search match is considered successful.
The function has two arguments: the positions of start and end of text
-matched by the search. It this function returns nil, continue
+matched by the search. If this function returns nil, continue
searching without stopping at this match.")
;; Search ring.
@@ -328,6 +328,73 @@
'lazy-highlight-face
"22.1")
+;; Define isearch help map.
+
+(defvar isearch-help-map
+ (let ((i 0)
+ (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
+ "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 outise 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)
+
+
;; Define isearch-mode keymap.
(defvar isearch-mode-map
@@ -394,9 +461,7 @@
(define-key map "\M-\C-y" 'isearch-yank-char)
(define-key map "\C-y" 'isearch-yank-line)
- ;; 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-help-map)
(define-key map "\M-n" 'isearch-ring-advance)
(define-key map "\M-p" 'isearch-ring-retreat)
@@ -581,6 +646,10 @@
ring.
Type \\[isearch-complete] to complete the search string using the search ring.
+Type \\[isearch-describe-bindings] to display all isearch key bindings.
+Type \\[isearch-describe-key] to display documentation of isearch key.
+Type \\[isearch-describe-mode] to display documentation of isearch mode.
+
If an input method is turned on in the current buffer, that input
method is also active while you are typing characters to search. To
toggle the input method, type \\[isearch-toggle-input-method]. It
@@ -634,12 +703,6 @@
(isearch-mode nil (null not-regexp) nil (not no-recursive-edit)))
-(defun isearch-mode-help ()
- (interactive)
- (describe-function 'isearch-forward)
- (isearch-update))
-
-
;; isearch-mode only sets up incremental search for the minor mode.
;; All the work is done by the isearch-mode commands.
@@ -650,9 +713,8 @@
(defun isearch-mode (forward &optional regexp op-fun recursive-edit word-p)
- "Start isearch minor mode. Called by `isearch-forward', etc.
-
-\\{isearch-mode-map}"
+ "Start isearch minor mode.
+It is called by the function `isearch-forward' and other related functions."
;; Initialize global vars.
(setq isearch-forward forward