aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-06-15 02:37:58 +0000
committerRichard M. Stallman1997-06-15 02:37:58 +0000
commit1be5a2845e50172a4a58a5930f3095af575b85e2 (patch)
tree4083456857834cf5d59907b177d9d4547196088a
parente51f616feee6443d7537f108af578db514fac8d2 (diff)
downloademacs-1be5a2845e50172a4a58a5930f3095af575b85e2.tar.gz
emacs-1be5a2845e50172a4a58a5930f3095af575b85e2.zip
Don't call icomplete-mode; let the user do that.
(icomplete-show-key-bindings): Doc fix. (icomplete-mode): Doc fix. (icomplete-get-keys): Make it actually work. (icomplete-mode): Doc fix. (icomplete-completions): Doc fix.
-rw-r--r--lisp/icomplete.el41
1 files changed, 14 insertions, 27 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index b1588d73a07..218b2c32f00 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -56,8 +56,7 @@
56;; implemented an incremental completion style in his 'iswitch' 56;; implemented an incremental completion style in his 'iswitch'
57;; functions that served as a model for icomplete. Some other 57;; functions that served as a model for icomplete. Some other
58;; contributors: Noah Freidman (restructuring as minor mode), Colin 58;; contributors: Noah Freidman (restructuring as minor mode), Colin
59;; Rafferty (lemacs reconciliation), Lars Lindberg, RMS, and 59;; Rafferty (lemacs reconciliation), Lars Lindberg, RMS, and others.
60;; others.
61 60
62;; klm. 61;; klm.
63 62
@@ -96,8 +95,7 @@ icompletion is occurring.")
96;;;_ + Internal Variables 95;;;_ + Internal Variables
97;;;_ = icomplete-mode 96;;;_ = icomplete-mode
98(defvar icomplete-mode t 97(defvar icomplete-mode t
99 "Non-nil enables incremental minibuffer completion, once 98 "*Non-nil enables incremental minibuffer completion (see \\[icomplete-mode].")
100`\\[icomplete-mode]' function has set things up.")
101;;;_ = icomplete-eoinput 1 99;;;_ = icomplete-eoinput 1
102(defvar icomplete-eoinput 1 100(defvar icomplete-eoinput 1
103 "Point where minibuffer input ends and completion info begins.") 101 "Point where minibuffer input ends and completion info begins.")
@@ -119,21 +117,19 @@ Use `icomplete-mode' function to set it up properly for incremental
119minibuffer completion.") 117minibuffer completion.")
120(add-hook 'icomplete-post-command-hook 'icomplete-exhibit) 118(add-hook 'icomplete-post-command-hook 'icomplete-exhibit)
121 119
122(defvar icomplete-show-key-bindings (string-match "XEmacs\\|Lucid" 120(defvar icomplete-show-key-bindings t
123 emacs-version) 121 "*When non-nil, show key bindings as well as completion for sole matches.")
124 "When non-nil show key bindings as well as completion when matching
125a command. Currently working only for XEmacs - see `icomplete-get-keys'.")
126 122
127(defun icomplete-get-keys (func-name) 123(defun icomplete-get-keys (func-name)
128 "Return the keys `func-name' is bound to as a string, or nil if none. 124 "Return strings naming keys bound to `func-name', or nil if none.
129 NOTE that this depends on `owindow' minbuf setting and `current-local-map' 125Examines the prior, not current, buffer, presuming that current buffer
130 taking arg, both present in XEmacs but not present in mainline GNU Emacs 126is minibuffer."
131 19.34." 127 (if (commandp func-name)
132 (when (commandp func-name)
133 (save-excursion 128 (save-excursion
134 (let* ((sym (intern func-name)) 129 (let* ((sym (intern func-name))
135 (buf (set-buffer (window-buffer owindow))) 130 (buf (other-buffer))
136 (keys (where-is-internal sym (current-local-map buf)))) 131 (map (save-excursion (set-buffer buf) (current-local-map)))
132 (keys (where-is-internal sym map)))
137 (if keys 133 (if keys
138 (concat "<" 134 (concat "<"
139 (mapconcat 'key-description 135 (mapconcat 'key-description
@@ -146,8 +142,8 @@ a command. Currently working only for XEmacs - see `icomplete-get-keys'.")
146;;;_ > icomplete-mode (&optional prefix) 142;;;_ > icomplete-mode (&optional prefix)
147;;;###autoload 143;;;###autoload
148(defun icomplete-mode (&optional prefix) 144(defun icomplete-mode (&optional prefix)
149 "Activate incremental minibuffer completion for this emacs session, 145 "Activate incremental minibuffer completion for this Emacs session.
150or deactivate with negative prefix arg." 146Deactivates with negative universal argument."
151 (interactive "p") 147 (interactive "p")
152 (or prefix (setq prefix 0)) 148 (or prefix (setq prefix 0))
153 (cond ((>= prefix 0) 149 (cond ((>= prefix 0)
@@ -159,7 +155,6 @@ or deactivate with negative prefix arg."
159 155
160;;;_ > icomplete-simple-completing-p () 156;;;_ > icomplete-simple-completing-p ()
161(defun icomplete-simple-completing-p () 157(defun icomplete-simple-completing-p ()
162
163 "Non-nil if current window is minibuffer that's doing simple completion. 158 "Non-nil if current window is minibuffer that's doing simple completion.
164 159
165Conditions are: 160Conditions are:
@@ -215,7 +210,6 @@ and `minibuffer-setup-hook'."
215;;;_ > icomplete-exhibit () 210;;;_ > icomplete-exhibit ()
216(defun icomplete-exhibit () 211(defun icomplete-exhibit ()
217 "Insert icomplete completions display. 212 "Insert icomplete completions display.
218
219Should be run via minibuffer `post-command-hook'. See `icomplete-mode' 213Should be run via minibuffer `post-command-hook'. See `icomplete-mode'
220and `minibuffer-setup-hook'." 214and `minibuffer-setup-hook'."
221 (if (icomplete-simple-completing-p) 215 (if (icomplete-simple-completing-p)
@@ -271,7 +265,7 @@ one of \(), \[], or \{} pairs. The choice of brackets is as follows:
271 265
272The displays for unambiguous matches have ` [Matched]' appended 266The displays for unambiguous matches have ` [Matched]' appended
273\(whether complete or not), or ` \[No matches]', if no eligible 267\(whether complete or not), or ` \[No matches]', if no eligible
274matches exist. \(In XEmacs, keybindings for matched commands, if any, 268matches exist. \(Keybindings for uniquely matched commands
275are exhibited within the square braces.)" 269are exhibited within the square braces.)"
276 270
277 ;; 'all-completions' doesn't like empty 271 ;; 'all-completions' doesn't like empty
@@ -353,13 +347,6 @@ are exhibited within the square braces.)"
353 alternatives) 347 alternatives)
354 close-bracket-prospects))))))) 348 close-bracket-prospects)))))))
355 349
356;;;_ + Initialization
357;;; If user hasn't setq-default icomplete-mode to nil, then setup for
358;;; activation:
359(if icomplete-mode
360 (icomplete-mode))
361
362
363;;;_* Local emacs vars. 350;;;_* Local emacs vars.
364;;;Local variables: 351;;;Local variables:
365;;;outline-layout: (-2 :) 352;;;outline-layout: (-2 :)