icicle update
[emacs.git] / .emacs.d / elisp / icicle / icicles-opt.el
1 ;;; icicles-opt.el --- User options (customizable variables) for Icicles
2 ;;
3 ;; Filename: icicles-opt.el
4 ;; Description: User options (customizable variables) for Icicles
5 ;; Author: Drew Adams
6 ;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
7 ;; Copyright (C) 1996-2014, Drew Adams, all rights reserved.
8 ;; Created: Mon Feb 27 09:22:14 2006
9 ;; Last-Updated: Tue Apr 29 08:44:37 2014 (-0700)
10 ;; By: dradams
11 ;; Update #: 5977
12 ;; URL: http://www.emacswiki.org/icicles-opt.el
13 ;; Doc URL: http://www.emacswiki.org/Icicles
14 ;; Keywords: internal, extensions, help, abbrev, local, minibuffer,
15 ;; keys, apropos, completion, matching, regexp, command
16 ;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x
17 ;;
18 ;; Features that might be required by this library:
19 ;;
20 ;; `cl', `cus-theme', `el-swank-fuzzy', `ffap', `ffap-', `fuzzy',
21 ;; `fuzzy-match', `hexrgb', `kmacro', `levenshtein', `regexp-opt',
22 ;; `thingatpt', `thingatpt+', `wid-edit', `wid-edit+', `widget'.
23 ;;
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 ;;
26 ;;; Commentary:
27 ;;
28 ;; This is a helper library for library `icicles.el'. It defines
29 ;; user options (variables). For Icicles documentation, see
30 ;; `icicles-doc1.el' and `icicles-doc2.el'.
31 ;;
32 ;; Widgets defined here:
33 ;;
34 ;; `icicle-key-definition'.
35 ;;
36 ;; Constants defined here:
37 ;;
38 ;; `icicle-anychar-regexp', `icicle-Completions-misc-submenu',
39 ;; `icicle-Completions-save/retrieve-submenu',
40 ;; `icicle-Completions-sets-submenu',
41 ;; `icicle-Completions-sorting-submenu',
42 ;; `icicle-Completions-this-candidate-submenu',
43 ;; `icicle-Completions-toggle-submenu', `icicle-doremi-submenu'.
44 ;;
45 ;; Commands defined here:
46 ;;
47 ;; `icicle-read-kbd-macro'.
48 ;;
49 ;; User options defined here (in Custom group `Icicles'):
50 ;;
51 ;; `icicle-act-before-cycle-flag',
52 ;; `icicle-add-proxy-candidates-flag',
53 ;; `icicle-alternative-actions-alist',
54 ;; `icicle-alternative-sort-comparer',
55 ;; `icicle-anything-transform-candidates-flag',
56 ;; `icicle-apropos-complete-keys',
57 ;; `icicle-apropos-complete-no-display-keys',
58 ;; `icicle-apropos-cycle-next-keys',
59 ;; `icicle-apropos-cycle-next-action-keys',
60 ;; `icicle-apropos-cycle-next-alt-action-keys',
61 ;; `icicle-apropos-cycle-next-help-keys',
62 ;; `icicle-apropos-cycle-previous-keys',
63 ;; `icicle-apropos-cycle-previous-action-keys',
64 ;; `icicle-apropos-cycle-previous-alt-action-keys',
65 ;; `icicle-apropos-cycle-previous-help-keys',
66 ;; `icicle-bookmark-name-length-max',
67 ;; `icicle-bookmark-refresh-cache-flag',
68 ;; `icicle-buffer-candidate-key-bindings', `icicle-buffer-configs',
69 ;; `icicle-buffer-extras',
70 ;; `icicle-buffer-ignore-space-prefix-flag',
71 ;; `icicle-buffer-include-cached-files-nflag',
72 ;; `icicle-buffer-include-recent-files-nflag',
73 ;; `icicle-buffer-match-regexp', `icicle-buffer-no-match-regexp',
74 ;; `icicle-buffer-predicate', `icicle-buffer-prefix-arg-filtering',
75 ;; `icicle-buffer-require-match-flag',
76 ;; `icicle-buffer-skip-functions', `icicle-buffer-sort',
77 ;; `icicle-buffers-ido-like-flag', `icicle-candidate-action-keys',
78 ;; `icicle-candidate-help-keys', `icicle-candidate-width-factor',
79 ;; `icicle-change-region-background-flag',
80 ;; `icicle-change-sort-order-completion',
81 ;; `icicle-C-l-uses-completion-flag', `icicle-color-themes',
82 ;; `icicle-comint-dynamic-complete-replacements',
83 ;; `icicle-command-abbrev-alist',
84 ;; `icicle-command-abbrev-match-all-parts-flag',
85 ;; `icicle-command-abbrev-priority-flag',
86 ;; `icicle-complete-key-anyway-flag',
87 ;; `icicle-complete-keys-ignored-prefix-keys',
88 ;; `icicle-complete-keys-self-insert-ranges',
89 ;; `icicle-completing-read+insert-keys',
90 ;; `icicle-completion-history-max-length',
91 ;; `icicle-completion-key-bindings',
92 ;; `icicle-completion-list-key-bindings',
93 ;; `icicle-Completions-display-min-input-chars',
94 ;; `icicle-completions-format', `icicle-Completions-max-columns',
95 ;; `icicle-Completions-mouse-3-menu-entries',
96 ;; `icicle-Completions-text-scale-decrease',
97 ;; `icicle-Completions-window-max-height',
98 ;; `icicle-customize-save-flag',
99 ;; `icicle-customize-save-variable-function',
100 ;; `icicle-custom-themes', `icicle-custom-themes-accumulate-flag',
101 ;; `icicle-custom-themes-update-flag',
102 ;; `icicle-default-in-prompt-format-function',
103 ;; `icicle-default-cycling-mode', `icicle-default-thing-insertion',
104 ;; `icicle-default-value', `icicle-define-alias-commands-flag',
105 ;; `icicle-deletion-action-flag', `icicle-dot-show-regexp-flag',
106 ;; `icicle-dot-string', `icicle-expand-input-to-common-match',
107 ;; `icicle-expand-input-to-common-match-alt', `icicle-file-extras',
108 ;; `icicle-file-match-regexp', `icicle-file-no-match-regexp',
109 ;; `icicle-file-predicate', `icicle-file-require-match-flag',
110 ;; `icicle-file-skip-functions', `icicle-file-sort',
111 ;; `icicle-files-ido-like-flag',
112 ;; `icicle-filesets-as-saved-completion-sets-flag',
113 ;; `icicle-find-file-expand-directory-flag',
114 ;; `icicle-functions-to-redefine', `icicle-guess-commands-in-path',
115 ;; `icicle-help-in-mode-line-delay',
116 ;; `icicle-hide-common-match-in-Completions-flag',
117 ;; `icicle-hide-non-matching-lines-flag',
118 ;; `icicle-highlight-historical-candidates-flag',
119 ;; `icicle-highlight-input-completion-failure',
120 ;; `icicle-highlight-input-completion-failure-delay',
121 ;; `icicle-highlight-input-completion-failure-threshold',
122 ;; `icicle-highlight-input-initial-whitespace-flag',
123 ;; `icicle-highlight-lighter-flag',
124 ;; `icicle-highlight-saved-candidates-flag',
125 ;; `icicle-icomplete-mode-max-candidates',
126 ;; `icicle-ignore-comments-flag', `icicle-ignored-directories',
127 ;; `icicle-image-files-in-Completions',
128 ;; `icicle-image-preview-in-tooltip',
129 ;; `icicle-incremental-completion',
130 ;; `icicle-incremental-completion-delay',
131 ;; `icicle-incremental-completion-threshold',
132 ;; `icicle-Info-visited-max-candidates',
133 ;; `icicle-inhibit-advice-functions', `icicle-inhibit-ding-flag',
134 ;; `icicle-input-string', `icicle-inter-candidates-min-spaces',
135 ;; `icicle-isearch-complete-keys',
136 ;; `icicle-isearch-history-insert-keys',
137 ;; `icicle-keep-Completions-for-sole-dir',
138 ;; `icicle-key-complete-keys',
139 ;; `icicle-key-complete-keys-for-minibuffer',
140 ;; `icicle-key-descriptions-use-<>-flag',
141 ;; `icicle-key-descriptions-use-angle-brackets-flag',
142 ;; `icicle-keymaps-for-key-completion',
143 ;; `icicle-kill-visited-buffers-flag', `icicle-kmacro-ring-max',
144 ;; `icicle-levenshtein-distance', `icicle-list-join-string',
145 ;; `icicle-list-nth-parts-join-string',
146 ;; `icicle-mark-position-in-candidate', `icicle-max-candidates',
147 ;; `icicle-menu-items-to-history-flag',
148 ;; `icicle-minibuffer-key-bindings',
149 ;; `icicle-minibuffer-setup-hook', `icicle-modal-cycle-down-keys',
150 ;; `icicle-modal-cycle-down-action-keys',
151 ;; `icicle-modal-cycle-down-alt-action-keys',
152 ;; `icicle-modal-cycle-down-help-keys',
153 ;; `icicle-modal-cycle-up-keys',
154 ;; `icicle-modal-cycle-up-action-keys',
155 ;; `icicle-modal-cycle-up-alt-action-keys',
156 ;; `icicle-modal-cycle-up-help-keys',
157 ;; `icicle-move-Completions-frame', `icicle-no-match-hook',
158 ;; `icicle-option-type-prefix-arg-list',
159 ;; `icicle-network-drive-means-remote-flag',
160 ;; `icicle-point-position-in-candidate',
161 ;; `icicle-populate-interactive-history-flag',
162 ;; `icicle-pp-eval-expression-print-length',
163 ;; `icicle-pp-eval-expression-print-level',
164 ;; `icicle-prefix-complete-keys',
165 ;; `icicle-prefix-complete-no-display-keys',
166 ;; `icicle-prefix-cycle-next-keys',
167 ;; `icicle-prefix-cycle-next-action-keys',
168 ;; `icicle-prefix-cycle-next-alt-action-keys',
169 ;; `icicle-prefix-cycle-next-help-keys',
170 ;; `icicle-prefix-cycle-previous-keys',
171 ;; `icicle-prefix-cycle-previous-action-keys',
172 ;; `icicle-prefix-cycle-previous-alt-action-keys',
173 ;; `icicle-prefix-cycle-previous-help-keys',
174 ;; `icicle-quote-shell-file-name-flag',
175 ;; `icicle-read+insert-file-name-keys', `icicle-regexp-quote-flag',
176 ;; `icicle-regexp-search-ring-max', `icicle-region-background',
177 ;; `icicle-require-match-flag', `icicle-saved-completion-sets',
178 ;; `icicle-search-cleanup-flag', `icicle-search-from-isearch-keys',
179 ;; `icicle-search-highlight-all-current-flag',
180 ;; `icicle-search-highlight-context-levels-flag',
181 ;; `icicle-search-highlight-threshold', `icicle-search-hook',
182 ;; `icicle-search-key-prefix',
183 ;; `icicle-search-replace-common-match-flag',
184 ;; `icicle-search-replace-literally-flag',
185 ;; `icicle-search-replace-whole-candidate-flag',
186 ;; `icicle-search-ring-max', `icicle-search-whole-word-flag',
187 ;; `icicle-shell-command-candidates-cache',
188 ;; `icicle-show-annotations-flag',
189 ;; `icicle-show-Completions-help-flag',
190 ;; `icicle-show-Completions-initially-flag',
191 ;; `icicle-show-multi-completion-flag', `icicle-sort-comparer',
192 ;; `icicle-sorting-max-candidates', `icicle-sort-orders-alist',
193 ;; `icicle-special-candidate-regexp',
194 ;; `icicle-S-TAB-completion-methods-alist',
195 ;; `icicle-S-TAB-completion-methods-per-command',
196 ;; `icicle-swank-prefix-length', `icicle-swank-timeout',
197 ;; `icicle-TAB-completion-methods',
198 ;; `icicle-TAB-completion-methods-per-command',
199 ;; `icicle-TAB-shows-candidates-flag',
200 ;; `icicle-TAB/S-TAB-only-completes-flag', `icicle-recenter',
201 ;; `icicle-test-for-remote-files-flag',
202 ;; `icicle-thing-at-point-functions',
203 ;; `icicle-top-level-key-bindings',
204 ;; `icicle-top-level-when-sole-completion-delay',
205 ;; `icicle-top-level-when-sole-completion-flag',
206 ;; `icicle-touche-pas-aux-menus-flag', `icicle-type-actions-alist',
207 ;; `icicle-unpropertize-completion-result-flag',
208 ;; `icicle-update-input-hook', `icicle-use-~-for-home-dir-flag',
209 ;; `icicle-use-C-for-actions-flag',
210 ;; `icicle-use-anything-candidates-flag',
211 ;; `icicle-use-candidates-only-once-flag',
212 ;; `icicle-widgets-to-redefine', `icicle-word-completion-keys',
213 ;; `icicle-WYSIWYG-Completions-flag', `icicle-yank-function',
214 ;; `icicle-zap-to-char-candidates'.
215 ;;
216 ;; Functions defined here:
217 ;;
218 ;; `icicle-bind-top-level-commands',
219 ;; `icicle-buffer-sort-*...*-last',
220 ;; `icicle-compute-shell-command-candidates',
221 ;; `icicle-edmacro-parse-keys', `icicle-image-file-p',
222 ;; `icicle-kbd', `icicle-remap', `icicle-thing-at-point',
223 ;; `icicle-widgetp'.
224 ;;
225 ;; Internal variables defined here:
226 ;;
227 ;; `icicle-current-TAB-method', `icicle-delete-candidate-object'.
228 ;;
229 ;; For descriptions of changes to this file, see `icicles-chg.el'.
230 ;;
231 ;; Note: Occasionally I have renamed or removed an Icicles option.
232 ;; If you have customized such an option, then your customization
233 ;; will no longer have any effect. With the exception of options
234 ;; `icicle-mode' and `icicle-mode-hook', library `icicles-opt.el'
235 ;; always contains the complete set of Icicles options. If your
236 ;; custom file or init file contains an Icicles option that is not
237 ;; listed above, then you can remove it because it is obsolete.
238
239 ;;(@> "Index")
240 ;;
241 ;; If you have library `linkd.el' and Emacs 22 or later, load
242 ;; `linkd.el' and turn on `linkd-mode' now. It lets you easily
243 ;; navigate around the sections of this doc. Linkd mode will
244 ;; highlight this Index, as well as the cross-references and section
245 ;; headings throughout this file. You can get `linkd.el' here:
246 ;; http://dto.freeshell.org/notebook/Linkd.html.
247 ;;
248 ;; (@> "Constants used to define user options")
249 ;; (@> "User options, organized alphabetically, except for dependencies")
250
251 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
252 ;;
253 ;; This program is free software; you can redistribute it and/or
254 ;; modify it under the terms of the GNU General Public License as
255 ;; published by the Free Software Foundation; either version 2, or (at
256 ;; your option) any later version.
257 ;;
258 ;; This program is distributed in the hope that it will be useful, but
259 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
260 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
261 ;; General Public License for more details.
262 ;;
263 ;; You should have received a copy of the GNU General Public License
264 ;; along with this program; see the file COPYING. If not, write to
265 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
266 ;; Floor, Boston, MA 02110-1301, USA.
267 ;;
268 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
269 ;;
270 ;;; Code:
271
272 ;; Emacs 20 does not DTRT wrt `:type' and `:set' sexps at compile time,
273 ;; so there seems no way around this, short of coding without push and dolist.
274 ;; This MUST be `eval-and-compile', even though in principle `eval-when-compile' should be enough.
275 (eval-and-compile (when (< emacs-major-version 21) (require 'cl))) ;; dolist, push
276
277 (require 'thingatpt) ;; symbol-at-point, thing-at-point, thing-at-point-url-at-point
278
279 (when (and (require 'thingatpt+ nil t) ; (no error if not found)
280 (fboundp 'tap-put-thing-at-point-props)) ; >= 2012-08-21
281 (tap-define-aliases-wo-prefix)
282 (tap-put-thing-at-point-props))
283 ;; list-nearest-point-as-string, non-nil-symbol-name-nearest-point, word-nearest-point
284
285 (require 'hexrgb nil t) ;; (no error if not found):
286 ;; hexrgb-approx-equal, hexrgb-increment-hue, hexrgb-increment-value, hexrgb-saturation
287
288 ;; Quiet the byte-compiler.
289 (defvar shell-completion-execonly) ; In `shell.el'.
290
291 (defvar icicle-dot-string-internal)
292 (defvar icicle-mode-map)
293 (defvar icicle-top-level-key-bindings)
294
295 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
296
297 ;;(@* "Constants used to define user options")
298
299 ;;; Constants used to define user options --
300
301 (defconst icicle-Completions-misc-submenu
302 '(misc-menu
303 menu-item
304 "Miscellaneous"
305 (keymap
306 (complete-for-past-completion menu-item "Complete for Past Completion Input"
307 icicle-retrieve-previous-input
308 :visible (or (and icicle-C-l-uses-completion-flag (not current-prefix-arg))
309 (and (not icicle-C-l-uses-completion-flag) current-prefix-arg)))
310 (previous-completion-input menu-item "Previous Completion Input"
311 icicle-retrieve-previous-input
312 :visible (not (or (and icicle-C-l-uses-completion-flag (not current-prefix-arg))
313 (and (not icicle-C-l-uses-completion-flag) current-prefix-arg))))
314 (next-completion-input menu-item "Next Completion Input"
315 icicle-retrieve-next-input)
316 (one-off-eval menu-item "One-Off Eval..."
317 icicle-pp-eval-expression-in-minibuffer)
318 (sep-misc "--")
319 (icicles-help menu-item "Icicles Help" icicle-minibuffer-help)))
320 "Submenu for miscellaneous operations on completions.")
321
322 (defconst icicle-Completions-save/retrieve-submenu
323 '(save-retrieve-menu
324 menu-item
325 "Save/Retrieve"
326 (keymap
327 (save-all menu-item "Save All" icicle-candidate-set-save)
328 (save-all-var menu-item " to Variable..."
329 icicle-candidate-set-save-to-variable)
330 (save-all-cache menu-item " to Cache File..."
331 icicle-candidate-set-save-persistently)
332 (add-all-to-saved menu-item "Add All to Saved" icicle-candidate-set-save-more)
333 (save-selected menu-item "Save Selected (Region) Candidates"
334 icicle-candidate-set-save-selected
335 :enable (and mark-active (> (region-end) (region-beginning))))
336 (clear-saved menu-item "Clear Saved Candidates"
337 icicle-candidate-set-save-selected
338 :enable (and (boundp 'icicle-saved-completion-candidates)
339 icicle-saved-completion-candidates))
340 (add-selected-to-saved menu-item "Add Selected (Region) Candidates"
341 icicle-candidate-set-save-more-selected
342 :enable (and mark-active (> (region-end) (region-beginning))))
343 (sep-save/retrieve-2 "--")
344 (retrieve-saved menu-item "Retrieve Saved" icicle-candidate-set-retrieve
345 :enable (and (boundp 'icicle-saved-completion-candidates)
346 icicle-saved-completion-candidates))
347 (retrieve-more-saved menu-item "Retrieve More Saved"
348 icicle-candidate-set-retrieve-more
349 :enable (and (boundp 'icicle-saved-completion-candidates)
350 icicle-saved-completion-candidates))))
351 "Submenu for saving and retrieving completion candidates.")
352
353 (defconst icicle-Completions-sets-submenu
354 '(sets-menu
355 menu-item
356 "Sets"
357 (keymap
358 (complement menu-item "Complement" icicle-candidate-set-complement)
359 (widen menu-item "Or Match Alternative..." icicle-widen-candidates)
360 (narrow menu-item "Match Also Regexp..." icicle-narrow-candidates)
361 (save-pred-read-var menu-item "Save Predicate to Variable... (`C-u')"
362 icicle-save-predicate-to-variable
363 :visible current-prefix-arg)
364 (save-pred-std-var menu-item "Save Predicate to `icicle-input-string'"
365 icicle-save-predicate-to-variable
366 :visible (not current-prefix-arg))
367 (intersect menu-item "Intersect Saved" icicle-candidate-set-intersection
368 :enable icicle-saved-completion-candidates)
369 (difference menu-item "Subtract Saved" icicle-candidate-set-difference
370 :enable icicle-saved-completion-candidates)
371 (union menu-item "Add (Union) Saved" icicle-candidate-set-union
372 :enable icicle-saved-completion-candidates)
373 (keep-past-chrono menu-item "Only Previously Entered, By Time (`C-u')"
374 icicle-keep-only-past-inputs
375 :visible current-prefix-arg)
376 (keep-past-alpha menu-item "Only Previously Entered"
377 icicle-keep-only-past-inputs
378 :visible (not current-prefix-arg))))
379 "Submenu for set operations on completion candidates.")
380
381 (defconst icicle-Completions-sorting-submenu
382 '(sorting-menu
383 menu-item
384 "Sorting"
385 (keymap
386 (change-sort-order menu-item "Change Sort Order (`C-,')" icicle-change-sort-order
387 :visible (let ((use-completion-p (if (integerp icicle-change-sort-order-completion)
388 (> (length (icicle-current-sort-functions))
389 icicle-change-sort-order-completion)
390 icicle-change-sort-order-completion)))
391 (or (and (not current-prefix-arg) use-completion-p)
392 (and current-prefix-arg (not use-completion-p)))))
393 (next-sort-order menu-item "Next Sort Order (`C-,')" icicle-change-sort-order
394 :visible (not (let ((use-completion-p (if (integerp icicle-change-sort-order-completion)
395 (> (length (icicle-current-sort-functions))
396 icicle-change-sort-order-completion)
397 icicle-change-sort-order-completion)))
398 (or (and (not current-prefix-arg) use-completion-p)
399 (and current-prefix-arg (not use-completion-p))))))
400 (change-alt-sort menu-item "Change Alternative Sort Order (`M-,')"
401 icicle-change-alternative-sort-order
402 :visible (let ((use-completion-p (if (integerp icicle-change-sort-order-completion)
403 (> (length (icicle-current-sort-functions))
404 icicle-change-sort-order-completion)
405 icicle-change-sort-order-completion)))
406 (or (and (not current-prefix-arg) use-completion-p)
407 (and current-prefix-arg (not use-completion-p)))))
408 (next-alt-sort menu-item "Next Alternative Sort Order (`M-,')"
409 icicle-change-alternative-sort-order
410 :visible (not (let ((use-completion-p (if (integerp icicle-change-sort-order-completion)
411 (> (length (icicle-current-sort-functions))
412 icicle-change-sort-order-completion)
413 icicle-change-sort-order-completion)))
414 (or (and (not current-prefix-arg) use-completion-p)
415 (and current-prefix-arg (not use-completion-p))))))
416 (swap-sort menu-item "Swap Alternative/Normal Sort"
417 icicle-toggle-alternative-sorting)))
418 "Submenu for sorting completion candidates.")
419
420 (defconst icicle-Completions-this-candidate-submenu
421 '(this-candidate-menu
422 menu-item
423 "This Candidate"
424 (keymap
425 (help-on-cand menu-item "Help About" icicle-help-on-candidate)
426 (sep-this-1 "--")
427 (action menu-item "Act On (`C-mouse-2')" icicle-candidate-action)
428 (read-fn-invoke menu-item "Apply a Function To... (`M-mouse-2')"
429 icicle-candidate-read-fn-invoke)
430 (insert-in-minibuffer menu-item "Insert in Minibuffer (`C-insert')"
431 (lambda ()
432 (interactive)
433 (select-window (active-minibuffer-window))
434 (goto-char (icicle-minibuffer-prompt-end))
435 (icicle-clear-minibuffer)
436 (insert icicle-last-completion-candidate))
437 :help "Insert candidate in minibuffer")
438 (sep-this-2 "--")
439 (all-cands menu-item "Act on Each Individually" icicle-all-candidates-action)
440 (all-list menu-item "Act on All as a List" icicle-all-candidates-list-action)))
441 "Submenu for acting on candidate under the mouse.")
442
443 (defconst icicle-Completions-toggle-submenu
444 '(toggle-menu
445 menu-item
446 "Toggle/Cycle/Change"
447 (keymap
448 ;; This one is not a toggle or cycle.
449 (regexp-quote-input menu-item "Regexp-Quote Current Input"
450 icicle-regexp-quote-input
451 :visible (not (and mark-active (> (region-end) (region-beginning)))))
452 ;; This one is not a toggle or cycle.
453 (regexp-quote-region menu-item "Regexp-Quote Input Region"
454 icicle-regexp-quote-input
455 :visible (and mark-active (> (region-end) (region-beginning))))
456 (next-thumbnail-setting menu-item "Next Image-File Thumbnail Setting"
457 icicle-cycle-image-file-thumbnail
458 :visible (fboundp 'icicle-cycle-image-file-thumbnail))
459 (oneoff-next-S-TAB menu-item "ONE-OFF Next S-TAB Completion Method"
460 icicle-next-S-TAB-completion-method
461 :visible current-prefix-arg)
462 (next-S-TAB menu-item "Next S-TAB Completion Method"
463 icicle-next-S-TAB-completion-method
464 :visible (not current-prefix-arg))
465 (oneoff-next-TAB menu-item "ONE-OFF Next TAB Completion Method"
466 icicle-next-TAB-completion-method
467 :visible current-prefix-arg)
468 (next-TAB menu-item "Next TAB Completion Method"
469 icicle-next-TAB-completion-method
470 :visible (not current-prefix-arg))
471 (using-~-for-home menu-item "Toggle Using `~' for $HOME"
472 icicle-toggle-~-for-home-dir)
473 (using-C-for-actions menu-item "Toggle Using `C-' for Actions"
474 icicle-toggle-C-for-actions)
475 (removing-dups menu-item "Toggle Duplicate Removal" icicle-toggle-transforming)
476 (proxy-candidates menu-item "Toggle Including Proxy Candidates"
477 icicle-toggle-proxy-candidates)
478 (case-sensitivity menu-item "Toggle Case Sensitivity (`C-A')"
479 icicle-toggle-case-sensitivity)
480 (highlighting-past menu-item "Toggle Highlighting Past Inputs"
481 icicle-toggle-highlight-historical-candidates)
482 (highlighting-saved menu-item "Toggle Highlighting Saved Candidates"
483 icicle-toggle-highlight-saved-candidates)
484 (WYSIWYG menu-item "Toggle WYSIWYG for `*Completions*'" icicle-toggle-WYSIWYG-Completions)
485 (angle-brackets menu-item "Toggle Using Angle Brackets" icicle-toggle-angle-brackets)
486 (remote-file-testing menu-item "Toggle Remote File Handling (`C-^')"
487 icicle-toggle-remote-file-testing)
488 (expanding-directories menu-item "Toggle Expanding Directories (`C-x /')"
489 icicle-toggle-expand-directory)
490 (ignored-files menu-item "Toggle Ignored File Extensions (`C-.')"
491 icicle-toggle-ignored-extensions)
492 (ignoring-space-prefix menu-item "Toggle Ignoring Space Prefix"
493 icicle-toggle-ignored-space-prefix)
494 (ignoring-comments menu-item "Toggle Ignoring Comments"
495 icicle-toggle-ignoring-comments)
496 (expanding-to-common menu-item "Toggle Common Match Expansion"
497 icicle-toggle-expand-to-common-match)
498 (hiding-common-match menu-item "Toggle Hiding Common Match (`C-x .')"
499 icicle-toggle-hiding-common-match)
500 (hiding-non-matching-lines menu-item "Toggle Hiding Non-Matching Lines (`C-u C-x .')"
501 icicle-toggle-hiding-non-matching-lines)
502 (completions-format menu-item "Toggle Horizontal/Vertical Layout"
503 icicle-toggle-completions-format)
504 (multi-completions menu-item "Toggle Showing Multi-Completions"
505 icicle-toggle-show-multi-completion)
506 (incremental-completion menu-item "Cycle Incremental Completion"
507 icicle-cycle-incremental-completion)
508 (icomplete-mode menu-item "Toggle Icomplete Mode"
509 icicle-toggle-icomplete-mode)
510 (matching-of-newlines menu-item "Toggle `.' Matching of Newlines Too"
511 icicle-toggle-dot)
512 (literal-vs-regexp menu-item "Toggle Escaping Special Chars"
513 icicle-toggle-regexp-quote)
514 (sep-toggle-2 "--")
515 (search-highlight-all menu-item "Toggle All-Current Search Highlighting (`C-^')"
516 icicle-toggle-highlight-all-current)
517 (search-complementing-domain menu-item "Toggle Searching Complement"
518 icicle-toggle-search-complementing-domain)
519 (search-whole-word menu-item "Toggle Whole-Word Searching (`M-q')"
520 icicle-toggle-search-whole-word)
521 (search-replace-whole menu-item "Toggle Replacing Whole Search Hit (`M-_')"
522 icicle-toggle-search-replace-whole)
523 (search-replace-common menu-item "Toggle Replacing Longest Common Match"
524 icicle-toggle-search-replace-common-match)
525 (search-cleanup menu-item "Toggle Removal of Search Highlighting (`C-.')"
526 icicle-toggle-search-cleanup)
527 (sep-toggle-1 "--")
528 (option menu-item "+ Toggle Option..." icicle-toggle-option
529 :visible (and current-prefix-arg (wholenump (prefix-numeric-value current-prefix-arg))))
530 (any-var menu-item "+ Toggle Any Variable..." icicle-toggle-option
531 :visible (and current-prefix-arg
532 (not (wholenump (prefix-numeric-value current-prefix-arg)))))
533 (boolean menu-item "+ Toggle Boolean Option..."
534 :visible (not current-prefix-arg))
535 ;; This one is not a toggle or cycle.
536 (reset-var menu-item "+ Set Any Variable to `nil'..." icicle-reset-option-to-nil
537 :visible current-prefix-arg)
538 ;; This one is not a toggle or cycle.
539 (reset-option menu-item "+ Set Option to `nil'..."icicle-reset-option-to-nil
540 :visible (not current-prefix-arg))
541 ;; This one is not a toggle or cycle.
542 (set-option-to-t menu-item "+ Set Option to `t'..." icicle-set-option-to-t
543 :visible (and current-prefix-arg (wholenump (prefix-numeric-value current-prefix-arg))))
544 ;; This one is not a toggle or cycle.
545 (set-var-to-t menu-item "+ Set Any Variable to `t'..." icicle-set-option-to-t
546 :visible (and current-prefix-arg
547 (not (wholenump (prefix-numeric-value current-prefix-arg)))))
548 ;; This one is not a toggle or cycle.
549 (set-boolean-to-t menu-item "+ Set Boolean Option to `t'..." icicle-set-option-to-t
550 :visible (not current-prefix-arg))))
551 "Submenu for toggling, cycling or changing a variable or a behavior.")
552
553 (defvar icicle-current-TAB-method nil
554 "*Current completion method for \
555 `\\<minibuffer-local-completion-map>\\[icicle-prefix-complete]'.")
556
557 (defconst icicle-doremi-submenu
558 '(doremi-menu
559 menu-item
560 "Do Re Mi"
561 (keymap
562 (zoom "*Completions* Zoom Factor (`C-x -')" icicle-doremi-zoom-Completions+
563 :visible (fboundp 'text-scale-increase) ) ; Emacs 23+.
564 (spacing "*Completions* Candidate Spacing (`C-x |')"
565 icicle-doremi-inter-candidates-min-spaces+)
566 (column-width "*Completions* Column Width (`C-x w')" icicle-doremi-candidate-width-factor+)
567 (swank-prefix "Swank Min Match Chars (`C-x 2')" icicle-doremi-increment-swank-prefix-length+
568 :visible (eq (icicle-current-TAB-method) 'swank))
569 (swank-timeout "Swank Timeout (`C-x 1')" icicle-doremi-increment-swank-timeout+
570 :visible (eq (icicle-current-TAB-method) 'swank))
571 (max-completions "Max # of Completions (`C-x #')" icicle-doremi-increment-max-candidates+)))
572 "Submenu for Do Re Mi incrementation operations.")
573
574 ;;(@* "User options, organized alphabetically, except for dependencies")
575
576 ;;; User options, organized alphabetically, except for dependencies --
577
578
579 ;;; But first some functions and a widget that are used in option definitions.
580
581 ;; Same as `naked-edmacro-parse-keys' in `naked.el'.
582 ;; Based on `edmacro-parse-keys' in standard library `edmacro.el'
583 ;; Differences are:
584 ;;
585 ;; 1. Addition of optional arg ANGLES.
586 ;; 2. Ensure same behavior as `edmacro-parse-keys', if ANGLES is non-nil.
587 ;; 2. Handle angle brackets, whether ANGLES is nil or non-nil.
588 ;; 3. Handle `TAB' correctly, if ANGLES is nil.
589 ;; 4. Handle names without angle brackets, if ANGLES is nil.
590 ;; 5. Works for all Emacs versions.
591 ;;
592 (defun icicle-edmacro-parse-keys (string &optional need-vector angles)
593 "Like `edmacro-parse-keys', but does not use angle brackets, by default.
594 Non-nil optional arg ANGLES means to use angle brackets, exactly like
595 `edmacro-parse-keys'. See `icicle-read-kbd-macro' for more about
596 ANGLES."
597 (let ((case-fold-search nil)
598 (len (length string)) ; We won't alter string in the loop below.
599 (pos 0)
600 (res []))
601 (while (and (< pos len) (string-match "[^ \t\n\f]+" string pos))
602 (let* ((word-beg (match-beginning 0))
603 (word-end (match-end 0))
604 (word (substring string word-beg len))
605 (times 1)
606 (key nil))
607 ;; Try to catch events of the form "<as df>".
608 (if (string-match "\\`<[^ <>\t\n\f][^>\t\n\f]*>" word)
609 (setq word (match-string 0 word)
610 pos (+ word-beg (match-end 0)))
611 (setq word (substring string word-beg word-end)
612 pos word-end))
613 (when (string-match "\\([0-9]+\\)\\*." word)
614 (setq times (string-to-number (substring word 0 (match-end 1)))
615 word (substring word (1+ (match-end 1)))))
616 (cond ((string-match "^<<.+>>$" word)
617 (setq key (vconcat (if (eq (key-binding [?\M-x])
618 'execute-extended-command)
619 [?\M-x]
620 (or (car (where-is-internal 'execute-extended-command)) [?\M-x]))
621 (substring word 2 -2) "\r")))
622
623 ;; Must test this before [ACHMsS]- etc., to prevent match.
624 ((or (equal word "REM") (string-match "^;;" word))
625 (setq pos (string-match "$" string pos)))
626
627 ;; Straight `edmacro-parse-keys' case - ensure same behavior.
628 ;; Includes same bugged handling of `TAB'. That is Emacs bug #12535.
629 ;; The bug fix is to add `TAB' to the list in this clause.
630 ((and angles (string-match "^\\(\\([ACHMsS]-\\)*\\)<\\(.+\\)>$" word)
631 (progn
632 (setq word (concat (substring word (match-beginning 1)
633 (match-end 1))
634 (substring word (match-beginning 3)
635 (match-end 3))))
636 (not (string-match "\\<\\(NUL\\|RET\\|LFD\\|ESC\\|SPC\\|DEL\\)$" word))))
637 (setq key (list (intern word))))
638
639 ;; NaKeD handling of <...>. Recognize it anyway, even without non-nil ANGLES.
640 ;; But unlike `edmacro-parse-keys', include <TAB>, to handle it correctly.
641 ((and (string-match "^\\(\\([ACHMsS]-\\)*\\)<\\(..+\\)>$" word)
642 (progn (setq word (concat (substring word (match-beginning 1) (match-end 1))
643 (substring word (match-beginning 3) (match-end 3))))
644 (not (string-match "\\<\\(NUL\\|RET\\|LFD\\|ESC\\|SPC\\|DEL\\|TAB\\)$"
645 word))))
646 (setq key (list (intern word))))
647
648 ;; NaKeD handling of names without <...>.
649 ((and (not angles)
650 (string-match "^\\(\\([ACHMsS]-\\)*\\)\\([^ \t\f\n][^ \t\f\n]+\\)$" word)
651 ;; Do not count `C-' etc. when at end of string.
652 (save-match-data (not (string-match "\\([ACHMsS]-.\\)+$" word)))
653 (progn (setq word (concat (substring word (match-beginning 1) (match-end 1))
654 (substring word (match-beginning 3) (match-end 3))))
655 (not (string-match "\\<\\(NUL\\|RET\\|LFD\\|ESC\\|SPC\\|DEL\\|TAB\\)$"
656 word))))
657 (setq key (list (intern word))))
658
659 (t
660 (let ((orig-word word)
661 (prefix 0)
662 (bits 0))
663 (while (string-match "^[ACHMsS]-." word)
664 (incf bits (cdr (assq (aref word 0) '((?A . ?\A-\^@) (?C . ?\C-\^@)
665 (?H . ?\H-\^@) (?M . ?\M-\^@)
666 (?s . ?\s-\^@) (?S . ?\S-\^@)))))
667 (incf prefix 2)
668 (callf substring word 2))
669 (when (string-match "^\\^.$" word)
670 (incf bits ?\C-\^@)
671 (incf prefix)
672 (callf substring word 1))
673 (let ((found (assoc word '(("NUL" . "\0") ("RET" . "\r") ("LFD" . "\n")
674 ("ESC" . "\e") ("SPC" . " ") ("DEL" . "\177")
675 ("TAB" . "\t")))))
676 (when found (setq word (cdr found))))
677 (when (string-match "^\\\\[0-7]+$" word)
678 (loop for ch across word
679 for n = 0 then (+ (* n 8) ch -48)
680 finally do (setq word (vector n))))
681 (cond ((= bits 0) (setq key word))
682 ((and (= bits ?\M-\^@) (stringp word) (string-match "^-?[0-9]+$" word))
683 (setq key (loop for x across word collect (+ x bits))))
684 ((/= (length word) 1)
685 (error "%s must prefix a single character, not %s"
686 (substring orig-word 0 prefix) word))
687 ((and (/= (logand bits ?\C-\^@) 0) (stringp word)
688 ;; Used to accept `.' and `?' here, but `.' is simply wrong,
689 ;; and `C-?' is not used (so use `DEL' instead).
690 (string-match "[@-_a-z]" word))
691 (setq key (list (+ bits (- ?\C-\^@) (logand (aref word 0) 31)))))
692 (t (setq key (list (+ bits (aref word 0)))))))))
693 (when key (loop repeat times do (callf vconcat res key)))))
694 (when (and (>= (length res) 4) (eq (aref res 0) ?\C-x) (eq (aref res 1) ?\( )
695 (eq (aref res (- (length res) 2)) ?\C-x) (eq (aref res (- (length res) 1)) ?\)))
696 (setq res (edmacro-subseq res 2 -2)))
697 (if (and (not need-vector)
698 (loop for ch across res
699 always (and (if (fboundp 'characterp) (characterp ch) (char-valid-p ch))
700 (let ((ch2 (logand ch (lognot ?\M-\^@))))
701 (and (>= ch2 0) (<= ch2 127))))))
702 (concat (loop for ch across res collect (if (= (logand ch ?\M-\^@) 0) ch (+ ch 128))))
703 res)))
704
705 ;; Same as `naked-read-kbd-macro' in `naked.el'.
706 (defun icicle-read-kbd-macro (start &optional end angles)
707 "Read the region as a keyboard macro definition.
708 Like `read-kbd-macro', but does not use angle brackets, by default.
709
710 With a prefix arg use angle brackets, exactly like `read-kbd-macro'.
711 That is, with non-nil arg ANGLES, expect key descriptions to use angle
712 brackets (<...>). Otherwise, expect key descriptions not to use angle
713 brackets. For example:
714
715 (icicle-read-kbd-macro \"mode-line\" t) returns [mode-line]
716 (icicle-read-kbd-macro \"<mode-line>\" t t) returns [mode-line]"
717 (interactive "r\P")
718 (if (stringp start)
719 (icicle-edmacro-parse-keys start end angles)
720 (setq last-kbd-macro (icicle-edmacro-parse-keys (buffer-substring start end) nil angles))))
721
722 (put 'icicle-kbd 'pure t)
723 ;; Same as `naked' in `naked.el'.
724 (defun icicle-kbd (keys &optional angles)
725 "Like `kbd', but does not use angle brackets, by default.
726 With non-nil optional arg ANGLES, expect key descriptions to use angle
727 brackets (<...>), exactly like `kbd'. Otherwise, expect key
728 descriptions not to use angle brackets. For example:
729
730 (icicle-kbd \"mode-line\") returns [mode-line]
731 (icicle-kbd \"<mode-line>\" t) returns [mode-line]
732
733 The default behavior lets you use, e.g., \"C-x delete\" and \"C-delete\"
734 instead of \"C-x <delete>\" and \"C-<delete>\"."
735 (icicle-read-kbd-macro keys nil angles))
736
737 ;; Must be before first use, which is currently in `icicle-buffer-candidate-key-bindings'.
738 (define-widget 'icicle-key-definition 'lazy
739 "Key definition type for Icicle mode keys.
740 A list of three components: KEY, COMMAND, CONDITION, that represents
741 an `icicle-mode-map' binding of COMMAND according to KEY, if CONDITION
742 evaluates to non-nil.
743
744 KEY is either a key sequence (string or vector) or a command.
745 COMMAND is a command.
746 CONDITION is a sexp.
747
748 If KEY is a command, then the binding represented is its remapping to
749 COMMAND."
750 :indent 1 :offset 0 :tag "" ; $$$$$ "Icicle Mode Key Definition"
751 :type
752 '(list
753 (choice
754 (key-sequence :tag "Key" :value [ignore])
755 ;; Use `symbolp' instead of `commandp', in case the library defining the
756 ;; command is not loaded.
757 (restricted-sexp :tag "Command to remap" :match-alternatives (symbolp) :value ignore))
758 ;; Use `symbolp' instead of `commandp'...
759 (restricted-sexp :tag "Command" :match-alternatives (symbolp) :value ignore)
760 (sexp :tag "Condition")))
761
762 (defcustom icicle-act-before-cycle-flag nil
763 "*Non-nil means act on current candidate, then cycle to next/previous.
764 Otherwise (nil), cycle to the next or previous candidate, and then act
765 on it.
766
767 This affects keys such as the following:
768
769 `C-down', `C-wheel-down', `C-next', `C-end',
770 `C-M-down', `C-M-wheel-down', `C-M-next', `C-M-end',
771 `C-S-down', `C-S-wheel-down', `C-S-next', `C-S-end'.
772
773 Note: A few Icicles commands ignore this setting, in order to \"do the
774 right thing\".
775
776 Remember that you can use multi-command `icicle-toggle-option' anytime
777 to toggle the option."
778 :type 'boolean :group 'Icicles-Key-Bindings :group 'Icicles-Miscellaneous)
779
780 (defcustom icicle-add-proxy-candidates-flag nil ; Toggle with `C-M-_'.
781 "*Non-nil means to include proxy candidates whenever possible.
782 A proxy candidate is a candidate (shown in `*Completions*' using face
783 `icicle-proxy-candidate') whose name is a placeholder for the real
784 candidate. The proxy candidate typically stands for some value
785 obtained from the cursor position or by some action such as clicking
786 the mouse. Example candidates include a color or file name, named by
787 proxy candidates such as `*copied foreground*' or `*file at point*'.
788
789 You can toggle this option at any time from the minibuffer using
790 `\\<minibuffer-local-completion-map>\\[icicle-toggle-proxy-candidates]'. However, for \
791 commands that provide many proxy candidates, if
792 the flag is off initially when input is read, then you must re-invoke
793 the completing command for the new value to take effect. (This is for
794 performance reasons.)
795
796 Remember that you can use multi-command `icicle-toggle-option' anytime
797 to toggle the option."
798 :type 'boolean :group 'Icicles-Matching)
799
800 (defcustom icicle-alternative-actions-alist ()
801 "*Alist of Emacs commands and alternative action functions.
802 This always overrides any alternative action defined by
803 `icicle-candidate-alt-action-fn'.
804
805 Each alist element has the form (COMMAND . FUNCTION), where COMMAND is
806 a command (a symbol) that reads input and FUNCTION is the
807 alternative-action function it uses. To disable alternative action
808 for a given command, use `ignore' as the FUNCTION.
809
810 This option has no effect on `icicle-all-candidates-list-alt-action',
811 that is, `M-|', but it does affect `C-|'."
812 :type '(alist
813 :key-type (symbol :tag "Command")
814 :value-type (function :tag "Alternative action (function)"))
815 :group 'Icicles-Miscellaneous)
816
817 (defcustom icicle-alternative-sort-comparer 'icicle-historical-alphabetic-p ; Toggle with `C-M-,'.
818 "*An alternative sort function, in place of `icicle-sort-comparer'.
819 You can swap this with `icicle-sort-comparer' at any time by using
820 `icicle-toggle-alternative-sorting' (\\<minibuffer-local-completion-map>\
821 `\\[icicle-toggle-alternative-sorting]' in the minibuffer)."
822 :type '(choice
823 (const :tag "None (do not sort)" nil)
824 (function :tag "Sorting Predicate" :value icicle-case-string-less-p)
825 (list :tag "Sorting Multi-Predicate"
826 (repeat (function :tag "Component Predicate"))
827 (choice
828 (const :tag "None" nil)
829 (function :tag "Final Predicate" :value icicle-case-string-less-p))))
830 :group 'Icicles-Completions-Display)
831
832 ;; Must be before `icicle-dot-string'.
833 (defconst icicle-anychar-regexp (let ((strg (copy-sequence "\\(.\\|[\n]\\)")))
834 (set-text-properties 0 (length strg)
835 '(display "." face highlight)
836 strg)
837 strg)
838 "Regexp that matches any single character, including newline.")
839
840 (defcustom icicle-anything-transform-candidates-flag nil
841 "*Non-nil means `icicle-anything' transforms completion candidates.
842 Function `anything-transform-candidates' is used for the transforming.
843
844 The advantage of a nil value is that `icicle-anything' then acts as a
845 multi-command: you can act on multiple candidates, or apply multiple
846 actions for the same candidate, within a single invocation of
847 `icicle-anything' (or related commands).
848
849 The advantage of a non-nil value is that some of the displayed
850 Anything candidates might be more readable.
851
852 This option has no effect if library `anything.el' cannot be loaded.
853
854 Remember that you can use multi-command `icicle-toggle-option' anytime
855 to toggle the option."
856 :type 'boolean :group 'Icicles-Completions-Display :group 'Icicles-Matching)
857
858 (defcustom icicle-apropos-complete-keys (if (> emacs-major-version 23) ; `S-TAB'
859 '([backtab])
860 '([S-tab] [S-iso-lefttab]))
861 ;; In Emacs 22 and later, `backtab' is the canonical key that represents both `S-tab' and
862 ;; `S-iso-lefttab', so in principle that could be used in the default value for Emacs 22+.
863 ;;
864 ;; In other words, the following should be sufficient:
865 ;; (if (> emacs-major-version 21)
866 ;; '([backtab])
867 ;; '([S-tab] [S-iso-lefttab]))
868 ;;
869 ;; However, some Emacs 22+ libraries, such as `info.el', are brain-dead and explicitly
870 ;; bind both `backtab' and `S-tab'. I filed Emacs bug #1281.
871 "*Key sequences to use for `icicle-apropos-complete'.
872 A list of values that each has the same form as a key-sequence
873 argument to `define-key'. It is a list mainly in order to accommodate
874 different keyboards - for example, `S-tab' and `S-iso-lefttab'."
875 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
876
877 (defcustom icicle-apropos-complete-no-display-keys '([C-M-S-tab] ; `C-M-S-TAB'
878 [C-M-S-iso-lefttab])
879 "*Key sequences to use for `icicle-apropos-complete-no-display'.
880 A list of values that each has the same form as a key-sequence
881 argument to `define-key'. It is a list mainly in order to accommodate
882 different keyboards - for example, `C-M-S-tab' and `C-M-S-iso-lefttab'."
883 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
884
885 (defcustom icicle-apropos-cycle-next-keys '([next]) ; `next'
886 "*Key sequences for apropos completion to cycle to the next candidate.
887 A list of values that each has the same form as a key-sequence
888 argument to `define-key'. It is a list mainly in order to accommodate
889 different keyboards.
890
891 Option `icicle-use-C-for-actions-flag' swaps these keys with
892 `icicle-apropos-cycle-next-action-keys'."
893 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
894
895 (defcustom icicle-apropos-cycle-next-action-keys '([C-next]) ; `C-next'
896 "*Keys for apropos completion to cycle next and perform action.
897 A list of values that each has the same form as a key-sequence
898 argument to `define-key'. It is a list mainly in order to accommodate
899 different keyboards.
900
901 Option `icicle-use-C-for-actions-flag' swaps these keys with
902 `icicle-apropos-cycle-next-keys'."
903 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
904
905 (defcustom icicle-apropos-cycle-next-alt-action-keys '([C-S-next]) ; `C-S-next'
906 "*Keys for apropos completion to cycle next and perform alt action.
907 A list of values that each has the same form as a key-sequence
908 argument to `define-key'. It is a list mainly in order to accommodate
909 different keyboards."
910 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
911
912 (defcustom icicle-apropos-cycle-next-help-keys '([C-M-next]) ; `C-M-next'
913 "*Keys for apropos completion to cycle next and show candidate help.
914 A list of values that each has the same form as a key-sequence
915 argument to `define-key'. It is a list mainly in order to accommodate
916 different keyboards."
917 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
918
919 (defcustom icicle-apropos-cycle-previous-keys '([prior]) ; `prior'
920 "*Key sequences for apropos completion to cycle to the previous candidate.
921 A list of values that each has the same form as a key-sequence
922 argument to `define-key'. It is a list mainly in order to accommodate
923 different keyboards.
924
925 Option `icicle-use-C-for-actions-flag' swaps these keys with
926 `icicle-apropos-cycle-previous-action-keys'."
927 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
928
929 (defcustom icicle-apropos-cycle-previous-action-keys '([C-prior]) ; `C-prior'
930 "*Keys for apropos completion to cycle previous and perform action.
931 A list of values that each has the same form as a key-sequence
932 argument to `define-key'. It is a list mainly in order to accommodate
933 different keyboards.
934
935 Option `icicle-use-C-for-actions-flag' swaps these keys with
936 `icicle-apropos-cycle-previous-keys'."
937 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
938
939 (defcustom icicle-apropos-cycle-previous-alt-action-keys '([C-S-prior]) ; `C-S-prior'
940 "*Keys for apropos completion to cycle previous and perform alt action.
941 A list of values that each has the same form as a key-sequence
942 argument to `define-key'. It is a list mainly in order to accommodate
943 different keyboards."
944 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
945
946 (defcustom icicle-apropos-cycle-previous-help-keys '([C-M-prior]) ; `C-M-prior'
947 "*Keys for apropos completion to cycle previous and show candidate help.
948 A list of values that each has the same form as a key-sequence
949 argument to `define-key'. It is a list mainly in order to accommodate
950 different keyboards."
951 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
952
953 (defcustom icicle-bookmark-name-length-max 70
954 "*Maximum number of characters used to name a bookmark.
955 When `icicle-bookmark-cmd' is used with a non-negative numeric prefix
956 arg, the name of the bookmark that is set has at most this many chars.
957
958 If you use Do Re Mi (library `doremi.el') then you can use
959 multi-command `icicle-increment-option' anytime to change the option
960 value incrementally."
961 :type 'integer :group 'Icicles-Miscellaneous)
962
963 (defcustom icicle-bookmark-refresh-cache-flag t
964 "*t means `icicle-bookmark' refreshes the bookmark-list cache.
965 Use nil to speed up `icicle-bookmark(-other-window)' if you have a lot
966 of bookmarks, at the cost of having the bookmark list possibly not be
967 up to date. Use t if you want to be sure the list is refreshed.
968
969 If nil, the list of bookmarks is updated only if you use `C-u'.
970 If t, the list is always updated unless you use `C-u'.
971
972 This affects only commands such as `icicle-bookmark' that use the full
973 bookmark list. It does not affect more specific Icicles bookmark
974 commands such as `\\[icicle-bookmark-dired-other-window]' or the use
975 of a negative prefix arg with
976 `\\[icicle-bookmark-cmd]'.
977
978 Regardless of the option value, the cache is refreshed whenever you
979 use `S-delete' to delete a candidate bookmark.
980
981 Remember that you can use multi-command `icicle-toggle-option' anytime
982 to toggle the option."
983 :type 'boolean :group 'Icicles-Completions-Display :group 'Icicles-Matching)
984
985 (defcustom icicle-buffer-candidate-key-bindings
986 `(
987 (,(icicle-kbd "C-x m") icicle-bookmark-non-file-other-window ; `C-x m'
988 (require 'bookmark+ nil t))
989 (,(icicle-kbd "C-x M -") icicle-remove-buffer-cands-for-mode t) ; `C-x M -'
990 (,(icicle-kbd "C-x M +") icicle-keep-only-buffer-cands-for-mode t) ; `C-x M +'
991 (,(icicle-kbd "C-x C-m -") icicle-remove-buffer-cands-for-derived-mode t) ; `C-x C-m -'
992 (,(icicle-kbd "C-x C-m +") icicle-keep-only-buffer-cands-for-derived-mode t) ; `C-x C-m +'
993 (,(icicle-kbd "C-x v -") icicle-remove-buffer-cands-for-visible t) ; `C-x v -'
994 (,(icicle-kbd "C-x v +") icicle-keep-only-buffer-cands-for-visible t) ; `C-x v +'
995 (,(icicle-kbd "C-x F" ) icicle-toggle-include-cached-files t) ; `C-x F'
996 (,(icicle-kbd "C-x R" ) icicle-toggle-include-recent-files t) ; `C-x R'
997 )
998 "*List of minibuffer key bindings for use with buffer-name completion.
999 The option value has the same form as that of option
1000 `icicle-top-level-key-bindings' (which see).
1001 Each list element is of custom type `icicle-key-definition' and has
1002 the form (KEY COMMAND CONDITION)."
1003 :type (if (> emacs-major-version 21)
1004 '(repeat icicle-key-definition)
1005 '(repeat
1006 (list
1007 (choice
1008 (restricted-sexp :tag "Key"
1009 :match-alternatives ((lambda (x) (or (stringp x) (vectorp x))))
1010 :value [ignore])
1011 (restricted-sexp :tag "Command to remap"
1012 ;; Use `symbolp' instead of `commandp', in case the library defining the
1013 ;; command is not loaded.
1014 :match-alternatives (symbolp) :value ignore))
1015 ;; Use `symbolp' instead of `commandp'...
1016 (restricted-sexp :tag "Command"
1017 :match-alternatives (symbolp) :value ignore)
1018 (sexp :tag "Condition"))))
1019 :group 'Icicles-Key-Bindings)
1020
1021 (defcustom icicle-buffer-extras nil
1022 "*List of additional buffer-name candidates added to the normal list.
1023 List elements are strings."
1024 :type '(repeat string) :group 'Icicles-Buffers :group 'Icicles-Matching)
1025
1026 (defcustom icicle-buffer-ignore-space-prefix-flag t
1027 "*Non-nil means ignore buffer-name completions that start with a space.
1028 You can toggle this option from the minibuffer using
1029 `\\<minibuffer-local-completion-map>\\[icicle-dispatch-M-_]' (except during Icicles searching). \
1030 You can also use
1031 multi-command `icicle-toggle-option' anytime to toggle the option."
1032 :type 'boolean :group 'Icicles-Buffers :group 'Icicles-Matching)
1033
1034 (defcustom icicle-buffer-include-cached-files-nflag (if (boundp 'most-positive-fixnum)
1035 (- most-positive-fixnum)
1036 -99999999)
1037 "*An integer > 0 means include cached files during buffer-name completion.
1038 This means names cached using the Emacs file-name cache - see (emacs)
1039 `File Name Cache'. An integer < 0 means do not include them.
1040 When they are included, the value is the maximum number of such
1041 candidates to include.
1042
1043 You can toggle this option (between + and -) using `C-x F' in the
1044 minibuffer during buffer-name completion."
1045 :type '(restricted-sexp :tag "Max number of cached file candidates (+/-)"
1046 :match-alternatives ((lambda (x) (and (integerp x) (not (zerop x)))))
1047 :value ignore)
1048 :group 'Icicles-Files :group 'Icicles-Buffers :group 'Icicles-Matching)
1049
1050 (defcustom icicle-buffer-include-recent-files-nflag (if (boundp 'most-positive-fixnum)
1051 (- most-positive-fixnum)
1052 -99999999)
1053 "*An integer > 0 means include recent files during buffer-name completion.
1054 This means file names managed by `recentf-mode' - see (emacs) `File
1055 Conveniences'. An integer < 0 means do not include them.
1056 When they are included, the value is the maximum number of such
1057 candidates to include.
1058
1059 You can toggle this option (between + and -) using `C-x R' in the
1060 minibuffer during buffer-name completion.
1061
1062 This option has no effect prior to Emacs 21 (no library `recentf.el')."
1063 :type '(restricted-sexp :tag "Max number of recent file candidates (+/-)"
1064 :match-alternatives ((lambda (x) (and (integerp x) (not (zerop x)))))
1065 :value ignore)
1066 :group 'Icicles-Files :group 'Icicles-Buffers :group 'Icicles-Matching)
1067
1068 (defcustom icicle-buffer-match-regexp nil
1069 "*nil or a regexp that buffer-name completion candidates must match.
1070 If nil, then this does nothing. If a regexp, then show only
1071 candidates that match it (and match the user input).
1072 See also `icicle-buffer-no-match-regexp'."
1073 :type '(choice
1074 (const :tag "None" nil)
1075 (regexp :value "^[^ ]"))
1076 :group 'Icicles-Buffers :group 'Icicles-Matching)
1077
1078 (defcustom icicle-buffer-no-match-regexp nil
1079 "*nil or a regexp that buffer-name completion candidates must not match.
1080 If nil, then this does nothing. If a regexp, then show only
1081 candidates that do not match it.
1082 See also `icicle-buffer-match-regexp'."
1083 :type '(choice (const :tag "None" nil)
1084 (regexp :value "^[ ]"))
1085 :group 'Icicles-Buffers :group 'Icicles-Matching)
1086
1087 (defcustom icicle-buffer-predicate nil
1088 "*nil or a predicate that buffer-name candidates must satisfy.
1089 If nil, then this does nothing. Otherwise, this is a function of one
1090 argument, a candidate, and only candidates that satisfy the predicate
1091 are displayed. For example, this value will show only buffers that
1092 are associated with files:
1093
1094 (lambda (bufname) (buffer-file-name (get-buffer bufname)))
1095
1096 This predicate is applied after matching against user input. It thus
1097 corresponds to `icicle-must-pass-after-match-predicate', not to
1098 `icicle-must-pass-predicate'."
1099 :type '(choice
1100 (const :tag "None" nil)
1101 (function :value (lambda (bufname) (buffer-file-name (get-buffer bufname)))))
1102 :group 'Icicles-Buffers :group 'Icicles-Matching)
1103
1104 (defcustom icicle-buffer-prefix-arg-filtering 'use-default
1105 "*Conditions that filter buffers for buffer-name candidates.
1106 This filtering is in addition to removing the names of minibuffers.
1107
1108 If the value is `use-default' then use the default Icicles behavior
1109 \(see the doc).
1110
1111 Otherwise, it is a list of conditions that are applied, in order,
1112 until one matches, to filter out buffers. If none match then no
1113 filtering is done.
1114
1115 Each condition is a list of two items: (PREF-ARG-TEST BUF-TEST).
1116
1117 PREF-ARG-TEST is a predicate that accepts a raw prefix argument value,
1118 such as is returned by `current-prefix-arg', as its argument.
1119
1120 If PREF-ARG-TEST returns non-nil then BUF-TEST is used to filter
1121 buffers (see next). If PREF-ARG-TEST returns nil then the next
1122 condition is checked, and so on. If none of the conditions match then
1123 no filtering is done.
1124
1125 BUF-TEST is a predicate that accepts a buffer as argument. If it
1126 returns non-nil then the name of that buffer is removed as a
1127 completion candidate. Alternatively, BUF-TEST can be the constant
1128 `nil', which has the same effect as applying (lambda (buf) nil) as the
1129 filter predicate: the buffer is not removed.
1130
1131 As an example, this value of `icicle-buffer-prefix-arg-filtering'
1132 provides the same behavior as value `use-default' (but it is slower):
1133
1134 (((lambda (cpa) ; (no prefix arg)
1135 (null cpa))
1136 nil) ; Any (no filtering)
1137
1138 ((lambda (cpa) ; `C-u C-u C-u'
1139 (and (consp cpa)
1140 (> (prefix-numeric-value cpa) 16)))
1141 (lambda (bf) (get-buffer-window bf 0))) ; Invisible
1142
1143 ((lambda (cpa) ; `C-u C-u'
1144 (and (consp cpa)
1145 (> (prefix-numeric-value cpa) 4)))
1146 (lambda (bf) (not (get-buffer-window bf 0)))) ; Visible
1147
1148 ((lambda (cpa) ; `C-u'
1149 (and (consp current-prefix-arg)
1150 (fboundp 'derived-mode-p)))
1151 (lambda (bf) ; Derived mode
1152 (not (derived-mode-p
1153 (with-current-buffer bf major-mode)))))
1154
1155 ((lambda (cpa) ; = 0
1156 (zerop (prefix-numeric-value cpa)))
1157 (lambda (bf)
1158 (let ((this-mode major-mode)) ; Same mode
1159 (with-current-buffer bf
1160 (not (eq major-mode this-mode))))))
1161
1162 ((lambda (cpa) ; < 0
1163 (< (prefix-numeric-value cpa) 0))
1164 (lambda (bf) ; Same frame
1165 (not (member bf (cdr (assq 'buffer-list (frame-parameters)))))))
1166
1167 ((lambda (cpa) ; > 0
1168 cpa)
1169 (lambda (bf) ; File or dir
1170 (and (not (buffer-file-name bf))
1171 (with-current-buffer bf
1172 (not (eq major-mode 'dired-mode)))))))
1173
1174 Note that when the buffer-name predicate returns non-nil the buffer
1175 name is removed as a candidate. Hence the descriptions in the
1176 comments above are opposite the predicates."
1177 :type '(choice
1178 (const :tag "Use the default Icicles behavior" use-default)
1179 (repeat :tag "Conditions tested in order, to filter buffer-name candidates"
1180 (list
1181 (function :tag "Predicate to test raw prefix arg"
1182 :value (lambda (cpa) (and (consp cpa) (> (prefix-numeric-value cpa) 16)))) ; C-u C-u C-u
1183 (choice
1184 (function :tag "Predicate to filter out a buffer name" ; Visible
1185 :value (lambda (bf) (get-buffer-window bf 0)))
1186 (const :tag "No filtering - include all buffer names" nil)))))
1187 :group 'Icicles-Buffers)
1188
1189 (defcustom icicle-buffer-require-match-flag nil
1190 "*Override `icicle-require-match-flag' for `icicle-buffer*' commands.
1191 Controls the REQUIRE-MATCH arg to `completing-read' and `read-file-name'.
1192 The possible values are as follows:
1193 - nil means this option imposes nothing on completion;
1194 the REQUIRE-MATCH argument provided to the function governs behavior
1195 - `no-match-required' means the same as a nil value for REQUIRE-MATCH
1196 - `partial-match-ok' means the same as a t value for REQUIRE-MATCH
1197 - `full-match-required' means the same as a non-nil, non-t value for
1198 REQUIRE-MATCH
1199
1200 Note: This option is provided mainly for use (binding) in
1201 `icicle-define-command' and `icicle-define-file-command'.
1202 You probably do not want to set this globally, but you can."
1203 :type '(choice
1204 (const :tag "Do not impose any match behavior" nil)
1205 (const :tag "Do not require a match" no-match-required)
1206 (const :tag "Require a partial match, with RET" partial-match-ok)
1207 (const :tag "Require a full match" full-match-required))
1208 :group 'Icicles-Buffers :group 'Icicles-Matching)
1209
1210 (defcustom icicle-buffer-skip-functions nil
1211 "*Hook run by `icicle-buffer' on each matching buffer name.
1212 The value is a list of functions. Each is applied to the buffer-name
1213 candidate (after transforming it, if it is a multi-completion), until
1214 one of them returns a non-nil value.
1215
1216 If any of the functions returns non-nil then the buffer content is not
1217 searched. Use this to skip visiting and trying to search non-text
1218 buffers, such as PDFs and images, or buffers that might be
1219 time-consuming to access.
1220
1221 See also the `icicle-buffer' doc for other ways to filter the set of
1222 candidate buffers."
1223 :type 'hook :group 'Icicles-Buffers :group 'Icicles-Matching)
1224
1225 (defcustom icicle-buffer-sort 'icicle-buffer-sort-*...*-last
1226 "*A sort function for buffer names, or nil.
1227 Examples of sort functions are `icicle-buffer-sort-*...*-last' and
1228 `string<'. If nil, then buffer names are not sorted."
1229 :type '(choice
1230 (const :tag "None" nil)
1231 (function :value icicle-buffer-sort-*...*-last))
1232 :group 'Icicles-Buffers :group 'Icicles-Completions-Display)
1233
1234 (defcustom icicle-buffers-ido-like-flag nil
1235 "*t means `icicle-buffer' and similar commands act more Ido-like.
1236 Specifically, those commands then bind these options to t:
1237 `icicle-show-Completions-initially-flag'
1238 `icicle-top-level-when-sole-completion-flag'
1239 `icicle-default-value'
1240
1241 Remember that you can use multi-command `icicle-toggle-option' anytime
1242 to toggle the option."
1243 :type 'boolean :group 'Icicles-Buffers :group 'Icicles-Completions-Display :group 'Icicles-Matching)
1244
1245 (defcustom icicle-candidate-action-keys '([C-return]) ; `C-return'
1246 "*Keys for acting on the current completion candidate.
1247 A list of values that each has the same form as a key-sequence
1248 argument to `define-key'. It is a list mainly in order to accommodate
1249 different keyboards."
1250 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
1251
1252 (defcustom icicle-candidate-help-keys '([C-M-return] ; `C-M-return'
1253 [C-help] ; `C-help'
1254 [C-M-help] ; `C-M-help'
1255 [C-f1] ; `C-f1'
1256 [C-M-f1]) ; `C-M-f1'
1257 "*Keys for showing help about the current completion candidate.
1258 A list of values that each has the same form as a key-sequence
1259 argument to `define-key'. It is a list mainly in order to accommodate
1260 different keyboards."
1261 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
1262
1263 (defcustom icicle-candidate-width-factor 80
1264 "*Percentage of widest candidate width to use for calculating columns.
1265 The number of columns of candidates displayed in `*Completions*' is no
1266 more than the window width divided by this percentage of the maximum
1267 candidate width.
1268
1269 Increasing this toward 100 spreads columns out. Decreasing it
1270 compresses columns together. The higher the value, the more
1271 candidates will form well-defined columns, but the likelier that
1272 horizontal space will be wasted between them. The lower the value,
1273 the more candidates will not line up in columns, but the less
1274 horizontal space will be wasted between them.
1275
1276 When most candidates are almost as wide as the widest candidate, a
1277 high value works well. When most candidates are much shorter than the
1278 widest candidate, a low value works well.
1279
1280 If you use Do Re Mi (library `doremi.el') then you can modify this
1281 option incrementally during completion, seeing the effect as it
1282 changes. Use `C-x w' from the minibuffer, then use the `right' and
1283 `left' arrow keys or the mouse wheel to increment and decrement the
1284 value. WYSIWYG.
1285
1286 If you use `doremi.el' then you can also use multi-command
1287 `icicle-increment-option' anytime to change the option value
1288 incrementally.
1289
1290 See also option `icicle-inter-candidates-min-spaces' and (starting
1291 with Emacs 23) option `icicle-Completions-text-scale-decrease'."
1292 :type 'integer :group 'Icicles-Completions-Display)
1293
1294 ;; Must be before `icicle-change-region-background-flag'.
1295 (defcustom icicle-mark-position-in-candidate 'input-end
1296 "*Position of mark when you cycle through completion candidates.
1297 This is the mark position in the minibuffer.
1298 Possible values are those for `icicle-point-position-in-candidate'."
1299 :type '(choice
1300 (const :tag "Leave mark at the beginning of the minibuffer input" input-start)
1301 (const :tag "Leave mark at the end of the minibuffer input" input-end)
1302 (const :tag "Leave mark at the beginning of the completion root" root-start)
1303 (const :tag "Leave mark at the end of the completion root" root-end))
1304 :group 'Icicles-Minibuffer-Display)
1305
1306 ;; Must be before `icicle-change-region-background-flag'.
1307 (defcustom icicle-point-position-in-candidate 'root-end
1308 "*Position of cursor when you cycle through completion candidates.
1309 This is the cursor position in the minibuffer.
1310 Possible values are:
1311 `input-start': beginning of the minibuffer input
1312 `input-end': end of the minibuffer input
1313 `root-start': beginning of the completion root
1314 `root-end': end of the completion root
1315 When input is expected to be a file name, `input-start' is just after
1316 the directory, which is added automatically during completion cycling.
1317 See also `icicle-mark-position-in-candidate'."
1318 :type '(choice
1319 (const :tag "Leave cursor at the beginning of the minibuffer input" input-start)
1320 (const :tag "Leave cursor at the end of the minibuffer input" input-end)
1321 (const :tag "Leave cursor at the beginning of the completion root" root-start)
1322 (const :tag "Leave cursor at the end of the completion root" root-end))
1323 :group 'Icicles-Minibuffer-Display)
1324
1325 (defcustom icicle-change-region-background-flag
1326 (not (eq icicle-point-position-in-candidate icicle-mark-position-in-candidate))
1327 "*Non-nil means use color `icicle-region-background' during input.
1328 See `icicle-region-background'. If you load library `hexrgb.el'
1329 before Icicles, then `icicle-region-background' will be a slightly
1330 different hue from your normal background color. This makes
1331 minibuffer input easier to read than if your normal `region' face were
1332 used. This has an effect only during minibuffer input. A non-nil
1333 value for this option is particularly useful if you use
1334 delete-selection mode.
1335
1336 Remember that you can use multi-command `icicle-toggle-option' anytime
1337 to toggle the option."
1338 :type 'boolean :group 'Icicles-Minibuffer-Display)
1339
1340 (defcustom icicle-change-sort-order-completion 7
1341 "*Whether `icicle-change-sort-order' uses completion, by default.
1342 The behavior of `icicle-change-sort-order' with no prefix arg depends
1343 on the option value as follows:
1344
1345 - nil means cycle to the next order; do not use completion to choose
1346 the new order.
1347
1348 - An integer means use completion if there are currently more than
1349 that number of sort orders to choose from. Otherwise, cycle next.
1350
1351 - Any other non-nil value means use completion."
1352 :type '(choice
1353 (integer :tag "Complete if more than this number of sort orders" :value 7)
1354 (const :tag "Complete always" :value t)
1355 (const :tag "Cycle always" :value nil))
1356 :group 'Icicles-Completions-Display :group 'Icicles-Matching)
1357
1358 (defcustom icicle-C-l-uses-completion-flag nil
1359 "*Non-nil means \\<minibuffer-local-completion-map>\
1360 `\\[icicle-retrieve-previous-input]' uses completion for choosing completion history
1361 entries, by default. Otherwise, it cycles among the possible previous
1362 inputs. You can override the behavior by using `C-u' with `\\[icicle-retrieve-previous-input]'.
1363
1364 Remember that you can use multi-command `icicle-toggle-option' anytime
1365 to toggle the option."
1366 :type 'boolean :group 'Icicles-Minibuffer-Display :group 'Icicles-Matching)
1367
1368 ;; Replace this list by your favorite color themes. Each must be the name of a defined function.
1369 ;; By default, this includes all color themes defined globally (variable `color-themes').
1370 ;;
1371 ;; NOTE: We need the `condition-case' because of a BUG in `directory-files' for Emacs 20.
1372 ;; Bug reported to `color-theme.el' maintainer 2009-11-22. The problem is that the default value
1373 ;; of `color-theme-libraries' concats `file-name-directory', which ends in `/', with `/themes',
1374 ;; not with `themes'. So the result is `...//themes'. That is tolerated by Emacs 21+
1375 ;; `directory-files', but not for Emacs 20. Until this `color-theme.el' bug is fixed, Emacs 20
1376 ;; users will need to manually load `color-theme-libraries.el'.
1377 (defcustom icicle-color-themes ()
1378 "*List of color themes to cycle through using `M-x icicle-color-theme'.
1379 Note: Starting with Color Theme version 6.6.0, you will need to put
1380 library `color-theme-library.el', as well as library `color-theme.el',
1381 in your `load-path'."
1382 :type 'hook :group 'Icicles-Miscellaneous)
1383
1384 (defcustom icicle-comint-dynamic-complete-replacements
1385 '((shell-command-completion 'icicle-shell-dynamic-complete-command) ; Emacs 24+
1386 (shell-dynamic-complete-command 'icicle-shell-dynamic-complete-command) ; Emacs 20-23
1387 (shell-dynamic-complete-environment-variable
1388 'icicle-shell-dynamic-complete-environment-variable)
1389 (shell-dynamic-complete-filename 'icicle-shell-dynamic-complete-filename)
1390 ((pcomplete-completions-at-point
1391 comint-filename-completion
1392 shell-filename-completion)
1393 (lambda () (and (comint-match-partial-filename) #'icicle-comint-dynamic-complete-filename)))
1394 )
1395 "*List of function replacements for `comint-dynamic-complete-functions'.
1396 Instead of using `comint-dynamic-complete-functions' as is, command
1397 `icicle-comint-dynamic-complete' uses a modified version of that list
1398 according to the value of this option.
1399
1400 You can use this option to provide Icicles completion for various
1401 modes that inherit from Comint mode or otherwise use
1402 `comint-dynamic-complete'.
1403
1404 Each option list element is itself a list of two elements, (OLD NEW).
1405 OLD specifies a function in `comint-dynamic-complete-functions'. NEW
1406 is a sexp that evaluates to an Icicles completion function to use
1407 instead of OLD.
1408
1409 If OLD is a symbol then the value of NEW, in effect, replaces OLD in
1410 `comint-dynamic-complete-functions'.
1411
1412 If OLD is a list then the value of NEW is inserted in
1413 `comint-dynamic-complete-functions' before whichever element of OLD
1414 occurs first in `comint-dynamic-complete-functions'. That ensures
1415 that NEW is invoked before OLD when attempting completion. OLD is
1416 invoked only if NEW cannot find a completion.
1417
1418 For example, this list element says to replace completion function
1419 `foo' by completion function `my-foo': (foo 'my-foo). And this one
1420 says to try completing with function `mine' before `foo' or `bar':
1421 \((foo bar) 'mine)."
1422 :type '(repeat (list
1423 (choice
1424 (symbol :tag "OLD to replace")
1425 (repeat :tag "OLD to insert before"
1426 (sexp :value pcomplete-completions-at-point)))
1427 (sexp :tag "NEW (must eval to completion function)")))
1428 :group 'Icicles-Miscellaneous)
1429
1430 (defcustom icicle-command-abbrev-alist ()
1431 "*Alist of command abbreviations and commands, with frequency of use.
1432 Each element has the form (COMMAND ABBREV N), where ABBREV is an
1433 abbreviation of COMMAND and N is the number of times COMMAND has been
1434 invoked via ABBREV. Both COMMAND and ABBREV are symbols."
1435 :type '(alist
1436 :key-type (symbol :tag "Command")
1437 :value-type (list (symbol :tag "Abbreviation") (integer :tag "Times Used")))
1438 :group 'Icicles-Matching)
1439
1440 (defcustom icicle-command-abbrev-match-all-parts-flag nil
1441 "*Non-nil means `icicle-command-abbrev' matches each command-name part.
1442 Otherwise, an abbrev need match only a prefix of the command name.
1443
1444 Remember that you can use multi-command `icicle-toggle-option' anytime
1445 to toggle the option."
1446 :type 'boolean :group 'Icicles-Matching)
1447
1448 (defcustom icicle-command-abbrev-priority-flag nil
1449 "*nil means commands take precedence over abbreviations for `\\<icicle-mode-map>\
1450 \\[icicle-command-abbrev]'.
1451
1452 Remember that you can use multi-command `icicle-toggle-option' anytime
1453 to toggle the option."
1454 :type 'boolean :group 'Icicles-Matching)
1455
1456 (defcustom icicle-complete-key-anyway-flag nil
1457 "*Non-nil means bind `S-TAB' for key completion even if already
1458 bound. If nil, then each of the keys in `icicle-key-complete-keys' is
1459 bound to `icicle-complete-keys' in each keymap of
1460 `icicle-keymaps-for-key-completion' only if `S-TAB' is not already
1461 bound in the keymap.
1462
1463 Note: the keys in `icicle-key-complete-keys' are always bound to
1464 `icicle-complete-keys' in `icicle-mode-map'. This option affects only
1465 the binding of those keys in `icicle-keymaps-for-key-completion'.
1466
1467 Remember that you can use multi-command `icicle-toggle-option' anytime
1468 to toggle the option."
1469 :type 'boolean :group 'Icicles-Key-Completion :group 'Icicles-Key-Bindings)
1470
1471 (when (fboundp 'map-keymap) ; Emacs 22+.
1472 (defcustom icicle-complete-keys-ignored-prefix-keys '([menu-bar icicles])
1473 "*Prefix keys for `icicle-complete-keys' to ignore.
1474 The value is a list of key sequences assumed to be prefix keys.
1475
1476 If `icicle-complete-keys' is bound to a key on one of these prefix
1477 keys then it does not complete that prefix key. Instead, it acts as
1478 though invoked at the top level. This lets you bind key completion to
1479 a key sequence that starts with a prefix key, so you can invoke it
1480 from there just as if you had invoked it at top level.
1481
1482 Here is an example of adding two such prefix keys using Customize:
1483
1484 Click [INS] to insert a new, empty entry.
1485 Type `M-s' in the edit field.
1486
1487 Click [INS] to insert another new, empty entry.
1488 Type `<menu-bar> <edit>' in the edit field.
1489
1490 Use the `State' menu to update the option value to reflect the edit.
1491
1492 This adds these two prefix keys to the option value:
1493
1494 * [134217843], which is represented externally by `M-s'
1495 * [menu-bar edit], which represents the `Edit' menu-bar menu.
1496
1497 This example means that if you bind `icicle-complete-keys' to a key on
1498 either of these prefix keys then invoking that key sequence will
1499 complete keys at the top level - it will not complete that prefix key."
1500 :type '(repeat (key-sequence :tag "Prefix Key" :value [ignore])) :group 'Icicles-Key-Bindings)
1501
1502 (defcustom icicle-complete-keys-self-insert-ranges ()
1503 "*Non-nil means `icicle-complete-keys' includes self-inserting keys.
1504 That means keys bound to `self-insert-command'.
1505
1506 For Emacs 22, this is effectively Boolean: any non-nil value allows
1507 all self-inserting keys as candidates.
1508
1509 In Emacs 23+, there are thousands of self-inserting keys, so it is not
1510 practical to allow all as candidates. Instead, a non-nil value is a
1511 list of character ranges of the form (MIN . MAX). Characters in the
1512 inclusive range MIN through MAX are possible key-completion
1513 candidates.
1514
1515 For Emacs 23+, if you use a non-nil value then use only small ranges
1516 for better performance, e.g., `((0 . 687))' covers Latin characters.
1517
1518 In general, leave the value as nil. Use `C-x 8 RET' in Emacs 23+ to
1519 insert characters by completing against their Unicode names. With
1520 Icicles, you can see the characters themselves in `*Completions*'
1521 whether you use key completion or `C-x 8 RET', but in both cases you
1522 complete against the character name.
1523
1524 `C-x 8 RET' is bound by default in Emacs to command `insert-char'
1525 \(called `ucs-insert' prior to Emacs 24). If you use my library
1526 `ucs-cmds.el' then you might want to remap that command to command
1527 `ucsc-insert', which is an enhancement.
1528
1529 For reference, below are the ranges supported by `C-x 8 RET' (Emacs
1530 23+). But unless you have a very powerful computer, choose only only
1531 one or two small ranges of characters you actually might use.
1532
1533 BMP ranges:
1534 (0 . 13311) = (#x0000 . #x33FF)
1535 (19904 . 19967) = (#x4DC0 . #x4DFF)
1536 (40960 . 55295) = (#xA000 . #x0D7FF)
1537 (64256 . 65533) = (#xFB00 . #xFFFD)
1538
1539 Upper ranges:
1540 (65536 . 79103) = (#x10000 . #x134FF)
1541 (118784 . 131071) = (#x1D000 . #x1FFFF)
1542 (917504 . 918015) = (#xE0000 . #xE01FF)"
1543 :type '(alist :key-type integer :value-type integer) :group 'Icicles-Key-Completion))
1544
1545 (defcustom icicle-completing-read+insert-keys '([(control meta shift ?c)]) ; `C-M-S-c'
1546 "*Key sequences to invoke `icicle-completing-read+insert'.
1547 A list of values that each has the same form as a key-sequence
1548 argument to `define-key'. It is a list mainly in order to accommodate
1549 different keyboards.
1550
1551 Such a key has no effect unless
1552 `icicle-completing-read+insert-candidates' is non-nil."
1553 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
1554
1555 (defcustom icicle-completion-history-max-length (if icicle-C-l-uses-completion-flag 1000 100)
1556 "*Maximum number of inputs to save in the completion history.
1557 This is the history that you access using \\<minibuffer-local-completion-map>\
1558 `\\[icicle-retrieve-previous-input]' and `\\[icicle-retrieve-next-input]'.
1559
1560 If you use Do Re Mi (library `doremi.el') then you can use
1561 multi-command `icicle-increment-option' anytime to change the option
1562 value incrementally."
1563 :type 'integer :group 'Icicles-Miscellaneous)
1564
1565 (defvar icicle-delete-candidate-object nil
1566 "Defines deletion action for command `icicle-delete-candidate-object'.
1567 The value can be a function or a symbol bound to an alist.
1568
1569 If the value is a function, then the function is called on the current
1570 completion candidate (a string) to delete some corresponding object.
1571
1572 If the value is a symbol (variable) bound to an alist, then
1573 `icicle-delete-current-candidate-object' is called to delete the
1574 corresponding object from that alist. If the variable is also a user
1575 option, then the option is saved after the candidate is deleted.
1576
1577 Note that if the value is a variable and you use multi-completion
1578 candidates during completion, then the alist value of the variable
1579 must itself contain multi-completions. Otherwise, no candidate will
1580 be deleted, because `icicle-delete-current-candidate-object' deletes
1581 the full candidate object.")
1582
1583 (defcustom icicle-completion-key-bindings
1584 `((,(icicle-kbd "M-return") icicle-candidate-read-fn-invoke t) ;`M-RET'
1585 ; (`M-return')
1586 (,(icicle-kbd "C-M-m") icicle-candidate-read-fn-invoke t) ;`M-RET'
1587 ; (`ESC RET')
1588 (,(icicle-kbd "C-S-return") icicle-candidate-alt-action t) ; `C-S-RET'
1589 ; (`C-S-return')
1590 (,(icicle-kbd "delete") icicle-remove-candidate t) ; `delete'
1591 (,(icicle-kbd "S-delete") icicle-delete-candidate-object t) ; `S-delete'
1592 (,(icicle-kbd "C-w") icicle-kill-region t) ; `C-w'
1593 (,(icicle-kbd "C-!") icicle-all-candidates-action t) ; `C-!'
1594 (,(icicle-kbd "C-|") icicle-all-candidates-alt-action t) ; `C-|'
1595 (,(icicle-kbd "M-!") icicle-all-candidates-list-action t) ; `M-!'
1596 (,(icicle-kbd "M-|") icicle-all-candidates-list-alt-action t) ; `M-|'
1597 (,(icicle-kbd "M-h") icicle-history t) ; `M-h'
1598 (,(icicle-kbd "M-pause") icicle-keep-only-past-inputs t) ; `M-pause'
1599 (,(icicle-kbd "C-pause") icicle-toggle-highlight-historical-candidates t) ; `C-pause'
1600 (,(icicle-kbd "S-pause") icicle-toggle-highlight-saved-candidates t) ; `S-pause'
1601 (,(icicle-kbd "C-S-pause") icicle-toggle-WYSIWYG-Completions t) ; `C-S-pause'
1602 ;;$$$$$$ (,(icicle-kbd "C-M-pause") 'icicle-other-history) ; `C-M-pause'
1603 (,(icicle-kbd "C-insert") icicle-switch-to-Completions-buf t) ; `C-insert'
1604 (,(icicle-kbd "insert") icicle-save/unsave-candidate t) ; `insert'
1605
1606 ;; In Emacs 22+, local is parent of local-completion
1607 ;; Note: `setup-keys.el' binds `C-o' to `1on1-fit-minibuffer-frame' if defined.
1608 (,(icicle-kbd "C-a") icicle-beginning-of-line+
1609 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-a'
1610 (,(icicle-kbd "C-e") icicle-end-of-line+
1611 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-e'
1612 (,(icicle-kbd "C-M-v") icicle-scroll-forward
1613 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-M-v'
1614 (,(icicle-kbd "C-M-S-v") icicle-scroll-backward
1615 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-M-V'
1616 ; (`C-M-S-v')
1617 (,(icicle-kbd "C-=") icicle-insert-string-from-variable
1618 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-='
1619 ;; Replaces `tab-to-tab-stop':
1620 (,(icicle-kbd "M-i") icicle-clear-current-history
1621 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-i'
1622 ;; Replaces `kill-sentence':
1623 (,(icicle-kbd "M-k") icicle-erase-minibuffer-or-history-element
1624 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-k'
1625 (,(icicle-kbd "M-o") icicle-insert-history-element
1626 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-o'
1627 (,(icicle-kbd "M-.") icicle-insert-string-at-point
1628 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-.'
1629 (,(icicle-kbd "C-x C-f") icicle-resolve-file-name
1630 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-x C-f'
1631 (,(icicle-kbd "M-:") icicle-pp-eval-expression-in-minibuffer
1632 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-:'
1633 (,(icicle-kbd "C-M-y") icicle-yank-secondary
1634 (and (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))
1635 (fboundp 'icicle-yank-secondary))) ; `C-M-y'
1636 (,(icicle-kbd "C-M-pause") icicle-other-history
1637 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-M-pause'
1638 (,(icicle-kbd "M-S-backspace") icicle-erase-minibuffer
1639 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-S-backspace'
1640 (,(icicle-kbd "M-S-delete") icicle-erase-minibuffer
1641 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-S-delete'
1642
1643 ;; Need `C-g', even if `minibuffer-local-completion-map' inherits from `minibuffer-local-map'.
1644 (,(icicle-kbd "C-g") icicle-abort-recursive-edit t) ; `C-g'
1645 (,(icicle-kbd "M-q") icicle-dispatch-M-q t) ; `M-q'
1646 (,(icicle-kbd "C-l") icicle-retrieve-previous-input t) ; `C-l'
1647 (,(icicle-kbd "C-S-l") icicle-retrieve-next-input t) ; `C-L' (`C-S-l')
1648 (,(icicle-kbd "M-$") icicle-candidate-set-truncate t) ; `M-$'
1649 (,(icicle-kbd "C-~") icicle-candidate-set-complement t) ; `C-~'
1650 (,(icicle-kbd "C--") icicle-candidate-set-difference t) ; `C--'
1651 (,(icicle-kbd "C-+") icicle-candidate-set-union t) ; `C-+'
1652 (,(icicle-kbd "C-*") icicle-candidate-set-intersection t) ; `C-*'
1653 (,(icicle-kbd "C->") icicle-candidate-set-save-more t) ; `C->'
1654 (,(icicle-kbd "C-M->") icicle-candidate-set-save t) ; `C-M->'
1655 (,(icicle-kbd "C-(") icicle-next-TAB-completion-method t) ; `C-('
1656 (,(icicle-kbd "M-(") icicle-next-S-TAB-completion-method t) ; `M-('
1657 (,(icicle-kbd "C-)") icicle-candidate-set-save-more-selected t) ; `C-)'
1658 (,(icicle-kbd "C-M-)") icicle-candidate-set-save-selected t) ; `C-M-)'
1659 (,(icicle-kbd "C-M-<") icicle-candidate-set-retrieve t) ; `C-M-<'
1660 (,(icicle-kbd "C-M-}") icicle-candidate-set-save-to-variable t) ; `C-M-}'
1661 (,(icicle-kbd "C-M-{") icicle-candidate-set-retrieve-from-variable t) ; `C-M-{'
1662 (,(icicle-kbd "C-}") icicle-candidate-set-save-persistently t) ; `C-}'
1663 (,(icicle-kbd "C-{") icicle-candidate-set-retrieve-persistent t) ; `C-{'
1664 (,(icicle-kbd "C-%") icicle-candidate-set-swap t) ; `C-%'
1665 (,(icicle-kbd "M-%") icicle-regexp-quote-input t) ; `M-%'
1666 (,(icicle-kbd "C-:") icicle-candidate-set-define t) ; `C-:'
1667 (,(icicle-kbd "C-M-j") icicle-insert-list-join-string t) ; `C-M-j'
1668 (,(icicle-kbd "C-,") icicle-change-sort-order t) ; `C-,'
1669 (,(icicle-kbd "C-M-\;") icicle-toggle-ignoring-comments t) ; `C-M-;'
1670 (,(icicle-kbd "C-`") icicle-toggle-regexp-quote t) ; `C-`'
1671 (,(icicle-kbd "C-M-.") icicle-toggle-dot t) ; `C-M-.'
1672 (,(icicle-kbd "C-M-`") icicle-toggle-literal-replacement t) ; `C-M-`'
1673 (,(icicle-kbd "C-<") icicle-candidate-set-retrieve-more t) ; `C-<'
1674 (,(icicle-kbd "C-M-_") icicle-toggle-proxy-candidates t) ; `C-M-_'
1675 (,(icicle-kbd "C-$") icicle-toggle-transforming t) ; `C-$'
1676 ;;; ;; In Emacs 22+, local is parent of local-completion
1677 ;;; ;; $$$$$$ Keep `C-?' also for a while, undocumented, for backward compatibility only.
1678 ;;; (,(icicle-kbd "C-?") icicle-minibuffer-help
1679 ;;; (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-?'
1680 (,(icicle-kbd "M-?") icicle-minibuffer-help
1681 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `M-?'
1682 (,(icicle-kbd "C-.") icicle-dispatch-C-. t) ; `C-.'
1683 (,(icicle-kbd "C-#") icicle-cycle-incremental-completion t) ; `C-#'
1684 (,(icicle-kbd "C-M-#") icicle-toggle-icomplete-mode t) ; `C-M-#'
1685 (,(icicle-kbd "C-\"") icicle-toggle-expand-to-common-match t) ; `C-"'
1686 (,(icicle-kbd "C-M-\"") icicle-cycle-expand-to-common-match t) ; `C-M-"'
1687 (,(icicle-kbd "M-\;") icicle-toggle-search-replace-common-match t) ; `M-;'
1688 (,(icicle-kbd "C-^") icicle-dispatch-C-^ t) ; `C-^'
1689 (,(icicle-kbd "C-M-^") icicle-toggle-completions-format t) ; `C-M-^'
1690 (,(icicle-kbd "C-S-a") icicle-toggle-case-sensitivity t) ; `C-A' (`C-S-a')
1691 (,(icicle-kbd "M-~") icicle-toggle-~-for-home-dir t) ; `M-~'
1692 (,(icicle-kbd "C-M-~") icicle-toggle-search-complementing-domain t) ; `C-M-~'
1693 (,(icicle-kbd "M-g") icicle-toggle-C-for-actions t) ; `M-g'
1694 (,(icicle-kbd "M-,") icicle-dispatch-M-comma t) ; `M-,'
1695 (,(icicle-kbd "C-M-,") icicle-toggle-alternative-sorting t) ; `C-M-,'
1696 (,(icicle-kbd "C-M-+") icicle-plus-saved-sort t) ; `C-M-+'
1697 (,(icicle-kbd "M-+") icicle-widen-candidates t) ; `M-+'
1698 (,(icicle-kbd "M-*") icicle-narrow-candidates t) ; `M-*'
1699 (,(icicle-kbd "M-&") icicle-narrow-candidates-with-predicate t) ; `M-&'
1700 (,(icicle-kbd "M-_") icicle-dispatch-M-_ t) ; `M-_'
1701 (,(icicle-kbd "C-M-&") icicle-save-predicate-to-variable t) ; `C-M-&'
1702 (,(icicle-kbd "S-SPC") icicle-apropos-complete-and-narrow t) ; `S-SPC'
1703 (,(icicle-kbd "S-return") icicle-apropos-complete-and-exit t) ; `S-return'
1704 (,(icicle-kbd "S-backspace") icicle-apropos-complete-and-widen t) ; `S-backspace'
1705 (,(icicle-kbd "C-v") icicle-scroll-Completions-forward t) ; `C-v'
1706 (,(icicle-kbd "M-v") icicle-scroll-Completions-backward t) ; `M-v'
1707 (,(icicle-kbd ".") icicle-insert-dot-command t) ; `.'
1708 (,(icicle-kbd "M-m") icicle-toggle-show-multi-completion t) ; `M-m'
1709 (,(icicle-kbd "M-r") icicle-roundup t) ; `M-r'
1710 (,(icicle-kbd "C-x .") icicle-dispatch-C-x. t) ; `C-x .'
1711 (,(icicle-kbd "C-x :") icicle-toggle-network-drives-as-remote t) ; `C-x :'
1712 (,(icicle-kbd "C-x /") icicle-toggle-expand-directory t) ; `C-x /'
1713 (,(icicle-kbd "C-x C-a") icicle-toggle-annotation t) ; `C-x C-a'
1714 (,(icicle-kbd "C-x C-0") icicle-recomplete-from-original-domain t) ; `C-x C-0'
1715 (,(icicle-kbd "C-x t") icicle-cycle-image-file-thumbnail ; `C-x t'
1716 (fboundp 'icicle-cycle-image-file-thumbnail))
1717 (,(icicle-kbd "C-x w") icicle-doremi-candidate-width-factor+ ; `C-x w'
1718 (fboundp 'doremi))
1719 (,(icicle-kbd "C-x |") icicle-doremi-inter-candidates-min-spaces+ ; `C-x |'
1720 (fboundp 'doremi))
1721 (,(icicle-kbd "C-x #") icicle-doremi-increment-max-candidates+ ; `C-x #'
1722 (fboundp 'doremi))
1723 (,(icicle-kbd "C-x -") icicle-doremi-zoom-Completions+ ; `C-x -'
1724 (and (fboundp 'doremi)
1725 (fboundp 'text-scale-increase)))
1726 (,(icicle-kbd "C-x 1") icicle-doremi-increment-swank-timeout+
1727 (and (fboundp 'doremi) (eq (icicle-current-TAB-method) 'swank)))
1728 ;; NO - NEED TO DO THE SWANK PART AT RUNTIME, in icicles-mode.el
1729 (,(icicle-kbd "C-x 2") icicle-doremi-increment-swank-prefix-length+
1730 (and (fboundp 'doremi) (eq (icicle-current-TAB-method) 'swank)))
1731 ;; `minibuffer-completion-help' got wiped out by remap for self-insert.
1732 (,(icicle-kbd "?") icicle-self-insert t) ; `?
1733 (,(icicle-kbd "SPC") icicle-self-insert t) ; " "
1734 ;; In Emacs 22+, local is parent of local-completion
1735 (,(icicle-kbd "C-j") icicle-insert-newline-in-minibuffer
1736 (not (eq minibuffer-local-map (keymap-parent minibuffer-local-completion-map)))) ; `C-j
1737 )
1738 "*List of minibuffer key bindings during completion in Icicle mode.
1739 The option value has the same form as that of option
1740 `icicle-top-level-key-bindings' (which see).
1741 Each list element is of custom type `icicle-key-definition' and has
1742 the form (KEY COMMAND CONDITION).
1743
1744 If you customize this option then you must exit and re-enter Icicle
1745 mode to ensure that the change takes effect. This is really necessary
1746 only if your changes would undefine a key.
1747
1748 For this option to have an effect upon startup, it must be set before
1749 you enter Icicle mode. This means that you must ensure that the code
1750 that sets it is invoked before you enter Icicle mode. If you use
1751 Customize to change this option, then ensure that the code inserted by
1752 Customize into your `user-init-file' or your `custom-file' is invoked
1753 before you enter Icicle mode."
1754 :type (if (> emacs-major-version 21)
1755 '(repeat icicle-key-definition)
1756 '(repeat
1757 (list
1758 (choice
1759 (restricted-sexp :tag "Key"
1760 :match-alternatives ((lambda (x) (or (stringp x) (vectorp x)))) :value [ignore])
1761 (restricted-sexp :tag "Command to remap"
1762 ;; Use `symbolp' instead of `commandp', in case the library defining the
1763 ;; command is not loaded.
1764 :match-alternatives (symbolp) :value ignore))
1765 ;; Use `symbolp' instead of `commandp'...
1766 (restricted-sexp :tag "Command"
1767 :match-alternatives (symbolp) :value ignore)
1768 (sexp :tag "Condition"))))
1769 :group 'Icicles-Key-Bindings)
1770
1771 (defcustom icicle-completion-list-key-bindings
1772 `(
1773 ;;; (,(icicle-kbd "C-?") icicle-minibuffer-help t) ; `C-?'
1774 (,(icicle-kbd "M-?") icicle-minibuffer-help t) ; `M-?'
1775 (,(icicle-kbd "q") icicle-abort-recursive-edit t) ; `q'
1776 (,(icicle-kbd "C-insert") icicle-insert-completion t) ; `C-insert'
1777 (,(icicle-kbd "down") icicle-next-line t) ; `down'
1778 (,(icicle-kbd "up") icicle-previous-line t) ; `up'
1779 (,(icicle-kbd "left") icicle-move-to-previous-completion t) ; `left'
1780 (,(icicle-kbd "backtab") icicle-move-to-previous-completion ; `S-TAB'
1781 (> emacs-major-version 23))
1782 (,(icicle-kbd "S-tab") icicle-move-to-previous-completion ; `S-TAB'
1783 (< emacs-major-version 24))
1784 (,(icicle-kbd "S-iso-lefttab") icicle-move-to-previous-completion ; `S-TAB'
1785 (< emacs-major-version 24))
1786 (,(icicle-kbd "right") icicle-move-to-next-completion t) ; `right'
1787 (,(icicle-kbd "C-i") icicle-move-to-next-completion t) ; `TAB'
1788 (,(icicle-kbd "tab") icicle-move-to-next-completion t) ; `TAB'
1789 ,@(and (boundp 'mouse-wheel-down-event) ; Emacs 22+
1790 `((,(vector mouse-wheel-down-event) icicle-scroll-Completions-backward t) ; `wheel-down'
1791 (,(vector mouse-wheel-up-event) icicle-scroll-Completions-forward t))) ; `wheel-up'
1792 (,(icicle-kbd "S-down-mouse-2") icicle-mouse-remove-candidate t) ; `S-mouse-2'
1793 (,(icicle-kbd "S-mouse-2") ignore t)
1794 (,(icicle-kbd "C-S-down-mouse-2") icicle-mouse-candidate-alt-action t) ; `C-S-mouse-2'
1795 (,(icicle-kbd "C-S-mouse-2") ignore t)
1796 (,(icicle-kbd "C-down-mouse-2") icicle-mouse-candidate-action t) ; `C-mouse-2'
1797 (,(icicle-kbd "C-mouse-2") ignore t)
1798 (,(icicle-kbd "C-M-down-mouse-2") icicle-mouse-help-on-candidate t) ; `C-M-mouse-2'
1799 (,(icicle-kbd "C-M-mouse-2") ignore t)
1800 (,(icicle-kbd "M-S-down-mouse-2") icicle-mouse-save/unsave-candidate t) ; `M-S-mouse-2'
1801 (,(icicle-kbd "M-S-mouse-2") ignore t)
1802 (,(icicle-kbd "M-down-mouse-2") icicle-mouse-candidate-read-fn-invoke t) ; `M-mouse-2'
1803 (,(icicle-kbd "M-mouse-2") ignore t)
1804 (,(icicle-kbd "C-down-mouse-3") icicle-Completions-mouse-3-menu t) ; `C-mouse-3'
1805 (,(icicle-kbd "C-mouse-3") ignore t)
1806 (,(icicle-kbd "M-down-mouse-3") icicle-mouse-candidate-set-save-more t) ; `M-mouse-3'
1807 (,(icicle-kbd "M-mouse-3") ignore t)
1808 (,(icicle-kbd "M-S-down-mouse-3") icicle-mouse-candidate-set-save t) ; `M-S-mouse-3'
1809 (,(icicle-kbd "M-S-mouse-3") ignore t)
1810 (,(icicle-kbd "mouse-3") icicle-mouse-save-then-kill t) ; `mouse-3'
1811 (,(icicle-kbd "C->") icicle-candidate-set-save-more t) ; `C->'
1812 (,(icicle-kbd "C-M->") icicle-candidate-set-save t) ; `C-M->'
1813 (,(icicle-kbd "C-)") icicle-candidate-set-save-more-selected t) ; `C-)'
1814 (,(icicle-kbd "C-M-)") icicle-candidate-set-save-selected t) ; `C-M-)'
1815 (,(icicle-kbd "C-M-<") icicle-candidate-set-retrieve t) ; `C-M-<'
1816 (,(icicle-kbd "C-l") icicle-retrieve-previous-input t) ; `C-l'
1817 (,(icicle-kbd "C-a") icicle-beginning-of-line+ t) ; `C-a'
1818 (,(icicle-kbd "C-e") icicle-end-of-line+ t) ; `C-e'
1819 )
1820 "*List of key bindings in `*Completions*' for use in Icicle mode.
1821 The option value has the same form as that of option
1822 `icicle-top-level-key-bindings' (which see).
1823 Each list element is of custom type `icicle-key-definition' and has
1824 the form (KEY COMMAND CONDITION).
1825
1826 If you customize this option then you must exit and re-enter Icicle
1827 mode to ensure that the change takes effect. This is really necessary
1828 only if your changes would undefine a key.
1829
1830 For this option to have an effect upon startup, it must be set before
1831 you enter Icicle mode. This means that you must ensure that the code
1832 that sets it is invoked before you enter Icicle mode. If you use
1833 Customize to change this option, then ensure that the code inserted by
1834 Customize into your `user-init-file' or your `custom-file' is invoked
1835 before you enter Icicle mode."
1836 :type (if (> emacs-major-version 21)
1837 '(repeat icicle-key-definition)
1838 '(repeat
1839 (list
1840 (choice
1841 (restricted-sexp :tag "Key"
1842 :match-alternatives ((lambda (x) (or (stringp x) (vectorp x)))) :value [ignore])
1843 (restricted-sexp :tag "Command to remap"
1844 ;; Use `symbolp' instead of `commandp', in case the library defining the
1845 ;; command is not loaded.
1846 :match-alternatives (symbolp) :value ignore))
1847 ;; Use `symbolp' instead of `commandp'...
1848 (restricted-sexp :tag "Command"
1849 :match-alternatives (symbolp) :value ignore)
1850 (sexp :tag "Condition"))))
1851 :group 'Icicles-Key-Bindings)
1852
1853 (defcustom icicle-Completions-display-min-input-chars 0
1854 "*`*Completions*' window is removed if fewer chars than this are input.
1855 You might want to set this to, say 1 or 2, to avoid display of a large
1856 set of candidates during incremental completion. The default value of
1857 0 causes this option to have no effect: `*Completions*' is never
1858 removed based only on the number of input characters.
1859
1860 If you use Do Re Mi (library `doremi.el') then you can use
1861 multi-command `icicle-increment-option' anytime to change the option
1862 value incrementally."
1863 :type 'integer :group 'Icicles-Completions-Display)
1864
1865 (defcustom icicle-completions-format (if (boundp 'completions-format) ; Defined in Emacs 23+.
1866 completions-format
1867 'horizontal)
1868 "*Layout of completion candidates in buffer `*Completions*'.
1869 `vertical' means display down columns first, then to the right.
1870 `horizontal' or nil means display across rows first, then down.
1871
1872 Note that multi-line candidates are always displayed in a single
1873 column, and in this case it makes no difference what the value of the
1874 option is - the effect is the same.
1875
1876 You can toggle this option at any time from the minibuffer using
1877 `\\<minibuffer-local-completion-map>\\[icicle-toggle-completions-format]'."
1878 :type '(choice
1879 (const :tag "Display vertically" vertical)
1880 (other :tag "Display horizontally" horizontal))
1881 :group 'Icicles-Completions-Display)
1882
1883 (defcustom icicle-move-Completions-frame 'right
1884 "*Non-nil means move `*Completions*' frame to the edge of the display.
1885 This is done by `icicle-candidate-action'.
1886 It only happens if `*Completions*' is alone in its frame.
1887 This can be useful to make `*Completions*' more visible.
1888 Possible values are `right', `left', and nil (do not move)."
1889 :type '(choice
1890 (const :tag "Move to right edge" right)
1891 (const :tag "Move to right edge" left)
1892 (const :tag "Do not move" nil))
1893 :group 'Icicles-Completions-Display)
1894
1895 (defcustom icicle-Completions-max-columns nil
1896 "*Maximum number of columns to use in buffer `*Completions*'.
1897 If nil, the number is calculated automatically. I recommend that you
1898 leave this nil and use options `icicle-inter-candidates-min-spaces'
1899 and `icicle-candidate-width-factor' to control columns and candidate
1900 spacing.
1901
1902 If the value is an integer and you use Do Re Mi (library `doremi.el')
1903 then you can use multi-command `icicle-increment-option' anytime to
1904 change the option value incrementally."
1905 :type '(choice
1906 (const :tag "Calculate columns automatically" nil)
1907 (integer :tag "Maximum number of columns" :value 1))
1908 :group 'Icicles-Completions-Display)
1909
1910 (defcustom icicle-Completions-mouse-3-menu-entries (if (fboundp 'doremi)
1911 `(,icicle-Completions-this-candidate-submenu
1912 ,icicle-Completions-sorting-submenu
1913 ,icicle-doremi-submenu
1914 ,icicle-Completions-save/retrieve-submenu
1915 ,icicle-Completions-sets-submenu
1916 ,icicle-Completions-toggle-submenu
1917 ,icicle-Completions-misc-submenu)
1918 `(,icicle-Completions-this-candidate-submenu
1919 ,icicle-Completions-sorting-submenu
1920 ,icicle-Completions-save/retrieve-submenu
1921 ,icicle-Completions-sets-submenu
1922 ,icicle-Completions-toggle-submenu
1923 ,icicle-Completions-misc-submenu))
1924 "*Entries for the `mouse-3' popup menu in `*Completions*'.
1925 The menu is created by `icicle-Completions-mouse-3-menu'.
1926
1927 The option value is a list. Each element defines a submenu or a menu
1928 item. A null element (`nil') is ignored.
1929
1930 Several alternative entry formats are available. When customizing,
1931 choose an alternative in the Customize `Value Menu'.
1932
1933 In this description:
1934 SYMBOL is a symbol identifying the menu entry.
1935 `menu-item' is just that text, literally.
1936 NAME is a string naming the menu item or submenu.
1937 COMMAND is the command to be invoked by an item.
1938 MENU-KEYMAP is a menu keymap or a var whose value is a menu keymap.
1939 KEYWORDS is a property list of menu keywords (`:enable',
1940 `:visible', `:filter', `:keys', etc.).
1941
1942 1. Single menu item. For a selectable item, use
1943 (SYMBOL menu-item NAME COMMAND . KEYWORDS). For a non-selectable
1944 item such as a separator, use (SYMBOL NAME) or
1945 (SYMBOL menu-item NAME nil . KEYWORDS).
1946
1947 2. Items taken from a menu-keymap variable, such as
1948 `menu-bar-edit-menu'. Just use the name of the variable (a
1949 symbol). The items appear at the top level of the popup menu, not
1950 in a submenu.
1951
1952 3. Submenu. Use (SYMBOL menu-item NAME MENU-KEYMAP . KEYWORDS) or
1953 (SYMBOL NAME . MENU-KEYMAP). Remember that MENU-KEYMAP can also be
1954 a variable (symbol) whose value is a menu keymap.
1955
1956 All of these are standard menu elements, with the exception of the use
1957 of a keymap variable to represent its value.
1958
1959 See also:
1960 * (elisp) Format of Keymaps
1961 * (elisp) Classifying Events
1962 * (elisp) Extended Menu Items
1963
1964 Example submenu element:
1965 (toto menu-item \"Toto\" menu-bar-toto-menu)
1966
1967 Example selectable menu-item element:
1968 (foo menu-item \"Foo\" foo-command
1969 :visible (not buffer-read-only))"
1970 :type '(repeat
1971 ;; $$$$$$ Perhaps should provide default :value for each choice.
1972 (choice
1973 ;; These could be combined, but it's better for users to see separate choices.
1974 (restricted-sexp
1975 :tag "Submenu (SYMBOL menu-item NAME MENU-KEYMAP . KEYWORDS) or (SYMBOL NAME . MENU-KEYMAP)"
1976 :match-alternatives
1977 ((lambda (x)
1978 (and (consp x) (symbolp (car x))
1979 (or (and (stringp (cadr x)) (cddr x)) ; (SYMBOL NAME . MENU-KEYMAP)
1980 ;; (SYMBOL menu-item NAME MENU-KEYMAP . KEYWORDS)
1981 (and (eq 'menu-item (cadr x))
1982 (stringp (car (cddr x)))
1983 (or (keymapp (car (cdr (cddr x)))) ; Can be a keymap var.
1984 (and (symbolp (car (cdr (cddr x))))
1985 (boundp (car (cdr (cddr x))))
1986 (keymapp (symbol-value (car (cdr (cddr x)))))))))))
1987 'nil))
1988 (restricted-sexp
1989 :tag "Items from a keymap variable's value."
1990 :match-alternatives ((lambda (x) (and (symbolp x) (keymapp (symbol-value x))))
1991 'nil))
1992 (restricted-sexp
1993 :tag "Selectable item (SYMBOL menu-item NAME COMMAND . KEYWORDS)"
1994 :match-alternatives ((lambda (x) (and (consp x) (symbolp (car x))
1995 (eq 'menu-item (cadr x))
1996 (stringp (car (cddr x)))
1997 (commandp (car (cdr (cddr x))))))
1998 'nil))
1999 (restricted-sexp
2000 :tag "Non-selectable item (SYMBOL NAME) or (SYMBOL menu-item NAME nil . KEYWORDS)"
2001 :match-alternatives ((lambda (x) (and (consp x) (symbolp (car x))
2002 (or (and (stringp (cadr x)) (null (caddr x)))
2003 (and (eq 'menu-item (cadr x))
2004 (stringp (car (cddr x)))
2005 (null (car (cdr (cddr x))))))))
2006 'nil))))
2007 :group 'Icicles-Completions-Display)
2008
2009 (when (fboundp 'text-scale-decrease) ; Emacs 23+
2010 (defcustom icicle-Completions-text-scale-decrease 0.75
2011 "*Initial height decrease for text in buffer `*Completions*'.
2012 A value of 0.0 means the height is not decreased at all.
2013 This is used as the argument to function `text-scale-decrease'.
2014
2015 If you use library Do Re Mi (library `doremi.el') then you can use
2016 `C-x -' to incrementally resize the text during completion.
2017
2018 If you use `doremi.el' then you can also use multi-command
2019 `icicle-increment-option' anytime to change the option value
2020 incrementally.
2021
2022 See also options `icicle-candidate-width-factor' and
2023 `icicle-inter-candidates-min-spaces'."
2024 :type 'number :group 'Icicles-Completions-Display))
2025
2026 (defcustom icicle-Completions-window-max-height 30
2027 "*Maximum height of `*Completions*' window, in lines.
2028 The window is fit to the buffer size, with this as maximum height.
2029 Not used if `*Completions*' is a special buffer with its own frame.
2030 Not used in Emacs releases prior to 21.
2031
2032 If you use Do Re Mi (library `doremi.el') then you can use
2033 multi-command `icicle-increment-option' anytime to change the option
2034 value incrementally."
2035 :type 'integer :group 'Icicles-Completions-Display)
2036
2037 (defcustom icicle-customize-save-flag t
2038 "*Non-nil means save some updated Icicles options when you quit Emacs.
2039 That is, add some functions to `kill-emacs-hook' that call
2040 `customize-save-variable'. Currently, this includes only function
2041 `icicle-command-abbrev-save', which saves updated option
2042 `icicle-command-abbrev-alist'.
2043
2044 Remember that you can use multi-command `icicle-toggle-option' anytime
2045 to toggle the option."
2046 :type 'boolean :group 'Icicles-Minibuffer-Display)
2047
2048 (defcustom icicle-customize-save-variable-function 'customize-save-variable
2049 "*Function used to save user option changes.
2050 I RECOMMEND that you do NOT change this.
2051
2052 The option value is a function that has the same signature as
2053 `customize-save-variable' (perhaps with additional arguments after VAR
2054 and VAL, the variable to save and its new value.
2055
2056 If you do not want changes that Icicles commands make to certain user
2057 options to be saved automatically, you can set this to the function
2058 \(symbol) `ignore'. If you want to use your own function to somehow
2059 save the current value, you can set this to your function."
2060 :type 'function :group 'Icicles-Miscellaneous)
2061
2062
2063 ;; Emacs 22-23 `cus-themes.el' has no `provide', and only Emacs 24 version
2064 ;; has `custom-available-themes'.
2065 (when (condition-case nil (require 'cus-theme nil t) (error nil)) ; Emacs 24+
2066
2067 (defcustom icicle-custom-themes ()
2068 "*List of custom themes to cycle through using `icicle-custom-theme'."
2069 :type '(repeat (restricted-sexp
2070 :match-alternatives
2071 ((lambda (symb) (memq symb (custom-available-themes))))))
2072 :group 'Icicles-Miscellaneous)
2073
2074 (defcustom icicle-custom-themes-accumulate-flag nil
2075 "*Non-nil does not disable other custom themes when cycling to a theme.
2076 Note: Setting this to non-nil can considerably slow down cycling. The
2077 more themes you cycle through, the slower it gets."
2078 :type 'boolean :group 'Icicles-Miscellaneous)
2079
2080 (defcustom icicle-custom-themes-update-flag nil
2081 "*Non-nil means choosing a custom theme saves the updated list of themes.
2082 This applies to commands `icicle-custom-theme' and
2083 `icicle-color-theme' and their respective options
2084 `icicle-custom-themes' and `icicle-color-themes'.
2085
2086 A prefix argument to `icicle-custom-theme' flips the option value for
2087 the current invocation of the command."))
2088
2089 (defcustom icicle-default-in-prompt-format-function (lambda (default) (format " (%s)" default))
2090 "*Function that formats the default value to include in the prompt.
2091 The function must accept the default value (a string) as its (first)
2092 argument and return a string, which is prepended to the first
2093 occurrence of `: ' in the prompt. This option has no effect unless
2094 `icicle-default-value' is t."
2095 :group 'Icicles-Miscellaneous :type 'function)
2096
2097 (defcustom icicle-default-cycling-mode 'prefix
2098 "*Default completion mode for per-mode cycling.
2099 When you hit a completion key (`TAB' or `S-TAB'), it sets the current
2100 completion mode (prefix or apropos, respectively). That determines
2101 the kind of completion to be used by the per-mode cycling keys.
2102
2103 This option controls which completion mode to use if you cycle using a
2104 per-mode key (e.g. `down') *before* hitting a completion key.
2105
2106 - `prefix' means cycle prefix completions
2107 - `apropos' means cycle apropos completions
2108 - Any other non-nil value means cycle inputs from the input history
2109 - nil means do not cycle - you must first hit a completion key
2110
2111 The per-mode cycling keys are the values of
2112 `icicle-modal-cycle-up-keys' (backward) and
2113 `icicle-modal-cycle-down-keys' (forward). By default, these are keys
2114 `up' and `down' as well as the mouse wheel.
2115
2116 For example, if the value is `prefix' (the default) then you can
2117 immediately cycle prefix completions using `up', `down', or the mouse
2118 wheel, without first hitting `TAB'.
2119
2120 Once you have used `TAB' or `S-TAB', the only way to traverse the
2121 history is using `M-p' and `M-n' (they always traverse the history).
2122
2123 This option affects only cycling with the per-mode keys. You can
2124 always use the mode-specific cycling keys instead to cycle according
2125 to a particular mode. The mode-specific keys are (by default):
2126
2127 - `end' and `home' for prefix completion
2128 - `next' and `prior' for apropos completion
2129
2130 \(By default there is no conflict between the cycling keys that are
2131 mode-specific and those that are per-mode. But if you customize them
2132 in such a way that you set a key to both, the mode-specific use takes
2133 priority.)
2134
2135 After you change the value of this option, toggle Icicle mode off,
2136 then on again, for the change to take effect in the same session."
2137 :type '(choice
2138 (const :tag "Prefix cycling for per-mode keys, by default" prefix)
2139 (const :tag "Apropos cycling for per-mode keys, by default" apropos)
2140 (const :tag "No per-mode cycling - invoke completion first (`TAB', `S-TAB')" nil)
2141 (other :tag "History cycling for per-mode keys, by default" t))
2142 :group 'Icicles-Key-Bindings)
2143
2144 (defcustom icicle-default-thing-insertion 'alternatives
2145 "*Behavior of successive `\\<minibuffer-local-map>\\[icicle-insert-string-at-point]'.
2146 If `alternatives', then the next function in the `car' of
2147 `icicle-thing-at-point-functions' is used to retrieve the text to be
2148 inserted.
2149 If `more-of-the-same', then the function that is the `cdr' of
2150 `icicle-thing-at-point-functions' is used to retrieve the text to be
2151 inserted."
2152 :type `(choice
2153 (const :tag ,(substitute-command-keys
2154 "Successive calls to `\\<minibuffer-local-map>\
2155 \\[icicle-insert-string-at-point]' use different text-grabbing functions.")
2156 alternatives)
2157 (const :tag ,(substitute-command-keys
2158 "Successive calls to `\\<minibuffer-local-map>\
2159 \\[icicle-insert-string-at-point]' grab more text at point.")
2160 more-of-the-same))
2161 :group 'Icicles-Key-Bindings)
2162
2163 ;; We don't use `define-obsolete-variable-alias' so that byte-compilation in older Emacs
2164 ;; works for newer Emacs too.
2165 (when (fboundp 'defvaralias) ; Emacs 22+
2166 (defvaralias 'icicle-init-value-flag 'icicle-default-value)
2167 (make-obsolete-variable 'icicle-init-value-flag 'icicle-default-value "2008-04-18"))
2168
2169 (defcustom icicle-default-value t
2170 "*How to treat the default value when reading minibuffer input.
2171 These are the possible option values:
2172
2173 nil - Do not insert default value or add it to prompt.
2174 t - Add default value to `completing-read' prompt.
2175 Do not insert it.
2176 `insert-start' - Insert default value and leave cursor at start.
2177 `insert-end' - Insert default value and leave cursor at end.
2178 `preselect-start' - Insert and preselect default value;
2179 leave cursor at beginning.
2180 `preselect-end' - Insert and preselect default value;
2181 leave cursor at end.
2182
2183 This option controls how a non-nil default-value argument to functions
2184 such as `completing-read', `read-file-name', `read-from-minibuffer',
2185 and `read-string' is handled.
2186
2187 When it is non-nil and the initial-input argument is nil or \"\", the
2188 default value can be inserted into the minibuffer as the initial
2189 input. For `completing-read', if the option value is `t' then the
2190 default value is added the prompt as a hint.
2191
2192 Adding the default value to the prompt corresponds to the more or less
2193 conventional behavior of vanilla Emacs. But vanilla Emacs does not do
2194 this systematically for `completing-read' (or for any of the
2195 input-reading functions). Instead, it hard-codes default values into
2196 prompts in the commands that call these functions.
2197
2198 By design, Icicles commands never add the default value to the prompt
2199 themselves. This includes Icicles versions of standard commands that
2200 might do so. Icicles instead tries to give you the choice, using
2201 option `icicle-default-value'.
2202
2203 Function `completing-read' is the only input-reading function for
2204 which Icicles adds the default value to the prompt (for option value
2205 `t'). Other such functions, like `(icicle-)read-from-minibuffer' and
2206 `(icicle-)read-file-name', treat empty input (just `RET') specially -
2207 see their doc for details.
2208
2209 Inserting the default value in the minibuffer as the initial input has
2210 the advantage of not requiring you to use `M-n' to retrieve it. It
2211 has the disadvantage of making you use `M-p' (or do something else) to
2212 get rid of the default value in the minibuffer if you do not want to
2213 use or edit it.
2214
2215 If you often want to use or edit the default value, then set
2216 `icicle-default-value' to non-nil and non-t. If you rarely do so,
2217 then set it to nil or t.
2218
2219 If the default value is inserted in the minibuffer, the value of this
2220 option also determines whether or not the inserted text is
2221 preselected, and where the cursor is left: at the beginning or end of
2222 the text.
2223
2224 Preselection can be useful in Delete Selection mode or PC Selection
2225 mode. It makes it easy to replace the value by typing characters, or
2226 delete it by hitting `C-d' or `DEL' (backspace). However, all of the
2227 initial input is lost if you type or hit `C-d' or `DEL'. That is
2228 inconvenient if you want to keep most of it and edit it only slightly.
2229
2230 My own preference for the option value is `insert-end', but the
2231 default value is `t', which is closest to what vanilla Emacs does."
2232 :type '(choice
2233 (const :tag "Do not insert default value or add it to prompt" nil)
2234 (const :tag "Add default value to prompt (do not insert in minibuffer)" t)
2235 (const :tag "Insert default value. Leave cursor at beginning" insert-start)
2236 (const :tag "Insert default value. Leave cursor at end" insert-end)
2237 (const :tag "Insert default value, select it, leave cursor at beginning" preselect-start)
2238 (const :tag "Insert default value, select it, leave cursor at end" preselect-end))
2239 :group 'Icicles-Miscellaneous)
2240
2241 (defcustom icicle-define-alias-commands-flag t
2242 "*Non-nil means define some commands that do not begin with `icicle-'.
2243 For convenience, a few top-level commands are defined, typically as
2244 aliases for commands with longer names. For example, command `toggle'
2245 is defined as an alias for command `icicle-toggle-option'. In any
2246 case, no such command is ever defined by Icicles if a function with
2247 the same name is already defined.
2248
2249 Remember that you can use multi-command `icicle-toggle-option' anytime
2250 to toggle the option."
2251 :type 'boolean :group 'Icicles-Miscellaneous)
2252
2253 (defcustom icicle-deletion-action-flag t
2254 "*Non-nil means `S-delete' during completion deletes the current object.
2255 More precisely, it deletes the object named by the current completion
2256 candidate, if a deletion action is defined for the current command.
2257 If no deletion action is defined, then the value of this option has no
2258 effect.
2259
2260 If you are worried about inadvertently deleting an object by
2261 accidentally hitting `S-delete', you can customize this to nil to
2262 inhibit `S-delete' object deletion during completion.
2263
2264 Remember that you can use multi-command `icicle-toggle-option' anytime
2265 to toggle the option."
2266 :type 'boolean :group 'Icicles-Miscellaneous)
2267
2268 (defcustom icicle-dot-show-regexp-flag nil
2269 "*Non-nil means show `icicle-anychar-regexp' explicitly for `.'.
2270 Otherwise, display it as a highlighted `.' only.
2271 This has no effect for Emacs versions prior to 21: acts as if non-nil.
2272
2273 Remember that you can use multi-command `icicle-toggle-option' anytime
2274 to toggle the option."
2275 :type 'boolean :group 'Icicles-Matching :group 'Icicles-Minibuffer-Display)
2276
2277 (defcustom icicle-dot-string "."
2278 "*String inserted by `icicle-insert-dot-command'.
2279 It is either \".\" or the value of `icicle-anychar-regexp'.
2280 You can toggle this at any time using command `icicle-toggle-dot',
2281 bound to \\<minibuffer-local-completion-map>`\\[icicle-toggle-dot]' during completion."
2282 :set (lambda (sym defs)
2283 (custom-set-default sym defs)
2284 (setq icicle-dot-string-internal icicle-dot-string))
2285 :type `(choice
2286 (const :tag "Match any char EXCEPT newline" ".")
2287 (const :tag "Match any char, including NEWLINE" ,icicle-anychar-regexp))
2288 :group 'Icicles-Matching :group 'Icicles-Minibuffer-Display)
2289
2290 (defcustom icicle-expand-input-to-common-match 4 ; Cycle with `C-M-"'.
2291 "*Expansion of your minibuffer input to the longest common match.
2292 The expansion replaces your input in the minibuffer.
2293
2294 See the Icicles doc, section `Expanded-Common-Match Completion' for
2295 information about what is meant by the \"longest\" common match.
2296
2297 This option controls when such expansion occurs. You can cycle among
2298 the possible values using \\<minibuffer-local-completion-map>\
2299 `\\[icicle-cycle-expand-to-common-match]' in the minibuffer.
2300
2301 0 Do not expand your input ever, except when you use `C-M-TAB' or
2302 `C-M-S-TAB', which does not display `*Completions*'.
2303
2304 1 Do not expand your input automatically, during incremental
2305 completion. Expand it only when you complete explictly, i.e., when
2306 you use `TAB' or `S-TAB'.
2307
2308 2 Like 1, but expand your input also when it matches only one
2309 completion candidate.
2310
2311 3 Like 2, but expand your input also during incremental prefix
2312 completion.
2313
2314 4 Expand your input always. Like 3, but expand it also during
2315 incremental apropos completion.
2316
2317 As the value increases there are thus more contexts in which your
2318 input can be expanded to the common match. The expansion contexts for
2319 each value include those for all lower values.
2320
2321 If you want to return to your original, unexpanded input, use \\<minibuffer-local-completion-map>\
2322 `\\[icicle-retrieve-previous-input]'.
2323
2324 For apropos completion, your input is, in general, a regexp. Setting
2325 the option to a value other than four (4) lets you more easily work
2326 with a regexp in the minibuffer for apropos completion - your regexp
2327 is not replaced automatically by the expanded common match.
2328
2329 If you want to just toggle between the current value of this option
2330 and one of the other values, then see also option
2331 `icicle-expand-input-to-common-match-alt'. You can toggle between the
2332 values of these two options using \\<minibuffer-local-completion-map>\
2333 `\\[icicle-toggle-expand-to-common-match]' in the minibuffer."
2334 :type '(choice
2335 (const :tag "Never expand (except for `C-M-TAB' and `C-M-S-TAB')" 0)
2336 (const :tag "No auto-expansion. Expand only for explicit completion" 1)
2337 (const :tag "Auto-expand when only one matching completion" 2)
2338 (const :tag "Auto-expand for prefix completion or when only one match" 3)
2339 (const :tag "Auto-expand always: both prefix and apropos completion" 4))
2340 :group 'Icicles-Matching)
2341
2342 (defcustom icicle-expand-input-to-common-match-alt 3 ; Toggle with `C-"'.
2343 "*Other value for toggling `icicle-expand-input-to-common-match'.
2344 The values of the two options should be different. The value choices
2345 are the same. You can use \\<minibuffer-local-completion-map>\
2346 `\\[icicle-toggle-expand-to-common-match]' to toggle between the two values."
2347 :type '(choice
2348 (const :tag "Never expand (except for `C-M-TAB' and `C-M-S-TAB')" 0)
2349 (const :tag "No auto-expansion. Expand only for explicit completion" 1)
2350 (const :tag "Auto-expand when only one completion candidate matches" 2)
2351 (const :tag "Auto-expand for prefix completion or when only one match" 3)
2352 (const :tag "Auto-expand always: both prefix and apropos completion" 4))
2353 :group 'Icicles-Matching)
2354
2355 (defcustom icicle-file-extras nil
2356 "*List of additional file-name candidates added to the normal list.
2357 List elements are strings."
2358 :type '(repeat string) :group 'Icicles-Files :group 'Icicles-Matching)
2359
2360 (defcustom icicle-file-match-regexp nil
2361 "*nil or a regexp that file-name completion candidates must match.
2362 If nil, then this does nothing. If a regexp, then show only
2363 candidates that match it (and match the user input).
2364 See also `icicle-file-no-match-regexp'."
2365 :type '(choice
2366 (const :tag "None" nil)
2367 (regexp :value "^[^.]"))
2368 :group 'Icicles-Files :group 'Icicles-Matching)
2369
2370 (defcustom icicle-file-no-match-regexp nil
2371 "*nil or a regexp that file-name completion candidates must not match.
2372 If nil, then this does nothing. If a regexp, then show only
2373 candidates that do not match it.
2374 See also `icicle-file-match-regexp'."
2375 :type '(choice
2376 (const :tag "None" nil)
2377 (regexp :value "^[.]"))
2378 :group 'Icicles-Files :group 'Icicles-Matching)
2379
2380 (defcustom icicle-file-predicate nil
2381 "*nil or a predicate that file-name candidates must satisfy.
2382 If nil, then this does nothing. Otherwise, this is a function of one
2383 argument, a candidate, and only candidates that satisfy the predicate
2384 are displayed. For example, this value will show only names of files
2385 with more than 5000 bytes:
2386
2387 (lambda (file) (and (numberp (nth 7 (file-attributes file)))
2388 (> (nth 7 (file-attributes file)) 5000)))
2389
2390 This predicate is applied after matching against user input. It thus
2391 corresponds to `icicle-must-pass-after-match-predicate', not to
2392 `icicle-must-pass-predicate'."
2393 :type '(choice
2394 (const :tag "None" nil)
2395 (function :value file-readable-p))
2396 :group 'Icicles-Files :group 'Icicles-Matching)
2397
2398 (defcustom icicle-file-require-match-flag nil
2399 "*Override `icicle-require-match-flag' for file-name completion.
2400 The possible values are as follows:
2401 - nil means this option imposes nothing on completion;
2402 the REQUIRE-MATCH argument provided to the function governs behavior
2403 - `no-match-required' means the same as a nil value for REQUIRE-MATCH
2404 - `partial-match-ok' means the same as a t value for REQUIRE-MATCH
2405 - `full-match-required' means the same as a non-nil, non-t value for
2406 REQUIRE-MATCH
2407
2408 Note: This option is provided mainly for use (binding) in
2409 `icicle-define-command' and `icicle-define-file-command'.
2410 You probably do not want to set this globally, but you can."
2411 :type '(choice
2412 (const :tag "Do not impose any match behavior" nil)
2413 (const :tag "Do not require a match" no-match-required)
2414 (const :tag "Require a partial match, with RET" partial-match-ok)
2415 (const :tag "Require a full match" full-match-required))
2416 :group 'Icicles-Files :group 'Icicles-Matching)
2417
2418 (defcustom icicle-file-sort nil
2419 "*A sort function for file names, or nil.
2420 Examples of sort functions are `icicle-dirs-first-p',
2421 `icicle-latest-access-first-p', and `icicle-latest-modification-first-p'.
2422 If nil, then file names are not sorted."
2423 :type '(choice
2424 (const :tag "None" nil)
2425 (function :value icicle-dirs-first-p))
2426 :group 'Icicles-Files :group 'Icicles-Completions-Display)
2427
2428 (defcustom icicle-files-ido-like-flag nil
2429 "*t means `icicle-file' and similar commands act more Ido-like.
2430 Specifically, those commands then bind these options to t:
2431 `icicle-show-Completions-initially-flag'
2432 `icicle-top-level-when-sole-completion-flag'
2433 `icicle-default-value'
2434 This option has no effect for Emacs 20.
2435
2436 Remember that you can use multi-command `icicle-toggle-option' anytime
2437 to toggle the option."
2438 :type 'boolean
2439 :group 'Icicles-Files :group 'Icicles-Completions-Display :group 'Icicles-Matching)
2440
2441 (defcustom icicle-filesets-as-saved-completion-sets-flag t
2442 "*Non-nil means you can use filesets to save candidates persistently.
2443 This means that you can save file-name candidates in a persistent
2444 Icicles saved completion set (cache file) or in in an Emacs fileset.
2445 It also means that an Icicles persistent completion set can contain
2446 filesets, in addition to file names: any number of filesets, and
2447 filesets of different type. Available only for Emacs 22 and later,
2448 and you must load library `filesets.el'.
2449
2450 Remember that you can use multi-command `icicle-toggle-option' anytime
2451 to toggle the option."
2452 :type 'boolean :group 'Icicles-Matching)
2453
2454 (defcustom icicle-find-file-expand-directory-flag nil
2455 "*Non-nil means that acting on a directory candidate descends into it.
2456 That is, instead of opening Dired on the directory, the current set of
2457 completion candidates are replaced by the contents of the directory.
2458
2459 You can toggle this option at any time from the minibuffer using
2460 `\\<minibuffer-local-completion-map>\\[icicle-toggle-expand-directory]'."
2461 :type 'boolean :group 'Icicles-Files :group 'Icicles-Miscellaneous)
2462
2463 (defun icicle-image-file-p (filename)
2464 "Return non-nil if FILENAME names an image file.
2465 The regexp value of `image-file-name-regexp' is used for the test.
2466 Returns nil if library `image-file.el' cannot be loaded, so use this
2467 only for Emacs 23 and later."
2468 (and (if (fboundp 'display-graphic-p) (display-graphic-p) window-system)
2469 (fboundp 'image-file-name-regexp)
2470 (require 'image-file nil t)
2471 (icicle-string-match-p (image-file-name-regexp) filename)))
2472
2473 (defcustom icicle-file-skip-functions '(icicle-image-file-p)
2474 "*Hook run by file-visiting commands on each matching file name.
2475 The value is a list of functions. Each is applied to the file-name
2476 candidate (after transforming it, if it is a multi-completion), until
2477 one of them returns a non-nil value.
2478
2479 If any of the functions returns non-nil then the file content is not
2480 searched. Use this to skip visiting and trying to search non-text
2481 files, such as PDFs and images, or files that might be time-consuming
2482 to access, such as compressed files.
2483
2484 Note that the file names passed to the hook can be absolute or
2485 relative, depending on the command used.
2486
2487 Also run by `icicle-buffer' on the names of files that are included
2488 from the set of recent files or from the Emacs file cache.
2489
2490 This option has no effect for Emacs versions prior to Emacs 23.
2491
2492 See also option `icicle-buffer-skip-functions'."
2493 :type 'hook :group 'Icicles-Files :group 'Icicles-Matching)
2494
2495 (defcustom icicle-functions-to-redefine
2496 `(;; bbdb-complete-name ; For older BBDB versions such as 2.35
2497 bbdb-complete-mail ; For BBDB versions such as 3.02 and later
2498 ,@(if (> emacs-major-version 23) '(comint-completion-at-point) '(comint-dynamic-complete))
2499 comint-dynamic-complete-filename comint-replace-by-expanded-filename
2500
2501 ;; Uncomment `dired-read-shell-command' and `read-shell-command' if you want Icicles completion for
2502 ;; shell commands. See http://www.emacswiki.org/Icicles_-_Shell-Command_Enhancements.
2503 ;; dired-read-shell-command read-shell-command
2504
2505 ess-complete-object-name gud-gdb-complete-command
2506 Info-goto-node Info-index
2507 Info-menu
2508 lisp-complete-symbol lisp-completion-at-point
2509 minibuffer-default-add-completions
2510 read-char-by-name read-color
2511 read-from-minibuffer read-string
2512 recentf-make-menu-items)
2513 "*List of symbols representing functions to be redefined in Icicle mode.
2514 In Icicle mode, each such FUNCTION is aliased to Icicles function
2515 `icicle-FUNCTION'. The original functions are restored when you exit
2516 Icicle mode, by aliasing each FUNCTION to `icicle-ORIG-FUNCTION', that
2517 is, using the prefix `icicle-ORIG-' instead of `icicle-'.
2518
2519 Aliasing takes place only if `icicle-ORIG-FUNCTION' is defined.
2520 Icicles predefines each `icicle-ORIG-FUNCTION' found in the default
2521 value, as well as each corresponding `icicle-FUNCTION' . If you add
2522 additional functions of your own choosing, then you will also need to
2523 define `icicle-ORIG-FUNCTION' and `icicle-FUNCTION' accordingly - see
2524 the Icicles code for examples.
2525
2526 If you customize this option, then you must exit and re-enter Icicle
2527 mode to ensure that the change takes effect.
2528
2529 For this option to have an effect upon startup, it must be set before
2530 you enter Icicle mode. This means that you must ensure that the code
2531 that sets it is invoked before you enter Icicle mode. If you use
2532 Customize to change this option, then ensure that the code inserted by
2533 Customize into your `user-init-file' or your `custom-file' is invoked
2534 before you enter Icicle mode.
2535
2536 See also option `icicle-top-level-key-bindings'.
2537
2538 Note: If you want the special Icicles completion for shell commands,
2539 then include these two functions in the option value:
2540 `dired-read-shell-command' and `read-shell-command'."
2541 :type '(repeat (restricted-sexp :tag "Command"
2542 ;; Use `symbolp' instead of `functionp' or `fboundp', in case the library
2543 ;; defining the function is not loaded.
2544 :match-alternatives (symbolp) :value ignore))
2545 :set (lambda (sym defs)
2546 (custom-set-default sym defs)
2547 (when (boundp 'icicle-mode-map) ; Avoid error on initialization.
2548 (icicle-redefine-standard-functions)))
2549 :initialize #'custom-initialize-default
2550 :group 'Icicles-Miscellaneous)
2551
2552 (defcustom icicle-guess-commands-in-path nil
2553 "*Non-nil means all shell commands are available for completion.
2554 This is used in Icicle mode whenever a shell-command is read.
2555
2556 If non-nil, then all executable files (or all files, if option
2557 `shell-completion-execonly' is nil) in your search path are included
2558 among the completion candidates, in addition to any commands that are
2559 guessed as being appropriate for the target files (e.g. marked files
2560 in Dired).
2561
2562 If non-nil and if option `icicle-shell-command-candidates-cache' is
2563 nil, then the list of commands is computed once and cached as the
2564 value of `icicle-shell-command-candidates-cache'. The particular
2565 non-nil value of `icicle-guess-commands-in-path' determines when the
2566 cache is filled, as follows:
2567
2568 - If the value is `load', then the cache is filled when Icicles is
2569 first loaded, and it is saved persistently.
2570
2571 - If the value is `first-use', then the cache is filled when you first
2572 complete a shell command, and the computed list is not saved
2573 persistently.
2574
2575 If the value is not `load', then whenever you enter Icicle mode the
2576 cache is emptied.
2577
2578 If your environment changes and you want to update the cached list,
2579 you can use command `icicle-recompute-shell-command-candidates'. With
2580 a prefix argument, that command also saves the cache persistently."
2581 :type '(choice
2582 (const :tag "Do not add shell commands from search path" nil)
2583 (const :tag "Compute shell commands from path when Icicles is loaded" load)
2584 (const :tag "Compute shell commands from path upon first use" first-use))
2585 :group 'Icicles-Miscellaneous)
2586
2587 (defcustom icicle-help-in-mode-line-delay 5
2588 "*Seconds to show help in the mode-line for individual completions.
2589 If buffer `*Completions*' is displayed, then use its mode-line.
2590 Otherwise, use the mode-line of the current buffer.
2591
2592 The help is shown when you cycle among completion candidates and when
2593 your input is completed (entirely) to a candidate.
2594
2595 Face `icicle-mode-line-help' is used for the help.
2596
2597 A value of zero means do not show such help at all. In any case, a
2598 user event (e.g. a key press) always interrupts this display.
2599
2600 Note that `post-command-hook' actions do not take place until this
2601 display is finished. For example, if the help is shown because your
2602 input is complete, then Icomplete will not show additional candidates
2603 \(e.g. with the same input as a prefix) until the mode-line help has
2604 finished. This is because Icomplete display is a `post-command-hook'
2605 action.
2606
2607 If you use library Do Re Mi (`doremi.el') then you can use
2608 multi-command `icicle-increment-option' anytime to change the option
2609 value incrementally."
2610 :type 'number :group 'Icicles-Completions-Display :group 'Icicles-Miscellaneous)
2611
2612 (defcustom icicle-hide-common-match-in-Completions-flag nil
2613 "*Non-nil means hide the common match for your input, in `*Completions*'.
2614 The common match used here is governed by option
2615 `icicle-expand-input-to-common-match'. It is elided using
2616 ellipsis (`...').
2617
2618 You can toggle this option during completion using `C-x .' (no prefix
2619 arg). You can also use multi-command `icicle-toggle-option' anytime
2620 to toggle the option.
2621
2622 See also option `icicle-hide-non-matching-lines-flag'."
2623 :type 'boolean :group 'Icicles-Miscellaneous)
2624
2625 (defcustom icicle-hide-non-matching-lines-flag nil
2626 "*Non-nil means hide search candidate lines that do not match input.
2627 This applies only to multi-line candidates in buffer `*Completions*'.
2628 Lines that do not contain text matched by your current
2629 minibuffer input are elided using ellipsis (`...').
2630
2631 You can toggle this option during completion using `C-u C-x .'. You
2632 can also use multi-command `icicle-toggle-option' anytime to toggle
2633 the option.
2634
2635 See also option `icicle-hide-common-match-in-Completions-flag'."
2636 :type 'boolean :group 'Icicles-Completions-Display)
2637
2638 (defcustom icicle-highlight-historical-candidates-flag t ; Toggle with `C-pause'.
2639 "*Non-nil means highlight `*Completions*' candidates that have been used.
2640 This is done using face `icicle-historical-candidate'.
2641 Historical candidates are those that you have entered (using `RET' or
2642 `S-RET') previously.
2643
2644 You can toggle this option from the minibuffer at any time using
2645 `C-pause'. You can also use multi-command `icicle-toggle-option'
2646 anytime to toggle the option."
2647 :type 'boolean :group 'Icicles-Completions-Display)
2648
2649 (defcustom icicle-highlight-input-completion-failure 'implicit-strict
2650 "*Non-nil means highlight the part of your input that does not complete.
2651 This is done using face `icicle-input-completion-fail' or
2652 `icicle-input-completion-fail-lax'.
2653
2654 You can use `\\<minibuffer-local-completion-map>\\[icicle-goto/kill-failed-input]' \
2655 to go to the start of the highlighted part.
2656 Repeat to kill it.
2657
2658 This highlighting can have a negative impact on performance, because
2659 it can mean recomputing completion candidates multiple times, in order
2660 to determine the longest part that completes. For this reason, you
2661 can fine tune when you want this highlighting to occur. The values of
2662 this option and options
2663 `icicle-highlight-input-completion-failure-delay' and
2664 `icicle-highlight-input-completion-failure-threshold' determine when
2665 the highlighting can take place.
2666
2667 In particular, highlighting the non-matching part of remote file names
2668 can be slow. Two values of this option allow remote file name
2669 highlighting: `always' and `explicit-remote'. The other values do not
2670 highlight remote file names. You probably do not want to use a value
2671 of `always'.
2672
2673 If the value is nil, then highlighting never occurs. If the value is
2674 `explicit-strict', `explicit', or `explicit-remote', then highlighting
2675 occurs only upon demand: when you hit `TAB' or `S-TAB' to request
2676 completion. If the value is `implicit-strict', `implicit', or
2677 `always', then highlighting occurs also when you update your input
2678 during incremental completion.
2679
2680 If the value is `implicit-strict' or `implicit', then highlighting
2681 occurs not only upon demand but also during incremental completion if
2682 `icicle-incremental-completion' is non-nil. Remember that you can
2683 cycle incremental completion, using `C-#' in the minibuffer.
2684
2685 I use a value of `implicit' myself, but the default value is
2686 `implicit-strict' because, depending on your setup and use cases,
2687 `implicit' can impact performance for file-name completion (which is
2688 lax, not strict). I suggest you try `implicit' to see - this feature
2689 is especially useful for file names.
2690
2691 Summary of choices for when to highlight:
2692
2693 nil Never
2694 `explicit-strict' When you hit `TAB'/`S-TAB' for strict completion
2695 `explicit' When you hit `TAB'/`S-TAB'
2696 `explicit-remote' When you hit `TAB'/`S-TAB', including remote files
2697 `implicit-strict' During strict completion
2698 `implicit' During lax or strict completion
2699 `always' Always, even for names of remote files
2700
2701 After highlighting, you can use `C-M-l' to move the cursor to the
2702 start of the mismatch, for editing there. You can use a second
2703 `C-M-l' to kill (delete) the mismatch up to the next input line (if
2704 any). You can repeat `C-M-l' to kill additional input lines.
2705
2706 See also:
2707 * `icicle-highlight-input-completion-failure-delay'
2708 * `icicle-highlight-input-completion-failure-threshold'"
2709 :type '(choice
2710 (const :tag "Never" nil)
2711 (const :tag "Explicit (`TAB'/`S-TAB') strict completion" explicit-strict)
2712 (const :tag "Explicit (`TAB'/`S-TAB') lax and strict completion" explicit)
2713 (const :tag "Explicit completion, even of remote file names" explicit-remote)
2714 (const :tag "Strict completion" implicit-strict)
2715 (const :tag "Lax and strict completion" implicit)
2716 (const :tag "Always (including for remote file names)" always))
2717 :group 'Icicles-Minibuffer-Display)
2718
2719 (defcustom icicle-highlight-input-completion-failure-delay 0.7
2720 "*Seconds to wait before highlighting non-completing part of your input.
2721 Zero means there is no wait.
2722
2723 If you use Do Re Mi (library `doremi.el') then you can use
2724 multi-command `icicle-increment-option' anytime to change the option
2725 value incrementally."
2726 :type 'number :group 'Icicles-Minibuffer-Display)
2727
2728 (defcustom icicle-highlight-input-completion-failure-threshold 1000
2729 "*More candidates means do not highlight non-completing part of input.
2730 See also `icicle-highlight-input-completion-failure'.
2731
2732 If you use Do Re Mi (library `doremi.el') then you can use
2733 multi-command `icicle-increment-option' anytime to change the option
2734 value incrementally."
2735 :type 'integer :group 'Icicles-Minibuffer-Display)
2736
2737 (defcustom icicle-highlight-input-initial-whitespace-flag t
2738 "*Non-nil means highlight initial whitespace in your input.
2739 This is done using face `icicle-whitespace-highlight'.
2740 Purpose: Otherwise, you might not notice that you accidentally typed
2741 some whitespace at the beginning of your input, so you might not
2742 understand the set of matching candidates (or lack thereof).
2743
2744 Note: Highlighting input completion failure (see option
2745 `icicle-highlight-input-completion-failure') subsumes
2746 initial-whitespace highlighting. This means that if no completion
2747 candidate starts with whitespace, and if Icicles is highlighting input
2748 completion failure, then only that highlighting is shown.
2749
2750 Remember that you can use multi-command `icicle-toggle-option' anytime
2751 to toggle the option."
2752 :type 'boolean :group 'Icicles-Minibuffer-Display)
2753
2754 (defcustom icicle-highlight-lighter-flag t
2755 "*Non-nil means highlight the `Icy' mode-line lighter during completion.
2756 See the Icicles doc, section `Nutshell View of Icicles', subsection
2757 `Completion Status Indicators' for more information.
2758
2759 Remember that you can use multi-command `icicle-toggle-option' anytime
2760 to toggle the option."
2761 :type 'boolean :group 'Icicles-Miscellaneous)
2762
2763 (defcustom icicle-highlight-saved-candidates-flag t ; Toggle with `S-pause'.
2764 "*Non-nil means highlight `*Completions*' candidates that have been saved.
2765 This is done using face `icicle-saved-candidate'.
2766 You save candidates using, for example, `C-M->'.
2767
2768 You can toggle this option from the minibuffer at any time using
2769 `S-pause'. You can also use multi-command `icicle-toggle-option'
2770 anytime to toggle the option."
2771 :type 'boolean :group 'Icicles-Completions-Display)
2772
2773 (defcustom icicle-icomplete-mode-max-candidates 30
2774 "*Automatically turn Icomplete mode off if there are more candidates.
2775 This takes effect (only) whenever there is an attempt to complete your
2776 input, whether that happens manually (`TAB', `S-TAB') or automatically
2777 due to Icicles incremental completion.
2778
2779 If Icomplete mode was enabled before completion was initiated, then it
2780 is reenabled when the number of candidates falls below the option
2781 value. Icicles does not turn Icomplete mode on unless it was on when
2782 the minibuffer was activated.
2783
2784 If the option value is not an integer, then it must be nil. In this
2785 case, Icicles does not turn Icomplete mode off and on.
2786
2787 \(Note that this is about Emacs `icomplete-mode', not Icicles
2788 incremental completion.)
2789
2790 This option has no effect for Emacs versions prior to Emacs 23."
2791 :type '(choice
2792 (integer :tag "Max number of candidates before inhibiting Icomplete mode" :value 10)
2793 (const :tag "No maximum - do not automatically inhibit Icomplete mode"))
2794 :group 'Icicles-Miscellaneous)
2795
2796 (defcustom icicle-ignore-comments-flag t
2797 "*Non-nil means `icicle-with-comments-hidden' hides comments.
2798 You can toggle this option using `C-M-;' in the minibuffer, but to see
2799 the effect you might need to invoke the current command again.
2800
2801 You can also use multi-command `icicle-toggle-option' anytime to
2802 toggle the option."
2803 :type 'boolean :group 'Icicles-Searching)
2804
2805 (defcustom icicle-ignored-directories (and (boundp 'vc-directory-exclusion-list)
2806 vc-directory-exclusion-list)
2807 "*Directories ignored by `icicle-locate-file'."
2808 :type '(repeat string) :group 'Icicles-Files)
2809
2810 ;; Do not check here whether (if (fboundp 'display-graphic-p) (display-graphic-p) window-system).
2811 ;; Do that only at runtime, where we display the thumbnails.
2812 (defcustom icicle-image-files-in-Completions (and (fboundp 'image-file-name-regexp) t)
2813 "*Non-nil means show thumbnail images for image files in `*Completions*'.
2814 This has no effect if your Emacs version does not have image support.
2815
2816 `nil' means show only file names.
2817 `image-only' means show only thumbnail images.
2818 `t' means show both file names and thumbnail images.
2819
2820 You can cycle the value during completion using `C-x t'."
2821 :type '(choice
2822 (const :tag "Both name and thumbnail" t)
2823 (const :tag "Thumbnail image only" image-only)
2824 (const :tag "File name only" nil))
2825 :group 'Icicles-Completions-Display)
2826
2827 (defcustom icicle-image-preview-in-tooltip (if icicle-image-files-in-Completions
2828 'full
2829 (if (boundp 'diredp-image-preview-in-tooltip)
2830 diredp-image-preview-in-tooltip
2831 (or (and (boundp 'image-dired-thumb-size)
2832 image-dired-thumb-size)
2833 100)))
2834 "*Whether & what kind of image preview to show in a *Completions* tooltip.
2835 The possible values are:
2836
2837 `nil' : do not show a tooltip preview
2838 integer N>0 : show a thumbnail preview of that size
2839 `full' : show a full-size preview of the image
2840
2841 A tooltip image preview is shown only if either
2842 `icicle-image-files-in-Completions' is nil or
2843 `icicle-image-preview-in-tooltip' is `full'. (A thumbnail tooltip
2844 preview is not shown on mouseover if thumbnails are already shown in
2845 `*Completions*'.)
2846
2847 To enable tooltip image preview you must turn on `tooltip-mode' and
2848 load library `image-dired.el'.
2849
2850 This option has no effect for Emacs versions prior to Emacs 22."
2851 :type '(choice
2852 (restricted-sexp :tag "Show a thumnail image of size"
2853 :match-alternatives ((lambda (x) (and (wholenump x) (not (zerop x))))))
2854 (const :tag "Show a full-size image preview" full)
2855 (const :tag "OFF: Do not show an image preview" nil))
2856 :group 'Icicles-Completions-Display)
2857
2858 (defcustom icicle-incremental-completion-delay 0.7
2859 "*Number of seconds to wait before updating `*Completions*' incrementally.
2860 There is no wait if the number of completion candidates is less than
2861 or equal to `icicle-incremental-completion-threshold'.
2862 See also `icicle-incremental-completion'.
2863
2864 If you use Do Re Mi (library `doremi.el') then you can use
2865 multi-command `icicle-increment-option' anytime to change the option
2866 value incrementally."
2867 :type 'number :group 'Icicles-Completions-Display)
2868
2869 (defcustom icicle-incremental-completion t ; Cycle with `C-#'.
2870 "*Non-nil means update `*Completions*' buffer incrementally as you type.
2871 nil means do not update `*Completions*' incrementally, as you type.
2872
2873 t means do nothing if `*Completions*' is not already displayed.
2874 Non-nil and non-t means display `*Completions*' and update it.
2875
2876 You can cycle this among the possible values using `C-#' from the
2877 minibuffer at any time.
2878
2879 Note: Incremental completion is effectively turned off when a remote
2880 file name is read, that is, whenever your file-name input matches a
2881 remote-file syntax.
2882
2883 See also `icicle-incremental-completion-delay' and
2884 `icicle-incremental-completion-threshold'."
2885 :type '(choice
2886 (const :tag "Do not update `*Completions*' incrementally" nil)
2887 (const :tag "Update `*Completions*' incrementally if already displayed" t)
2888 (other :tag "Update `*Completions*' incrementally always" always))
2889 :group 'Icicles-Completions-Display)
2890
2891 (defcustom icicle-incremental-completion-threshold 1000
2892 "*More candidates means apply `icicle-incremental-completion-delay'.
2893 See also `icicle-incremental-completion' and
2894 `icicle-incremental-completion-delay'.
2895 This threshold is also used to decide when to display the message
2896 \"Displaying completion candidates...\".
2897
2898 If you use Do Re Mi (library `doremi.el') then you can use
2899 multi-command `icicle-increment-option' anytime to change the option
2900 value incrementally."
2901 :type 'integer :group 'Icicles-Completions-Display)
2902
2903 (when (> emacs-major-version 21)
2904 (defcustom icicle-Info-visited-max-candidates 10
2905 "*Max number of Info index-entry candidates for visited highlighting.
2906 This is used for command `icicle-Info-index'.
2907
2908 If there are more than this many candidates matching your current
2909 index-topic input, then no attempt is made to higlight specially those
2910 that refer to nodes you have visited. Otherwise, they are highlighted
2911 using face `icicle-historical-candidate-other'.
2912
2913 Be aware that this highlighting can be costly, especially for large
2914 values of the option.
2915
2916 If you use `doremi.el' then you can use multi-command
2917 `icicle-increment-option' anytime to change the option value
2918 incrementally.
2919
2920 To turn the highlighting off, set the value to 0 or set option
2921 `icicle-highlight-historical-candidates-flag' to nil. You can toggle
2922 that option from the minibuffer anytime using `C-pause'."
2923 :type 'integer :group 'Icicles-Completions-Display :group 'Icicles-Matching))
2924
2925 (defcustom icicle-inhibit-advice-functions
2926 `(choose-completion choose-completion-string completing-read
2927 completion-setup-function
2928 ,@(and (not (fboundp 'read-shell-command)) '(dired-smart-shell-command)) ; Emacs < 23
2929 display-completion-list exit-minibuffer face-valid-attribute-values
2930 minibuffer-complete-and-exit mouse-choose-completion
2931 next-history-element read-face-name read-file-name
2932 ,@(and (fboundp 'read-number) '(read-number)) ; Emacs 22+
2933 ,@(and (not (fboundp 'read-shell-command)) '(shell-command shell-command-on-region)) ; Emacs < 23
2934 switch-to-completions completing-read-multiple)
2935 "*Functions that Icicles redefines, and for which advice is deactivated.
2936 Icicle mode deactivates all advice for such functions. The advice is
2937 reactivated when you leave Icicle mode."
2938 :type '(repeat (function :tag "Function for which Icicles deactivates advice"))
2939 :group 'Icicles-Miscellaneous)
2940
2941 (defcustom icicle-inhibit-ding-flag nil
2942 "*Non-nil means Icicles never uses an audible bell (ding).
2943 If nil, Icicles sometimes signals you with a sound.
2944
2945 Remember that you can use multi-command `icicle-toggle-option' anytime
2946 to toggle the option."
2947 :type 'boolean :group 'Icicles-Miscellaneous)
2948
2949 (defcustom icicle-input-string ".*"
2950 "*String to insert in minibuffer via `\\<minibuffer-local-completion-map>\
2951 \\[icicle-insert-string-from-variable]'.
2952 Typically, this is a regexp or a portion of a regexp."
2953 :type 'string :group 'Icicles-Miscellaneous)
2954
2955 (when (fboundp 'defvaralias) ; Emacs 22+
2956 (defvaralias 'icicle-key-descriptions-use-angle-brackets-flag
2957 'icicle-key-descriptions-use-<>-flag))
2958
2959 (defcustom icicle-inter-candidates-min-spaces 1
2960 "*Min number of spaces between candidates displayed in `*Completions*'.
2961 If you use Do Re Mi (library `doremi.el'), then you can modify this
2962 option incrementally during completion, seeing the effect as it
2963 changes. Use `\\<minibuffer-local-completion-map>\
2964 \\[icicle-doremi-inter-candidates-min-spaces+]' from the minibuffer, then use the `up' and
2965 `down' arrow keys or the mouse wheel to increment and decrement the
2966 value. WYSIWYG.
2967
2968 If you use `doremi.el' then you can also use multi-command
2969 `icicle-increment-option' anytime to change the option value
2970 incrementally.
2971
2972 See also option `icicle-candidate-width-factor' and (starting with
2973 Emacs 23) option `icicle-Completions-text-scale-decrease'."
2974 :type 'integer :group 'Icicles-Completions-Display)
2975
2976 (defcustom icicle-isearch-complete-keys '([C-M-tab] ; `M-TAB', `C-M-TAB'
2977 [(control meta ?i)]
2978 [M-tab] ; Replace vanilla.
2979 [escape tab])
2980 "*Key sequences to use for `icicle-isearch-complete'.
2981 A list of values that each has the same form as a key-sequence
2982 argument to `define-key'.
2983
2984 The default value includes `M-TAB', which replaces the vanilla binding
2985 of `isearch-complete'.
2986
2987 It also includes `ESC TAB' and `C-M-TAB', because some operating
2988 systems intercept `M-TAB' for their own use. (Note: For some versions
2989 of MS Windows, you can use (w32-register-hot-key [M-tab]) to allow
2990 Emacs to use `M-TAB'.)"
2991 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
2992
2993 (defcustom icicle-isearch-history-insert-keys '([(meta ?o)]) ; `M-o', like Icicles minibuffer
2994 "*Key sequences to use for `icicle-isearch-history-insert'.
2995 A list of values that each has the same form as a key-sequence
2996 argument to `define-key'."
2997 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
2998
2999 (defcustom icicle-key-complete-keys (if (> emacs-major-version 23) ; `S-TAB'
3000 '([backtab])
3001 '([S-tab] [S-iso-lefttab]))
3002 ;; In Emacs 22 and later, `backtab' is the canonical key that represents both `S-tab' and
3003 ;; `S-iso-lefttab', so that is used in the default value. If, for some reason, `backtab' is not being
3004 ;; translated to `S-tab' and `S-iso-lefttab' on your platform, you might want to customize the value
3005 ;; to ([S-tab] [S-iso-lefttab]). And if your Emacs version is 22 or later, please file an Emacs bug
3006 ;; about the lack of translation.
3007
3008 ;; The reason that the default value here is not just ([backtab]) for Emacs < 24 is that some Emacs
3009 ;; libraries, such as `info.el', explicitly bind both `backtab' and `S-tab'. I filed Emacs bug #1281,
3010 ;; which took care of this for Emacs 24+.
3011 "*Key sequences to use for `icicle-complete-keys'.
3012 A list of values that each has the same form as a key-sequence
3013 argument to `define-key'. It is a list mainly in order to accommodate
3014 different keyboards - for example, `S-tab' and `S-iso-lefttab'."
3015 :type '(repeat sexp) :group 'Icicles-Key-Completion :group 'Icicles-Key-Bindings)
3016
3017 (defcustom icicle-key-complete-keys-for-minibuffer '([M-backtab]) ; `M-S-TAB'
3018 "*Key sequences to use for `icicle-complete-keys' in the minibuffer.
3019 A list of values that each has the same form as a key-sequence
3020 argument to `define-key'.
3021
3022 Note: Some operating systems intercept `M-S-TAB' for their own use.
3023 For some versions of MS Windows, you can use
3024 \(w32-register-hot-key [M-S-tab]) to allow Emacs to use `M-S-TAB'."
3025 :type '(repeat sexp) :group 'Icicles-Key-Completion :group 'Icicles-Key-Bindings)
3026
3027 (defcustom icicle-key-descriptions-use-<>-flag nil
3028 "*Non-nil means Icicles key descriptions use angle brackets (<>).
3029 For example, non-nil gives `<mode-line>'; nil gives `mode-line'.
3030 This does not affect Emacs key descriptions outside of Icicles.
3031 This has no effect for versions of Emacs prior to 21, because
3032 they never use angle brackets.
3033
3034 Remember that you can use multi-command `icicle-toggle-option' anytime
3035 to toggle the option."
3036 :type 'boolean :group 'Icicles-Key-Completion :group 'Icicles-Minibuffer-Display)
3037
3038 (defcustom icicle-keymaps-for-key-completion
3039 '(bookmark-bmenu-mode-map bmkp-jump-map bmkp-jump-other-window-map
3040 calendar-mode-map dired-mode-map facemenu-keymap jde-mode-map jde-jdb-mode-map
3041 senator-mode-map srecode-mode-map synonyms-mode-map vc-dired-mode-map)
3042 "*List of keymaps in which to bind `S-TAB' to `icicle-complete-keys'.
3043 List elements are symbols that are bound to keymaps.
3044
3045 Each keymap should have at least one prefix key. `S-TAB' is bound in
3046 each keymap, so that you can use it to complete the prefix keys.
3047
3048 If one of the keymaps is not defined when Icicle mode is entered, then
3049 it is ignored. If you later define it, then just exit and reenter
3050 Icicle mode, to bind `S-TAB' in the newly defined map. For example,
3051 use `M-x icy-mode' twice after entering Calendar mode, to be able to
3052 complete `calendar-mode' prefix keys such as `A'.
3053
3054 Do not add `global-map' or any keymaps, such as `ctl-x-map', that are
3055 accessible from the global keymap to the list - they are already
3056 treated, by default.
3057
3058 Do not add any of the translation keymaps, `function-key-map',
3059 `key-translation-map', or `iso-transl-ctl-x-8-map' to the list - that
3060 will not work."
3061 :type '(repeat symbol) :group 'Icicles-Key-Completion :group 'Icicles-Key-Bindings)
3062
3063 (defcustom icicle-kill-visited-buffers-flag t
3064 "*Non-nil means kill buffers visited temporarily to search files.
3065 This applies to commands such as `icicle-find-file-of-content', which
3066 search files that match your completion input. If non-nil then any
3067 such buffers for files that you do not actually choose are killed when
3068 the command is finished. If nil then they are not killed.
3069
3070 However, note that for some commands a prefix argument can reverse the
3071 sense of this flag."
3072 :type 'boolean :group 'Icicles-Buffers :group 'Icicles-Files :group 'Icicles-Matching)
3073
3074 (when (boundp 'kmacro-ring) ; Emacs 22+
3075 (defcustom icicle-kmacro-ring-max (if (boundp 'most-positive-fixnum)
3076 most-positive-fixnum
3077 67108863) ; 1/2 of `most-positive-fixnum' on Windows.
3078 "*Icicles version of `kmacro-ring-max'.
3079 If you use Do Re Mi (library `doremi.el') then you can use
3080 multi-command `icicle-increment-option' anytime to change the option
3081 value incrementally."
3082 :type 'integer :group 'Icicles-Miscellaneous))
3083
3084 (defcustom icicle-levenshtein-distance 1
3085 "*Levenshtein distance allowed for strings to be considered as matching.
3086 Icicles matching function `icicle-levenshtein-match' considers a
3087 string to match another if the first string is within this distance of
3088 some substring of the second.
3089 This option is used only if you have library `levenshtein.el'.
3090
3091 If you use Do Re Mi (library `doremi.el') then you can use
3092 multi-command `icicle-increment-option' anytime to change the option
3093 value incrementally."
3094 :type 'integer :group 'Icicles-Matching)
3095
3096 ;; Note: If your copy of this file does not have the two-character string "^G^J"
3097 ;; (Control-G, Control-J) or, equivalently, \007\012, as the default value, you will want
3098 ;; to change the file to have that. To insert these control characters in the file, use
3099 ;; `C-q'. Emacs Wiki loses the ^G from the file, so I use \007, which works OK.
3100 ;;
3101 (defcustom icicle-list-join-string (let ((strg (copy-sequence "\007\012")))
3102 ;; Emacs 20 ignores `display', so don't bother.
3103 ;; Emacs 21 has a big bug, which interprets `display' badly.
3104 (when (> emacs-major-version 21) ; Avoid Emacs 21 bug.
3105 (set-text-properties 0 (length strg) '(display "\n") strg))
3106 strg)
3107 "*String joining items in a completion that is a list of strings.
3108 When a completion candidate is a list of strings, this string is used
3109 to join the strings in the list, for display and matching purposes.
3110 When completing input, you type regexps that match the strings,
3111 separating them pairwise by the value of `icicle-list-join-string'.
3112 Actually, what you enter is interpreted as a single regexp to be
3113 matched against the joined strings. Typically, the candidate list
3114 contains two strings: a name and its doc string.
3115
3116 A good value for this option is a string that:
3117 1) does not normally occur in doc strings,
3118 2) visually separates the two strings it joins, and
3119 3) is not too difficult or too long to type.
3120
3121 The default value is \"^G\^J\", that is, control-g followed by
3122 control-j (newline):
3123 1) ^G does not normally occur in doc strings
3124 2) a newline visually separates the multiple component strings, which
3125 helps readability in buffer `*Completions*'
3126 3) you can type the value using `C-q C-g C-q C-j'.
3127
3128 For readability (in Emacs 22 and later), the default value has a
3129 `display' property that makes it appear as simply a newline in
3130 `*Completions*' - the `^G' is hidden. you can also make the default
3131 value appear this way in your minibuffer input also, by using \
3132 `\\<minibuffer-local-completion-map>\\[icicle-insert-list-join-string].'
3133
3134 If you like the default value of `^G^J', but you prefer that the `^G'
3135 not be hidden, then just customize this option. In Customize, use
3136 `Show initial Lisp expression' after clicking the `State' button, to
3137 be able to edit the default value. Remove the `set-text-properties'
3138 expression, which sets text property `display' to \"\"."
3139 :type 'string :group 'Icicles-Completions-Display)
3140
3141 (defcustom icicle-list-nth-parts-join-string " "
3142 "*String joining candidate parts split by `icicle-list-use-nth-parts'.
3143 This has an effect on multi-completion candidates only, and only if
3144 the current command uses `icicle-list-use-nth-parts'."
3145 :type 'string :group 'Icicles-Completions-Display)
3146
3147 (defcustom icicle-max-candidates nil
3148 "*Non-nil means truncate completion candidates to at most this many.
3149 If you use library `doremi.el' then you can use `C-x #' during
3150 completion to increment or decrement the option value using the
3151 vertical arrow keys or the mouse wheel. A numeric prefix argument for
3152 `C-x #' sets the increment size. A plain prefix argument (`C-u')
3153 resets `icicle-max-candidates' to nil, meaning no truncation.
3154
3155 If the value is an integer and you use Do Re Mi (library `doremi.el')
3156 then you can use multi-command `icicle-increment-option' anytime to
3157 change the option value incrementally."
3158 :type '(choice
3159 (const :tag "None" nil)
3160 (integer :value 200))
3161 :group 'Icicles-Completions-Display :group 'Icicles-Matching
3162 :group 'Icicles-Buffers :group 'Icicles-Files)
3163
3164 (defcustom icicle-menu-items-to-history-flag t
3165 "*Non-nil means to add menu-item commands to the command history.
3166 This history is `extended-command-history'.
3167
3168 After you change the value of this option, toggle Icicle mode off,
3169 then on again, for the change to take effect in the same session.
3170
3171 Remember that you can use multi-command `icicle-toggle-option' anytime
3172 to toggle the option."
3173 :type 'boolean :group 'Icicles-Miscellaneous)
3174
3175 ;; Inspired from `icomplete-minibuffer-setup-hook'.
3176 (defcustom icicle-minibuffer-setup-hook nil
3177 "*Functions run at the end of minibuffer setup for Icicle mode."
3178 :type 'hook :group 'Icicles-Miscellaneous)
3179
3180 (defcustom icicle-minibuffer-key-bindings
3181 `(
3182 ;;; (,(icicle-kbd "C-?") icicle-minibuffer-help t) ; `C-?'
3183 (,(icicle-kbd "M-?") icicle-minibuffer-help t) ; `M-?'
3184 (,(icicle-kbd "M-S-backspace") icicle-erase-minibuffer t) ; `M-S-backspace'
3185 (,(icicle-kbd "M-S-delete") icicle-erase-minibuffer t) ; `M-S-delete'
3186 (,(icicle-kbd "M-.") icicle-insert-string-at-point t) ; `M-.'
3187 (,(icicle-kbd "C-x C-f") icicle-resolve-file-name t) ; `C-x C-f'
3188 (,(icicle-kbd "C-=") icicle-insert-string-from-variable t) ; `C-='
3189 (,(icicle-kbd "M-i") icicle-clear-current-history t) ; `M-i'
3190 (,(icicle-kbd "M-k") icicle-erase-minibuffer-or-history-element t) ; `M-k'
3191 (,(icicle-kbd "M-o") icicle-insert-history-element t) ; `M-o'
3192 (,(icicle-kbd "M-R") icicle-multi-inputs-act t) ; `M-R'
3193 (,(icicle-kbd "M-S") icicle-multi-inputs-save t) ; `M-S'
3194 (,(icicle-kbd "M-:") icicle-pp-eval-expression-in-minibuffer t) ; `M-:'
3195 (,(icicle-kbd "C-a") icicle-beginning-of-line+ t) ; `C-a'
3196 (,(icicle-kbd "C-e") icicle-end-of-line+ t) ; `C-e'
3197 (,(icicle-kbd "C-g") icicle-abort-recursive-edit t) ; `C-g'
3198 (,(icicle-kbd "C-M-S-t") icicle-top-level t) ; `C-M-S-t'
3199 ; ( `C-M-T')
3200 (,(icicle-kbd "C-M-v") icicle-scroll-forward t) ; `C-M-v'
3201 (,(icicle-kbd "C-M-S-v") icicle-scroll-backward t) ; `C-M-S-v'
3202 ; ( `C-M-V')
3203 (,(icicle-kbd "C-M-pause") icicle-other-history t) ; `C-M-pause'
3204 (,(icicle-kbd "C-j") icicle-insert-newline-in-minibuffer t) ; `C-j'
3205 (,(icicle-kbd "C-M-y") icicle-yank-secondary (fboundp 'icicle-yank-secondary)) ; `C-M-y'
3206 )
3207 "*List of minibuffer commands to bind for use in Icicle mode.
3208 These bindings are available in the minibuffer regardless of whether
3209 completion is available. See `icicle-completion-key-bindings' for
3210 bindings available only during completion.
3211
3212 The option value has the same form as that of option
3213 `icicle-top-level-key-bindings' (which see).
3214 Each list element is of custom type `icicle-key-definition' and has
3215 the form (KEY COMMAND CONDITION).
3216
3217 If you customize this option then you must exit and re-enter Icicle
3218 mode to ensure that the change takes effect. This is really necessary
3219 only if your changes would undefine a key.
3220
3221 For this option to have an effect upon startup, it must be set before
3222 you enter Icicle mode. This means that you must ensure that the code
3223 that sets it is invoked before you enter Icicle mode. If you use
3224 Customize to change this option, then ensure that the code inserted by
3225 Customize into your `user-init-file' or your `custom-file' is invoked
3226 before you enter Icicle mode."
3227 :type (if (> emacs-major-version 21)
3228 '(repeat icicle-key-definition)
3229 '(repeat
3230 (list
3231 (choice
3232 (restricted-sexp :tag "Key"
3233 :match-alternatives ((lambda (x) (or (stringp x) (vectorp x)))) :value [ignore])
3234 (restricted-sexp :tag "Command to remap"
3235 ;; Use `symbolp' instead of `commandp', in case the library defining the
3236 ;; command is not loaded.
3237 :match-alternatives (symbolp) :value ignore))
3238 ;; Use `symbolp' instead of `commandp'...
3239 (restricted-sexp :tag "Command"
3240 :match-alternatives (symbolp) :value ignore)
3241 (sexp :tag "Condition"))))
3242 :group 'Icicles-Key-Bindings)
3243
3244 (defcustom icicle-modal-cycle-down-keys ; `down', `wheel-down'
3245 (if (boundp 'mouse-wheel-down-event) ; Emacs 22+
3246 (list [down] (vector nil mouse-wheel-up-event) (vector mouse-wheel-up-event))
3247 '([down]))
3248 "*Key sequences to use for modal cycling to the next candidate.
3249 A list of values that each has the same form as a key-sequence
3250 argument to `define-key'. It is a list mainly in order to accommodate
3251 different keyboards.
3252
3253 Option `icicle-use-C-for-actions-flag' swaps these keys with
3254 `icicle-modal-cycle-down-action-keys'."
3255 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3256
3257 (defcustom icicle-modal-cycle-down-action-keys ; `C-down', `C-wheel-down'
3258 (if (boundp 'mouse-wheel-up-event) ; Emacs 22+
3259 (list
3260 [C-down]
3261 (vector nil (list 'control mouse-wheel-up-event))
3262 (vector (list 'control mouse-wheel-up-event)))
3263 '([C-down]))
3264 "*Keys for modal completion to cycle next and perform action.
3265 A list of values that each has the same form as a key-sequence
3266 argument to `define-key'. It is a list mainly in order to accommodate
3267 different keyboards.
3268
3269 Option `icicle-use-C-for-actions-flag' swaps these keys with
3270 `icicle-modal-cycle-down-keys'."
3271 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3272
3273 (defcustom icicle-modal-cycle-down-alt-action-keys ; `C-S-down', `C-S-wheel-down'
3274 (if (boundp 'mouse-wheel-up-event) ;Emacs22+
3275 (list
3276 [C-S-down]
3277 (vector nil (list 'control 'shift mouse-wheel-up-event))
3278 (vector (list 'control 'shift mouse-wheel-up-event)))
3279 '([C-S-down]))
3280 "*Keys for modal completion to cycle next and perform alt action.
3281 A list of values that each has the same form as a key-sequence
3282 argument to `define-key'. It is a list mainly in order to accommodate
3283 different keyboards."
3284 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3285
3286 (defcustom icicle-modal-cycle-down-help-keys ; `C-M-down', `C-M-wheel-down'
3287 (if (boundp 'mouse-wheel-up-event) ; Emacs 22+
3288 (list
3289 [C-M-down]
3290 (vector nil (list 'control 'meta mouse-wheel-up-event))
3291 (vector (list 'control 'meta mouse-wheel-up-event)))
3292 '([C-M-down]))
3293 "*Keys for modal completion to cycle next and show candidate help.
3294 A list of values that each has the same form as a key-sequence
3295 argument to `define-key'. It is a list mainly in order to accommodate
3296 different keyboards."
3297 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3298
3299 (defcustom icicle-modal-cycle-up-keys ; `up', `wheel-up'
3300 (if (boundp 'mouse-wheel-down-event) ; Emacs 22+
3301 (list
3302 [up]
3303 (vector nil mouse-wheel-down-event)
3304 (vector mouse-wheel-down-event))
3305 '([up]))
3306 "*Key sequences to use for modal cycling to the previous candidate.
3307 A list of values that each has the same form as a key-sequence
3308 argument to `define-key'. It is a list mainly in order to accommodate
3309 different keyboards.
3310
3311 Option `icicle-use-C-for-actions-flag' swaps these keys with
3312 `icicle-modal-cycle-up-action-keys'."
3313 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3314
3315 (defcustom icicle-modal-cycle-up-action-keys ; `C-up', `C-wheel-up'
3316 (if (boundp 'mouse-wheel-down-event) ; Emacs 22+
3317 (list
3318 [C-up]
3319 (vector nil (list 'control mouse-wheel-down-event))
3320 (vector (list 'control mouse-wheel-down-event)))
3321 '([C-up]))
3322 "*Keys for modal completion to cycle previous and perform action.
3323 A list of values that each has the same form as a key-sequence
3324 argument to `define-key'. It is a list mainly in order to accommodate
3325 different keyboards.
3326
3327 Option `icicle-use-C-for-actions-flag' swaps these keys with
3328 `icicle-modal-cycle-up-keys'."
3329 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3330
3331 (defcustom icicle-modal-cycle-up-alt-action-keys ; `C-S-up', `C-S-wheel-up'
3332 (if (boundp 'mouse-wheel-down-event) ; Emacs 22+
3333 (list
3334 [C-S-up]
3335 (vector nil (list 'control 'shift mouse-wheel-down-event))
3336 (vector (list 'control 'shift mouse-wheel-down-event)))
3337 '([C-S-up]))
3338 "*Keys for modal completion to cycle previous and perform alt action.
3339 A list of values that each has the same form as a key-sequence
3340 argument to `define-key'. It is a list mainly in order to accommodate
3341 different keyboards."
3342 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3343
3344 (defcustom icicle-modal-cycle-up-help-keys ; `C-M-up', `C-M-wheel-up'
3345 (if (boundp 'mouse-wheel-down-event) ; Emacs 22+
3346 (list
3347 [C-M-up]
3348 (vector nil (list 'control 'meta mouse-wheel-down-event))
3349 (vector (list 'control 'meta mouse-wheel-down-event)))
3350 '([C-M-up]))
3351 "*Keys for modal completion to cycle previous and show candidate help.
3352 A list of values that each has the same form as a key-sequence
3353 argument to `define-key'. It is a list mainly in order to accommodate
3354 different keyboards."
3355 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3356
3357 (defcustom icicle-no-match-hook nil
3358 "*List of hook functions run during completion when there are no matches."
3359 :type 'hook :group 'Icicles-Miscellaneous)
3360
3361 (defcustom icicle-option-type-prefix-arg-list '(direct inherit inherit-or-value direct-or-value
3362 inherit-or-regexp direct-or-regexp)
3363 "*Symbols controlling prefix args for `icicle-describe-option-of-type'.
3364 A list of six symbols taken from this list:
3365
3366 direct inherit inherit-or-value
3367 direct-or-value inherit-or-regexp direct-or-regexp
3368
3369 Choose the order you like. The list members map, in order left to
3370 right, to these prefix argument keys:
3371
3372 `C-u C-u' `C-0' `C-u'
3373 `C-9' (positive) no prefix arg `C--' (negative)
3374
3375 For the meanings of the symbols, see the doc string of
3376 `icicle-describe-option-of-type', which describes the default
3377 prefix-argument bindings for the command."
3378 :type '(list symbol symbol symbol symbol symbol symbol) :group 'Icicles-Key-Bindings)
3379
3380 (defcustom icicle-network-drive-means-remote-flag t
3381 "*Non-nil means that a file on a network drive is considered remote.
3382 This pertains to an MS Windows mapped netword drive, such as `f:'.
3383
3384 You can use `C-x :' during completion to toggle this option."
3385 :type 'boolean :group 'Icicles-Files)
3386
3387 (when (> emacs-major-version 22)
3388 (defcustom icicle-populate-interactive-history-flag nil
3389 "*Non-nil means populate `icicle-interactive-history'.
3390 That means add commands invoked interactively to that history, for use
3391 during completion by `C-M-pause'.
3392
3393 After you change the value of this option, toggle Icicle mode off,
3394 then on again, for the change to take effect in the same session.
3395
3396 Be aware that this history can become quite long.
3397
3398 Furthermore, there is an Emacs bug (#3984) that causes interactiveness
3399 tests (`interactive-p' and `called-interactively-p') to fail, whenever
3400 `call-interactively' is advised (which is how Icicles implements this
3401 feature).
3402
3403 Remember that you can use multi-command `icicle-toggle-option' anytime
3404 to toggle the option."
3405 :type 'boolean :group 'Icicles-Miscellaneous))
3406
3407 (defcustom icicle-pp-eval-expression-print-length nil
3408 "*Value for `print-length' while printing value in `pp-eval-expression'.
3409 A value of nil means no limit.
3410
3411 If the value is an integer and you use Do Re Mi (library `doremi.el')
3412 then you can use multi-command `icicle-increment-option' anytime to
3413 change the option value incrementally."
3414 :type '(choice
3415 (const :tag "No Limit" nil)
3416 (integer :value 5000))
3417 :group 'Icicles-Miscellaneous)
3418
3419 (defcustom icicle-pp-eval-expression-print-level nil
3420 "*Value for `print-level' while printing value in `pp-eval-expression'.
3421 A value of nil means no limit.
3422
3423 If the value is an integer and you use Do Re Mi (library `doremi.el')
3424 then you can use multi-command `icicle-increment-option' anytime to
3425 change the option value incrementally."
3426 :type '(choice
3427 (const :tag "No Limit" nil)
3428 (integer :value 8))
3429 :group 'Icicles-Miscellaneous)
3430
3431 (defcustom icicle-prefix-complete-keys '([?\t] [tab] [(control ?i)]) ; `C-i' is `TAB'.
3432 "*Key sequences to use for `icicle-prefix-complete'.
3433 A list of values that each has the same form as a key-sequence
3434 argument to `define-key'. It is a list mainly in order to accommodate
3435 different keyboards."
3436 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3437
3438 (defcustom icicle-prefix-complete-no-display-keys '([C-M-tab]) ; `C-M-TAB'
3439 "*Key sequences to use for `icicle-prefix-complete-no-display'.
3440 A list of values that each has the same form as a key-sequence
3441 argument to `define-key'. It is a list mainly in order to accommodate
3442 different keyboards."
3443 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3444
3445 (defcustom icicle-prefix-cycle-next-keys '([end]) ; `end'
3446 "*Key sequences for prefix completion to cycle to the next candidate.
3447 A list of values that each has the same form as a key-sequence
3448 argument to `define-key'. It is a list mainly in order to accommodate
3449 different keyboards.
3450
3451 Option `icicle-use-C-for-actions-flag' swaps these keys with
3452 `icicle-prefix-cycle-next-action-keys'."
3453 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3454
3455 (defcustom icicle-prefix-cycle-next-action-keys '([C-end]) ; `C-end'
3456 "*Keys for prefix completion to cycle next and perform action.
3457 A list of values that each has the same form as a key-sequence
3458 argument to `define-key'. It is a list mainly in order to accommodate
3459 different keyboards.
3460
3461 Option `icicle-use-C-for-actions-flag' swaps these keys with
3462 `icicle-prefix-cycle-next-keys'."
3463 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3464
3465 (defcustom icicle-prefix-cycle-next-alt-action-keys '([C-S-end]) ; `C-S-end'
3466 "*Keys for prefix completion to cycle next and perform alt action.
3467 A list of values that each has the same form as a key-sequence
3468 argument to `define-key'. It is a list mainly in order to accommodate
3469 different keyboards."
3470 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3471
3472 (defcustom icicle-prefix-cycle-next-help-keys '([C-M-end]) ; `C-M-end'
3473 "*Keys for prefix completion to cycle next and show candidate help.
3474 A list of values that each has the same form as a key-sequence
3475 argument to `define-key'. It is a list mainly in order to accommodate
3476 different keyboards."
3477 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3478
3479 (defcustom icicle-prefix-cycle-previous-keys '([home]) ; `home'
3480 "*Key sequences for prefix completion to cycle to the previous candidate.
3481 A list of values that each has the same form as a key-sequence
3482 argument to `define-key'. It is a list mainly in order to accommodate
3483 different keyboards.
3484
3485 Option `icicle-use-C-for-actions-flag' swaps these keys with
3486 `icicle-prefix-cycle-previous-action-keys'."
3487 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3488
3489 (defcustom icicle-prefix-cycle-previous-action-keys '([C-home]) ; `C-home'
3490 "*Keys for prefix completion to cycle previous and perform action.
3491 A list of values that each has the same form as a key-sequence
3492 argument to `define-key'. It is a list mainly in order to accommodate
3493 different keyboards.
3494
3495 Option `icicle-use-C-for-actions-flag' swaps these keys with
3496 `icicle-prefix-cycle-previous-keys'."
3497 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3498
3499 (defcustom icicle-prefix-cycle-previous-alt-action-keys '([C-S-home]) ; `C-S-home'
3500 "*Keys for prefix completion to cycle previous and perform alt action.
3501 A list of values that each has the same form as a key-sequence
3502 argument to `define-key'. It is a list mainly in order to accommodate
3503 different keyboards."
3504 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3505
3506 (defcustom icicle-prefix-cycle-previous-help-keys '([C-M-home]) ; `C-M-home'
3507 "*Keys for prefix completion to cycle previous and show candidate help.
3508 A list of values that each has the same form as a key-sequence
3509 argument to `define-key'. It is a list mainly in order to accommodate
3510 different keyboards."
3511 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3512
3513 (defcustom icicle-quote-shell-file-name-flag t
3514 "*Non-nil means to double-quote the file name that starts a shell command.
3515 This is used by `icicle-read-shell-command-completing'.
3516
3517 If this is nil, then Emacs commands such as `M-!' will not quote a
3518 shell-command file name such as `c:/Program Files/My Dir/mycmd.exe'.
3519 In that case, a shell such as `bash' fails for a shell command such as
3520 `c:/Program Files/My Dir/mycmd.exe arg1 arg2 &', because it interprets
3521 only `c:/Program' as the shell command. That is, it interprets the
3522 space characters in the file name as separators. If this is non-nil,
3523 then input such as `c:/Program Files/My Dir/mycmd.exe arg1 arg2 &' is
3524 passed to the shell as
3525 `\"c:/Program Files/My Dir/mycmd.exe\" arg1 arg2 &'.
3526
3527 See the doc string of `icicle-quote-file-name-part-of-cmd' for
3528 information about the characters that, like SPC, lead to quoting.
3529
3530 Remember that you can use multi-command `icicle-toggle-option' anytime
3531 to toggle the option."
3532 :type 'boolean :group 'Icicles-Miscellaneous)
3533
3534 (defcustom icicle-read+insert-file-name-keys '([(control meta shift ?f)]) ; `C-M-S-f'
3535 "*Key sequences to invoke `icicle-read+insert-file-name'.
3536 A list of values that each has the same form as a key-sequence
3537 argument to `define-key'. It is a list mainly in order to accommodate
3538 different keyboards."
3539 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3540
3541 (defcustom icicle-regexp-quote-flag nil ; Toggle with `C-`'.
3542 "*Non-nil means special characters in regexps are escaped.
3543 This means that no characters are recognized as special: they match
3544 themselves. This turns apropos completion into simple substring
3545 completion. It also turns Icicles searching into literal searching.
3546
3547 You can toggle this option from the minibuffer at any time using
3548 `C-`'. You can also use multi-command `icicle-toggle-option' anytime
3549 to toggle the option."
3550 :type 'boolean :group 'Icicles-Matching)
3551
3552 (defcustom icicle-regexp-search-ring-max (if (boundp 'most-positive-fixnum)
3553 (/ most-positive-fixnum 10)
3554 13421772) ; 1/10 of `most-positive-fixnum' on Windows.
3555 "*Icicles version of `regexp-search-ring-max'.
3556 If you use Do Re Mi (library `doremi.el') then you can use
3557 multi-command `icicle-increment-option' anytime to change the option
3558 value incrementally."
3559 :type 'integer :group 'Icicles-Searching)
3560
3561 ;; You can use `hexrgb-increment-value' in place of `hexrgb-increment-hue', if you prefer highlighting
3562 ;; background to be slightly darker instead of a slightly different hue.
3563 ;;
3564 (defcustom icicle-region-background
3565 (if (featurep 'hexrgb)
3566 (let* ((bg (or (and (boundp '1on1-active-minibuffer-frame-background)
3567 1on1-active-minibuffer-frame-background) ; In `oneonone.el'.
3568 (let ((frame-bg (cdr (assq 'background-color (frame-parameters)))))
3569 (when (member frame-bg '(nil unspecified "unspecified-bg"))
3570 (setq frame-bg (if (eq (frame-parameter nil 'background-mode) 'dark)
3571 "Black"
3572 "White")))
3573 (and frame-bg (x-color-defined-p frame-bg) frame-bg))
3574 (face-background 'region)))
3575 (sat (condition-case nil (hexrgb-saturation bg) (error nil))))
3576 (if sat
3577 (if (hexrgb-approx-equal sat 0.0)
3578 ;; Grayscale - change bg value slightly.
3579 (hexrgb-increment-value bg (if (eq (frame-parameter nil 'background-mode) 'dark)
3580 0.20
3581 -0.10))
3582 (hexrgb-increment-hue bg 0.24)) ; Color - change bg hue slightly.
3583 (face-background 'region)))
3584 (face-background 'region)) ; Use normal region background.
3585 "*Background color to use for the region during minibuffer cycling.
3586 This has no effect if `icicle-change-region-background-flag' is nil.
3587 If you do not define this explicitly, and if you have loaded library
3588 `hexrgb.el' (recommended), then this color will be slightly
3589 different from your frame background. This still lets you notice the
3590 region, but it makes the region less conspicuous, so you can more
3591 easily read your minibuffer input."
3592 :type (if (and (require 'wid-edit nil t) (get 'color 'widget-type)) 'color 'string)
3593 :group 'Icicles-Minibuffer-Display)
3594
3595 (defcustom icicle-keep-Completions-for-sole-dir 'update-if-showing
3596 "*What to do when the only match for your input is a directory name.
3597 This applies only to non-absolute file-name completion.
3598
3599 * If `nil' then remove the `*Completions*' window.
3600
3601 * If the symbol `pop-up' then update `*Completions*' unconditionally
3602 to show the sole candidate. Show `*Completions*' if it was not yet
3603 showing.
3604
3605 * If any other non-`nil' value then update `*Completions*' if it is
3606 showing, and do nothing otherwise. This is the default behavior."
3607 :type '(choice
3608 (const :tag "Remove `*Completions*' unconditionally" nil)
3609 (const :tag "Show and update `*Completions*' unconditionally" pop-up)
3610 (other :tag "Update `*Completions*' if showing; else remove it" update-if-showing))
3611 :group 'Icicles-Completions-Display :group 'Icicles-Files)
3612
3613 (defcustom icicle-require-match-flag nil
3614 "*Control REQUIRE-MATCH arg to `completing-read' and `read-file-name'.
3615 The possible values are as follows:
3616 - nil means this option imposes nothing on completion;
3617 the REQUIRE-MATCH argument provided to the function governs behavior
3618 - `no-match-required' means the same as a nil value for REQUIRE-MATCH
3619 - `partial-match-ok' means the same as a t value for REQUIRE-MATCH
3620 - `full-match-required' means the same as a non-nil, non-t value for
3621 REQUIRE-MATCH
3622
3623 Note: This option is provided mainly for use (binding) in
3624 `icicle-define-command' and `icicle-define-file-command'.
3625 You probably do not want to set this globally, but you can."
3626 :type '(choice
3627 (const :tag "Do not impose any match behavior" nil)
3628 (const :tag "Do not require a match" no-match-required)
3629 (const :tag "Require a partial match, with RET" partial-match-ok)
3630 (const :tag "Require a full match" full-match-required))
3631 :group 'Icicles-Matching)
3632
3633 (defcustom icicle-saved-completion-sets nil
3634 "*Completion sets available for `icicle-candidate-set-retrieve'.
3635 The form is ((SET-NAME . CACHE-FILE-NAME)...), where SET-NAME is the
3636 name of a set of completion candidates and CACHE-FILE-NAME is the
3637 absolute name of the cache file that contains those candidates.
3638 You normally do not customize this directly, statically.
3639 Instead, you add or remove sets using commands
3640 `icicle-add/update-saved-completion-set' and
3641 `icicle-remove-saved-completion-set'."
3642 :type '(repeat (cons string file)) :group 'Icicles-Matching)
3643
3644 (defcustom icicle-search-cleanup-flag t
3645 "*Controls whether to remove highlighting after a search.
3646 If this is nil, highlighting can be removed manually with
3647 `\\[icicle-search-highlight-cleanup]'.
3648
3649 You can toggle this option from the minibuffer during Icicles search
3650 \(e.g., `C-c`') using `C-.'. You can also use multi-command
3651 `icicle-toggle-option' anytime to toggle the option."
3652 :type 'boolean :group 'Icicles-Searching)
3653
3654 (defcustom icicle-search-from-isearch-keys (if (> emacs-major-version 23) ; `S-TAB'
3655 '([backtab])
3656 '([S-tab] [S-iso-lefttab]))
3657
3658 ;; $$$$$ The following should be sufficient, but some Emacs 22+ libraries, such as `info.el',
3659 ;; are brain-dead and explicitly bind both `backtab' and `S-tab'. I filed Emacs bug #1281.
3660 ;; (if (> emacs-major-version 21)
3661 ;; '([backtab])
3662 ;; '([S-tab] [S-iso-lefttab]))
3663 "*Key sequences to use to start `icicle-search' from Isearch.
3664 A list of values that each has the same form as a key-sequence
3665 argument to `define-key'. It is a list mainly in order to accommodate
3666 different keyboards - for example, `S-tab' and `S-iso-lefttab'."
3667 ;; In Emacs 22 and later, `backtab' is the canonical key that represents
3668 ;; both `S-tab' and `S-iso-lefttab', so that is used in the default
3669 ;; value. If, for some reason, `backtab' is not being translated to
3670 ;; `S-tab' and `S-iso-lefttab' on your platform, you might want to
3671 ;; customize the value to ([S-tab] [S-iso-lefttab]). And if your Emacs
3672 ;; version is 22 or later, please file an Emacs bug about the lack of
3673 ;; translation.
3674 :type '(repeat sexp) :group 'Icicles-Key-Bindings)
3675
3676 (defcustom icicle-search-highlight-all-current-flag nil ; Toggle with `C-^'.
3677 "*Non-nil means highlight input match in each context search hit.
3678 Setting this to non-nil can impact performance negatively, because the
3679 highlighting is updated with each input change.
3680
3681 You can toggle this option from the minibuffer during Icicles search
3682 \(e.g., `C-c`') using `C-^'. You can also use multi-command
3683 `icicle-toggle-option' anytime to toggle the option."
3684 :type 'boolean :group 'Icicles-Searching)
3685
3686 (defcustom icicle-search-highlight-context-levels-flag t
3687 "*Non-nil means highlight 1-8 context levels, within the search context.
3688 Level highlighting is done only when this is non-nil and a subgroup is
3689 not used as the search context, that is, the context corresponds to
3690 the entire search regexp.
3691
3692 Remember that you can use multi-command `icicle-toggle-option' anytime
3693 to toggle the option."
3694 :type 'boolean :group 'Icicles-Searching)
3695
3696 (defcustom icicle-search-highlight-threshold 100000
3697 "*Max number of context search hits to highlight at once.
3698 If the value is `t' then there is no limit.
3699 This highlighting uses face `icicle-search-main-regexp-others'.
3700
3701 If the value is an integer and you use Do Re Mi (library `doremi.el')
3702 then you can use multi-command `icicle-increment-option' anytime to
3703 change the option value incrementally."
3704 :type '(choice
3705 (const :tag "Highlight all search hits (no limit)" t)
3706 (integer :tag "Max number of search hits to highlight" :value 100000))
3707 :group 'Icicles-Searching)
3708
3709 (defcustom icicle-search-hook nil
3710 "*List of functions run by `icicle-search' after you visit a search hit.
3711 See `run-hooks'."
3712 :type 'hook :group 'Icicles-Searching)
3713
3714 (defcustom icicle-search-key-prefix "\M-s\M-s"
3715 "*Key sequence prefix for keys bound to Icicles search commands.
3716 Has the same form as a key-sequence argument to `define-key'.
3717
3718 This same prefix key sequence, followed by `m', is used in some major
3719 modes for a mode-specific Icicles search command. E.g., if the prefix
3720 key is `M-s M-s' then `M-s M-s m' is bound in Dired mode to
3721 `icicle-search-dired-marked-recursive', which searches the marked
3722 files."
3723 :type 'sexp :group 'Icicles-Key-Bindings)
3724
3725 (defcustom icicle-search-replace-common-match-flag t ; Toggle with `M-;'.
3726 "*Non-nil means to replace the expanded common match of your input.
3727 This has no effect if `icicle-search-highlight-all-current-flag' is
3728 nil or `icicle-expand-input-to-common-match' does not cause expansion.
3729
3730 You can cycle those options from the minibuffer using `C-^' and
3731 `C-M-\"', respectively. You can toggle
3732 `icicle-search-replace-common-match-flag' using `M-;'.
3733
3734 Remember that you can also use multi-command `icicle-toggle-option'
3735 anytime to toggle the option."
3736 :type 'boolean :group 'Icicles-Searching)
3737
3738 (defcustom icicle-search-replace-literally-flag nil ; Toggle with `C-M-`'.
3739 "*Non-nil means to treat replacement text literally.
3740 Otherwise (nil), interpret `\\' specially in replacement text, as in
3741 the LITERAL argument to `replace-match'.
3742
3743 You can use `C-M-`' to toggle this at any time during Icicles search.
3744 You can also use multi-command `icicle-toggle-option' anytime to
3745 toggle the option."
3746 :type 'boolean :group 'Icicles-Searching)
3747
3748 (defcustom icicle-search-replace-whole-candidate-flag t ; Toggle with `M-_'.
3749 "*Non-nil means replacement during search replaces the entire search hit.
3750 Otherwise (nil), replace only what matches your current input.
3751
3752 You can use `\\<minibuffer-local-completion-map>\\[icicle-dispatch-M-_]' to \
3753 toggle this at any time during Icicles search.
3754 You can also use multi-command `icicle-toggle-option' anytime to
3755 toggle the option."
3756 :type 'boolean :group 'Icicles-Searching)
3757
3758 (defcustom icicle-search-ring-max (if (boundp 'most-positive-fixnum)
3759 (/ most-positive-fixnum 10)
3760 13421772) ; 1/10 of `most-positive-fixnum' on Windows.
3761 "*Icicles version of `search-ring-max'.
3762 If you use Do Re Mi (library `doremi.el') then you can use
3763 multi-command `icicle-increment-option' anytime to change the option
3764 value incrementally."
3765 :type 'integer :group 'Icicles-Searching)
3766
3767 (defcustom icicle-search-whole-word-flag nil ; Toggle with `M-q'.
3768 "*Non-nil means that `icicle-search' looks for a whole word.
3769 Whole-word searching here means that matches can contain embedded
3770 strings of non word-constituent chars (they are skipped over, when
3771 matching, included in the match), and any leading or trailing
3772 word-constituent chars in the search string are dropped (ignored for
3773 matching, not included in the match). This means, for instance, that
3774 you can match `foo-bar' as a word, even in contexts (such as Emacs
3775 Lisp) where `-' is not a word-constituent character. Similarly, you
3776 can include embedded whitespace in a \"word\", e.g., `foo bar'.
3777
3778 You can use `M-q' to toggle this at any time during Icicles search;
3779 the new value takes effect for the next complete search. You can also
3780 use multi-command `icicle-toggle-option' anytime to toggle the
3781 option."
3782 :type 'boolean :group 'Icicles-Searching)
3783