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