60d0df98026953c9d2c4aac1e073906fcbd42771
[emacs.git] / .emacs.d / elisp / icicle / icicles-var.el
1 ;;; icicles-var.el --- Internal variables for Icicles
2 ;;
3 ;; Filename: icicles-var.el
4 ;; Description: Internal variables for Icicles
5 ;; Author: Drew Adams
6 ;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
7 ;; Copyright (C) 1996-2014, Drew Adams, all rights reserved.
8 ;; Created: Mon Feb 27 09:23:26 2006
9 ;; Last-Updated: Sun Apr 20 15:05:17 2014 (-0700)
10 ;; By: dradams
11 ;; Update #: 1803
12 ;; URL: http://www.emacswiki.org/icicles-var.el
13 ;; Doc URL: http://www.emacswiki.org/Icicles
14 ;; Keywords: internal, extensions, help, abbrev, local, minibuffer,
15 ;; keys, apropos, completion, matching, regexp, command
16 ;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x
17 ;;
18 ;; Features that might be required by this library:
19 ;;
20 ;; `apropos', `apropos-fn+var', `cl', `cus-theme',
21 ;; `el-swank-fuzzy', `ffap', `ffap-', `fuzzy', `fuzzy-match',
22 ;; `hexrgb', `icicles-opt', `kmacro', `levenshtein', `naked',
23 ;; `regexp-opt', `thingatpt', `thingatpt+', `wid-edit',
24 ;; `wid-edit+', `widget'.
25 ;;
26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27 ;;
28 ;;; Commentary:
29 ;;
30 ;; This is a helper library for library `icicles.el'. It defines
31 ;; internal variables (not to be modified by users. For Icicles
32 ;; documentation, see `icicles-doc1.el' and `icicles-doc2.el'.
33 ;;
34 ;; Internal variables defined here:
35 ;;
36 ;; `icicle-abs-file-candidates', `icicle-acting-on-next/prev',
37 ;; `icicle-advice-info-list', `icicle-all-candidates-action',
38 ;; `icicle-all-candidates-list-action-fn',
39 ;; `icicle-all-candidates-list-alt-action-fn',
40 ;; `icicle-allowed-sort-predicate', `icicle-apply-nomsg',
41 ;; `icicle-apropos-complete-match-fn',
42 ;; `icicle-apropos-value-last-initial-cand-set',
43 ;; `icicle-auto-no-icomplete-mode-p', `icicle-auto-no-sort-p',
44 ;; `icicle-bookmark-history', `icicle-bookmark-list-names-only-p',
45 ;; `icicle-bookmark-types', `icicle-buffer-complete-fn',
46 ;; `icicle-buffer-config-history', `icicle-buffer-name-input-p',
47 ;; `icicle-buffer-sort-first-time-p', `icicle-bufflist',
48 ;; `icicle-candidate-action-fn', `icicle-candidate-alt-action-fn',
49 ;; `icicle-candidate-entry-fn', `icicle-candidate-help-fn',
50 ;; `icicle-candidate-nb', `icicle-candidate-properties-alist',
51 ;; `icicle-candidates-alist', `icicle-cands-to-narrow',
52 ;; `icicle-char-property-value-history',
53 ;; `icicle-cmd-calling-for-completion', `icicle-cmd-reading-input',
54 ;; `icicle-color-history', `icicle-color-theme-history',
55 ;; `icicle-command-abbrev-history', `icicle-commands-for-abbrev',
56 ;; `icicle-common-match-string',
57 ;; `icicle-comp-base-is-default-dir-p',
58 ;; `icicle-complete-input-overlay', `icicle-complete-keys-alist',
59 ;; `icicle-completing-keys-p', `icicle-completing-p',
60 ;; `icicle-completing-read+insert-candidates',
61 ;; `icicle-completion-candidates',
62 ;; `icicle-completion-prompt-overlay',
63 ;; `icicle-completion-set-history',
64 ;; `icicle-compute-narrowing-regexp-p',
65 ;; `icicle-confirm-exit-commands',
66 ;; `icicle-current-completion-candidate-overlay',
67 ;; `icicle-current-completion-mode',
68 ;; `icicle-current-font-lock-part', `icicle-current-input',
69 ;; `icicle-current-raw-input', `icicle-cycling-p',
70 ;; `icicle-default-thing-insertion-flipped-p',
71 ;; `icicle-dictionary-history', `icicle-dir-candidate-can-exit-p',
72 ;; `icicle-doc-last-initial-cand-set',
73 ;; `icicle-dot-string-internal', `icicle-edit-update-p',
74 ;; `icicle-ess-use-ido', `icicle-exclude-default-proxies',
75 ;; `icicle-explore-final-choice',
76 ;; `icicle-explore-final-choice-full', `icicle-extra-candidates',
77 ;; `icicle-extra-candidates-dir-insert-p',
78 ;; `icicle-face-name-history', `icicle-fancy-candidates-p',
79 ;; `icicle-fancy-cands-internal-p',
80 ;; `icicle-file-name-completion-table',
81 ;; `icicle-file-sort-first-time-p',
82 ;; `icicle-filtered-default-value', `icicle-font-name-history',
83 ;; `icicle-frame-alist', `icicle-frame-name-history',
84 ;; `icicle-full-cand-fn', `icicle-function-name-history',
85 ;; `icicle-fundoc-last-initial-cand-set',
86 ;; `icicle-general-help-string',
87 ;; `icicle-get-alist-candidate-function',
88 ;; `icicle-hist-cands-no-highlight', `icicle-hist-var',
89 ;; `icicle-ignored-extensions', `icicle-ignored-extensions-regexp',
90 ;; `icicle-incremental-completion-p', `icicle-Info-index-cache',
91 ;; `icicle-Info-only-rest-of-book-p', `icicle-Info-tag-table-posn',
92 ;; `icicle-inhibit-sort-p', `icicle-inhibit-try-switch-buffer',
93 ;; `icicle-initial-value', `icicle-input-completion-fail-overlay',
94 ;; `icicle-input-fail-pos', `icicle-insert-string-at-pt-end',
95 ;; `icicle-insert-string-at-pt-start',
96 ;; `icicle-interactive-history', `icicle-key-prefix-description',
97 ;; `icicle-kill-history', `icicle-kmacro-alist',
98 ;; `icicle-kmacro-history',
99 ;; `icicle-last-apropos-complete-match-fn',
100 ;; `icicle-last-completion-candidate',
101 ;; `icicle-last-completion-command',
102 ;; `icicle-last-icomplete-mode-value', `icicle-last-input',
103 ;; `icicle-last-sort-comparer', `icicle-last-top-level-command',
104 ;; `icicle-last-transform-function', `icicle-lighter-truncation',
105 ;; `icicle-list-use-nth-parts', `icicle-menu-map',
106 ;; `icicle-minibuffer-message-ok-p', `icicle-minor-mode-map-entry',
107 ;; `icicle-mode-line-help', `icicle-ms-windows-drive-hash',
108 ;; `icicle-multi-completing-p', `icicle-multi-inputs-action-fn',
109 ;; `icicle-must-match-regexp', `icicle-must-not-match-regexp',
110 ;; `icicle-must-pass-after-match-predicate',
111 ;; `icicle-must-pass-predicate', `icicle-narrow-regexp',
112 ;; `icicle-nb-candidates-before-truncation',
113 ;; `icicle-nb-of-other-cycle-candidates', `icicle-new-last-cmd',
114 ;; `icicle-next-apropos-complete-cycles-p',
115 ;; `icicle-next-prefix-complete-cycles-p', `icicle-orig-buff',
116 ;; `icicle-orig-font-lock-keywords',
117 ;; `icicle-orig-minibuffer-completion-pred',
118 ;; `icicle-orig-minibuffer-completion-table',
119 ;; `icicle-orig-must-match-regexp',
120 ;; `icicle-orig-must-not-match-regexp',
121 ;; `icicle-orig-must-pass-after-match-pred',
122 ;; `icicle-orig-must-pass-predicate', `icicle-orig-pt-explore',
123 ;; `icicle-orig-read-file-name-fn', `icicle-orig-window',
124 ;; `icicle-orig-win-explore', `icicle-other-window',
125 ;; `icicle-path-variables', `icicle-plist-last-initial-cand-set',
126 ;; `icicle-predicate-types-alist', `icicle-pref-arg',
127 ;; `icicle-pre-minibuffer-buffer', `icicle-post-command-hook',
128 ;; `icicle-pre-command-hook',
129 ;; `icicle-previous-raw-file-name-inputs',
130 ;; `icicle-previous-raw-non-file-name-inputs',
131 ;; `icicle-progressive-completing-p', `icicle-prompt',
132 ;; `icicle-proxy-candidate-regexp', `icicle-proxy-candidates',
133 ;; `icicle-read-char-history', `icicle-read-expression-map',
134 ;; `icicle-remove-icicles-props-p', `icicle-re-no-dot',
135 ;; `icicle-require-match-p', `icicle-reverse-multi-sort-p',
136 ;; `icicle-reverse-sort-p', `icicle-saved-candidate-overlays',
137 ;; `icicle-saved-candidates-variables-obarray',
138 ;; `icicle-saved-completion-candidate',
139 ;; `icicle-saved-completion-candidates',
140 ;; `icicle-saved-completion-candidates-internal',
141 ;; `icicle-saved-ignored-extensions',
142 ;; `icicle-saved-kmacro-ring-max', `icicle-saved-proxy-candidates',
143 ;; `icicle-saved-regexp-search-ring-max',
144 ;; `icicle-saved-region-background',
145 ;; `icicle-saved-search-ring-max', `icicle-scan-fn-or-regexp',
146 ;; `icicle-scroll-Completions-reverse-p', `icicle-search-command',
147 ;; `icicle-search-complement-domain-p',
148 ;; `icicle-search-context-level', `icicle-search-context-regexp',
149 ;; `icicle-search-current-overlay', `icicle-search-final-choice',
150 ;; `icicle-search-history', `icicle-search-in-context-fn',
151 ;; `icicle-searching-p', `icicle-search-level-overlays',
152 ;; `icicle-search-map', `icicle-search-modes',
153 ;; `icicle-search-overlays', `icicle-search-refined-overlays',
154 ;; `icicle-search-replacement',
155 ;; `icicle-search-replacement-history',
156 ;; `icicle-successive-grab-count',
157 ;; `icicle-text-property-value-history',
158 ;; `icicle-thing-at-pt-fns-pointer',
159 ;; `icicle-transform-before-sort-p', `icicle-transform-function',
160 ;; `icicle-toggle-transforming-message',
161 ;; `icicle-universal-argument-map',
162 ;; `icicle-use-candidates-only-once-alt-p',
163 ;; `icicle-vardoc-last-initial-cand-set',
164 ;; `icicle-variable-name-history',
165 ;; `icicle-whole-candidate-as-text-prop-p',
166 ;; `lacarte-menu-items-alist'.
167 ;;
168 ;; For descriptions of changes to this file, see `icicles-chg.el'.
169
170 ;;(@> "Index")
171 ;;
172 ;; If you have library `linkd.el' and Emacs 22 or later, load
173 ;; `linkd.el' and turn on `linkd-mode' now. It lets you easily
174 ;; navigate around the sections of this doc. Linkd mode will
175 ;; highlight this Index, as well as the cross-references and section
176 ;; headings throughout this file. You can get `linkd.el' here:
177 ;; http://dto.freeshell.org/notebook/Linkd.html.
178 ;;
179 ;; (@> "Internal variables (alphabetical)")
180
181 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
182 ;;
183 ;; This program is free software; you can redistribute it and/or
184 ;; modify it under the terms of the GNU General Public License as
185 ;; published by the Free Software Foundation; either version 2, or (at
186 ;; your option) any later version.
187 ;;
188 ;; This program is distributed in the hope that it will be useful, but
189 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
190 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
191 ;; General Public License for more details.
192 ;;
193 ;; You should have received a copy of the GNU General Public License
194 ;; along with this program; see the file COPYING. If not, write to
195 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
196 ;; Floor, Boston, MA 02110-1301, USA.
197 ;;
198 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
199 ;;
200 ;;; Code:
201
202 (require 'apropos-fn+var nil t) ;; (no error if not found): apropos-command,
203 ;; apropos-function, apropos-option, apropos-variable
204
205 (require 'icicles-opt) ;; icicle-kbd, icicle-sort-comparer
206
207 ;;; Defvars to quiet byte-compiler:
208 (defvar kmacro-ring-max) ; Defined in `kmacro.el' in Emacs 22+.
209 (defvar minibuffer-confirm-exit-commands) ; Defined in `minibuffer.el' in Emacs 23+.
210
211 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
212
213 ;;(@* "Internal variables (alphabetical)")
214
215 ;;; Internal variables (alphabetical) --------------------------------
216
217 (defvar lacarte-menu-items-alist nil) ; Defined in `lacarte.el'.
218
219 ;; These two are defined here so they won't raise an error in `font-lock-add-keywords'.
220 (defvar font-lock-function-name-face 'font-lock-function-name-face ; In `font-lock.el'.
221 "Face name to use for function names.")
222
223 (defvar font-lock-keyword-face 'font-lock-keyword-face ; Defined in `font-lock.el'.
224 "Face name to use for keywords.")
225
226 (defvar icicle-abs-file-candidates ()
227 "Current alist of absolute file-name candidates.
228 An alist appropriate as the COLLECTION argument for `completing-read'.
229 Each item is a cons whose car is an absolute file name (a string).")
230
231 (defvar icicle-acting-on-next/prev nil
232 "Non-nil means this command acts on the previous or next candidate.
233 The particular non-nil value indicates the navigation direction:
234 `forward' or `backward'.")
235
236 (defvar icicle-advice-info-list ()
237 "List of advice information for functions that Icicles redefines.
238 If such redefined functions are advised, then Icicles deactivates the
239 advice when you turn on Icicle mode. It restores the recorded advice
240 activation state when you turn off Icicle mode.")
241
242 (defvar icicle-all-candidates-action nil
243 "Non-nil means that we are acting on all candidates.
244 That is, `icicle-all-candidates-action-1' is in progress.
245 If neither nil nor t, then the value is the action function to use.")
246
247 (defvar icicle-all-candidates-list-action-fn nil
248 "Action function to apply to a list of all matching completions.
249 It is applied using `M-!' during completion.")
250
251 (defvar icicle-all-candidates-list-alt-action-fn nil
252 "Alternative action function to apply to a list of matching completions.
253 It is applied using `M-|' during completion.")
254
255 (defvar icicle-allowed-sort-predicate nil
256 "Predicate that `icicle-current-sort-functions' allows in a sort order.
257 That is, if this predicate is used in an entry of
258 `icicle-sort-orders-alist' then that entry is retained by
259 `icicle-current-sort-functions'.")
260
261 (defvar icicle-apply-nomsg nil
262 "Non-nil means `icicle-apply' does not show status of applying function.")
263
264 (defvar icicle-apropos-complete-match-fn 'string-match
265 "Function to filter apropos completion candidates.
266 Takes as arguments an input string and a completion candidate, and
267 returns non-nil if the string is considered to match the candidate.
268
269 A value of nil instead of a function means completion candidates are
270 not filtered by the input, except possibly by a function-valued
271 `minibuffer-completion-table'.")
272
273 (defvar icicle-apropos-value-last-initial-cand-set ()
274 "Cache for initial set of completion cands for `icicle-apropos-value'.")
275
276 (defvar icicle-auto-no-icomplete-mode-p nil
277 "Non-nil means Icomplete mode has been turned off for this minibuffer activation.
278 This automatic turning off happens when there are at least
279 `icicle-icomplete-mode-max-candidates' completion candidates.")
280
281 (defvar icicle-auto-no-sort-p nil
282 "Non-nil means sorting has been turned off for this minibuffer activation.
283 This automatic turning off happens when there are at least
284 `icicle-sorting-max-candidates' completion candidates.")
285
286 (defvar icicle-bookmark-history nil "History for bookmark names.")
287
288 (defvar icicle-bookmark-list-names-only-p nil
289 "Non-nil means `icicle-bookmark-list' returns names, not bookmarks.")
290
291 (defvar icicle-bookmark-types ()
292 "List of strings naming bookmark types.
293 The list represents the set of all bookmarks of the given types.
294 An empty list and the singleton list `(all)', where `all' is a symbol,
295 are equivalent and stand for the set of all bookmarks (of any type).")
296
297 (defvar icicle-buffer-complete-fn nil
298 "If the value is non-nil then it is a buffer-name completion function.
299 The function is used as the COLLECTION argument to `completing-read'.
300
301 However, if the value is `internal-complete-buffer' then it is used
302 only if `icicle-buffer-ignore-space-prefix-flag' is non-nil.
303
304 Otherwise, all buffer names are used as candidates.")
305
306 (defvar icicle-buffer-config-history nil "History for buffer configuration names.")
307
308 (defvar icicle-buffer-name-input-p nil
309 "Non-nil means we are reading a buffer name.")
310
311 (defvar icicle-buffer-sort-first-time-p t
312 "Non-nil means buffer-name completion has not yet been used.")
313
314 (defvar icicle-bufflist nil
315 "List of buffers defined by macro `icicle-buffer-bindings'.")
316
317 (defvar icicle-candidate-action-fn nil
318 "Action function to apply to current completion candidate.
319 It is applied by `C-RET', `C-mouse-2', and similar keys during
320 completion.
321 For `icicle-all-candidates-action' to be able to report successes,
322 this should return nil for \"success\" and non-nil for \"failure\".")
323
324 (defvar icicle-candidate-alt-action-fn nil
325 "Alternative action function to apply to current completion candidate.
326 It is applied by `C-S-RET', `C-S-mouse-2', and similar keys during
327 completion.
328 For `icicle-all-candidates-alt-action' to be able to report successes,
329 this should return nil for \"success\" and non-nil for \"failure\".")
330
331 (defvar icicle-candidate-entry-fn nil
332 "Function to apply to selected entries in `icicle-candidates-alist'.")
333
334 (defvar icicle-candidate-help-fn nil
335 "Help function to be applied to current completion candidate.
336 It is applied by `C-M-RET', `C-M-mouse-2', and similar keys during
337 completion.
338 If nil then default help function `icicle-help-on-candidate' is used.
339 If non-nil, it must be a function that accepts a completion candidate
340 in its display form. If the candidate is a multi-completion then the
341 help function can invoke `icicle-transform-multi-completion' on it,
342 binding `icicle-list-use-nth-parts' as appropriate.")
343
344 (defvar icicle-candidate-nb nil
345 "Current completion candidate number, or nil if not cycling candidates.
346 Numbering starts at zero.")
347
348 (defvar icicle-candidate-properties-alist nil
349 "Alist of multi-completion indexes and associated text properties.
350 The text properties apply to candidates in `*Completions*'.
351 Each alist entry has the form (NTH PROPERTIES) or (NTH PROPERTIES
352 JOIN-TOO).
353
354 NTH is a whole-number index identifying the multi-completion part.
355
356 PROPERTIES is a list of text properties to apply to the part.
357
358 JOIN-TOO non-nil means to also apply PROPERTIES to the join string
359 that follows the part.
360
361 Example alist:
362
363 ((3 (face 'underline))
364 (2 (invisible t) t))
365
366 The first entry underlines the third multi-completion part.
367 The second entry makes both the second part and the join string that
368 follows it invisible.")
369
370 (defvar icicle-candidates-alist nil
371 "Alist of candidate entries.
372 The car (key) of each entry is treated as a completion candidate.
373 The cdr is some other data to be used when the candidate is chosen.
374 This is reset to nil at the beginning of each top-level command.
375
376 This is used typically by commands that allow different cdrs for the
377 same car. Icicles search is one such example.")
378
379 (defvar icicle-cands-to-narrow ()
380 "Saved `icicle-completion-candidates' for reference during narrowing.")
381
382 (defvar icicle-char-property-value-history nil "History for text and overlay property values.")
383
384 (defvar icicle-cmd-calling-for-completion 'ignore
385 "Last command causing display of list of possible completions.")
386
387 (defvar icicle-cmd-reading-input 'ignore
388 "Last command reading input in the minibuffer.")
389
390 (defvar icicle-color-history nil "History for color names.")
391
392 (defvar icicle-color-theme-history nil "History for color-theme names.")
393
394 (defvar icicle-command-abbrev-history nil "History of command and abbrev entries.")
395
396 (defvar icicle-commands-for-abbrev nil
397 "List of commands that match the current abbreviation.")
398
399 (defvar icicle-common-match-string nil
400 "Expanded common match among all completion candidates.
401 nil means no such common match is available.")
402
403 (defvar icicle-comp-base-is-default-dir-p nil
404 "Non-nil means to use `default-directory' as the completion base.
405 This means use its length as `completion-base-size'.")
406
407 (defvar icicle-complete-input-overlay nil
408 "Overlay used to highlight minibuffer input when it is complete.")
409
410 (defvar icicle-complete-keys-alist () "Alist of keys and their bindings.
411 Each alist element is of the form (NAME KEY . BINDING), where:
412 NAME is a symbol naming the key and its binding, whose name has form:
413 KEYNAME = BINDING-NAME
414 KEY is the actual key sequence
415 BINDING is the actual binding of KEY.
416
417 Used only for Emacs 22 and later.")
418
419 (defvar icicle-completing-keys-p nil
420 "Non-nil means completion is currently for a key sequence.
421 Used only for Emacs 22 and later.")
422
423 (defvar icicle-completing-p nil "Cached value of function `icicle-completing-p'.")
424
425 (defvar icicle-completion-candidates nil "Current list of completion candidates.")
426
427 (defvar icicle-completion-prompt-overlay nil
428 "Overlay used to highlight saved completion candidates.")
429
430 (defvar icicle-completing-read+insert-candidates ()
431 "`completing-read' COLLECTION arg to use for `icicle-completing-read+insert'.")
432
433 (defvar icicle-completion-set-history nil "History for completion-set names.")
434
435 (defvar icicle-compute-narrowing-regexp-p nil
436 "Non-nil means that narrowing computes `icicle-narrow-regexp'.")
437
438 (defvar icicle-confirm-exit-commands
439 (and (boundp 'minibuffer-confirm-exit-commands)
440 (append '(icicle-prefix-complete icicle-prefix-complete-no-display
441 icicle-prefix-word-complete
442 icicle-apropos-complete icicle-apropos-complete-no-display
443 icicle-apropos-complete-and-narrow ; ????
444 ;; icicle-apropos-complete-and-exit ; ????
445 )
446 minibuffer-confirm-exit-commands))
447 "Version of `minibuffer-confirm-exit-commands' for Icicle mode.
448 Effective starting with Emacs 23.")
449
450 (defvar icicle-current-completion-candidate-overlay nil
451 "Overlay used to highlight current completion candidate.")
452
453 (defvar icicle-current-completion-mode nil
454 "Symbol `prefix' or `apropos', specifying the current completion mode.")
455
456 (defvar icicle-current-font-lock-part nil
457 "The part of `font-lock-keywords' currently being used, during cycling.
458 Updated by `icicle-next-font-lock-keywords(-repeat)'.")
459
460 (defvar icicle-current-input "" "Current minibuffer input.")
461
462 (defvar icicle-current-raw-input "" "Current minibuffer raw (unexpanded) input.
463 This can be different from `icicle-current-input' only when
464 `icicle-expand-input-to-common-match' causes your input to expand.")
465
466 (defvar icicle-cycling-p nil
467 "Non-nil means the user is currently cycling completion candidates.")
468
469 (defvar icicle-default-thing-insertion-flipped-p nil
470 "Non-nil means a previous `M-.' in this succession was used with `C-u'.
471 This means that the meaning of `icicle-default-thing-insertion' has
472 been reversed.")
473
474 (defvar icicle-dictionary-history nil "History for dictionary entries.")
475
476 (defvar icicle-dir-candidate-can-exit-p nil
477 "Non-nil means you can exit the minibuffer when you choose a directory.")
478
479 (defvar icicle-doc-history () "History for documentation entries.")
480
481 (defvar icicle-doc-last-initial-cand-set ()
482 "Cache for initial set of completion candidates for `icicle-doc'.")
483
484 (defvar icicle-dot-string-internal icicle-dot-string
485 "Internal version of `icicle-dot-string' (same values).
486 This is changed automatically by Icicles when you switch completion
487 mode, whereas `icicle-dot-string' is changed only via user commands.")
488
489 (defvar icicle-edit-update-p nil
490 "Internal flag: non-nil when editing text in minibuffer.
491 More precisely, non-nil when updating the completions list inside
492 simple character-editing commands such as `icicle-self-insert' and
493 `icicle-delete-backward-char'.")
494
495 (defvar icicle-ess-use-ido nil
496 "Non-nil means that `ess-completing-read' respects `ess-use-ido'.
497 Otherwise, in Icicle mode `ess-completing-read' always uses Icicles
498 completion, never Ido completion.")
499
500 (defvar icicle-exclude-default-proxies nil
501 "Non-nil means exclude default proxy candidates.")
502
503 (defvar icicle-explore-final-choice ""
504 "Final `icicle-explore' completion choice (a string).")
505
506 (defvar icicle-explore-final-choice-full nil
507 "Full alist element that corresponds to `icicle-explore-final-choice'.
508 This is an element of `icicle-candidates-alist'.
509 The element's car is a completion-candidate string.")
510
511 (defvar icicle-extra-candidates nil "A list of extra completion candidates (strings).")
512
513 (defvar icicle-extra-candidates-dir-insert-p t
514 "Non-nil means, for an extra candidate, insert a directory component.
515 Can be bound to nil to prevent adding a directory to non file-name
516 extra candidates during file-name completion. An extra candidate is
517 one that is a member of `icicle-extra-candidates'.")
518
519 (defvar icicle-face-name-history nil "History for face names.")
520
521 (defvar icicle-fancy-candidates-p nil
522 "Non-nil means we are completing using possibly fancy candidates.
523 That is, some candidates might have attached properties.
524
525 You can bind this in your code if you need to treat fancy candidates
526 and your code has no direct access to the `completing-read' PROMPT
527 string. See section `Candidates with Text Properties' of the Icicles
528 doc.
529
530 If you set this to non-nil, instead of binding it, then Icicles will
531 always check whether each completion candidate might be fancy. That
532 can be costly.")
533
534 (defvar icicle-fancy-cands-internal-p nil
535 "Same as `icicle-fancy-candidates-p', but for internal use only.
536 Do not set or bind this. This is bound only by `completing-read'.")
537
538 (when (> emacs-major-version 23)
539 (defvar icicle-file-name-completion-table
540 (completion-table-in-turn #'icicle-completion--embedded-envvar-table
541 #'completion-file-name-table)
542 "Completion table used for file-name completion."))
543
544 (defvar icicle-file-sort-first-time-p t
545 "Non-nil means file-name completion has not yet been used.")
546
547 (defvar icicle-filtered-default-value nil
548 "Minibuffer default value, after filtering with `icicle-filter-wo-input'.")
549
550 (defvar icicle-font-name-history nil "History for font names.")
551
552 (defvar icicle-frame-alist nil "Alist of frames, returned by `icicle-make-frame-alist'.")
553
554 (defvar icicle-frame-name-history nil "History for frame names.")
555
556 (defvar icicle-full-cand-fn nil
557 "nil or a function to create a full candidate from a display candidate.
558 If candidates are currently multi-completions then the display
559 candidate is assumed to have been transformed first (using
560 `icicle-transform-multi-completion').")
561
562 (defvar icicle-function-name-history nil "History for function names.
563 Each name is a symbol name or a lambda form, as a string.")
564
565 (defvar icicle-fundoc-last-initial-cand-set ()
566 "Cache for initial set of completion candidates for `icicle-fundoc'.")
567
568 (defvar icicle-general-help-string "
569
570
571 Customize Icicles: `M-x icicle-customize-icicles-group'.
572 Summary of customizable options and faces (alphabetical order).
573
574 Some of the options can be toggled or cycled - the keys for this are
575 noted in parentheses.
576
577 * `case-fold-search', `completion-ignore-case',
578 (`C-u') `read-file-name-completion-ignore-case'
579 - Case sensitivity? (`C-A')
580 * `completion-ignored-extensions' - Ignored filenames (`C-.')
581 * `icicle-act-before-cycle-flag' - Act then cycle or reverse?
582 * `icicle-add-proxy-candidates-flag' - Include proxies? (`C-M-_')
583 * `icicle-alternative-actions-alist' - Overriding alt actions
584 * `icicle-alternative-sort-comparer' - Other sort (`M-,', `C-M-,')
585 * `icicle-apropos-complete-keys*' - Keys to apropos-complete
586 * `icicle-apropos-cycle-*-keys' - Keys to apropos-cycle
587 * `icicle-bookmark-name-length-max' - Max length of bookmark name
588 * `icicle-bookmark-refresh-cache-flag' - Refresh bookmarks cache?
589 * `icicle-top-level-key-bindings' - Bind top-level commands
590 * `icicle-buffer-*' - `icicle-buffer' options
591 * `icicle-candidate-width-factor' - Width %%, candidate columns
592 * `icicle-change-region-background-flag' - Change region color?
593 * `icicle-change-sort-order-completion' - Control `C-,' behavior
594 * `icicle-C-l-uses-completion-flag' - `C-l' uses completion?
595 * `icicle-color-themes' - For `icicle-color-theme'
596 * `icicle-comint-dynamic-complete-replacements' - Comint complete fns
597 * `icicle-command-abbrev*' - Command abbrev behavior
598 * `icicle-complete-key-anyway-flag' - `S-TAB' must complete keys
599 * `icicle-complete-keys-self-insert-ranges'- `S-TAB' for self-insert?
600 * `icicle-completing-read+insert-keys' - Keys for complete-on-demand
601 * `icicle-completion-history-max-length' - Completion history length
602 * `icicle-completion-key-bindings' - minibuffer completion keys
603 * `icicle-completion-list-key-bindings' - `*Completions*' bindings
604 * `icicle-Completions-display-min-input-chars'- Remove `*Completions*'
605 if fewer chars input
606 * `icicle-completions-format' - `*Completions*' layout
607 * `icicle-move-Completions-frame' - `*Completions*' at edge?
608 * `icicle-Completions-text-scale-decrease'- `*Completions*' shrink
609 * `icicle-Completions-window-max-height' - Max lines, `*Completions*'
610 * `icicle-customize-save-flag' - Save some options on quit?
611 * `icicle-default-cycling-mode' - Default completion mode for
612 per-mode cycling
613 * `icicle-default-thing-insertion' - Control behavior of \
614 \\<minibuffer-local-completion-map>\\[icicle-insert-string-at-point]
615 * `icicle-default-value' - How to treat default value
616 * `icicle-define-alias-commands-flag' - Define top-level aliases?
617 * `icicle-deletion-action-flag' - `S-delete' deletes?
618 * `icicle-dot-show-regexp-flag' - Show regexp for `.'?
619 * `icicle-dot-string' - String that `.' inserts
620 * `icicle-expand-input-to-common-match' - Expand your input? (`C-M-\"')
621 * `icicle-expand-input-to-common-match-alt' - Expand your input? (`C-\"')
622 * `icicle-file-*' - `icicle-file' options
623 * `icicle-filesets-as-saved-completion-sets-flag'- Use filesets?
624 * `icicle-guess-commands-in-path' - Shell commands to complete
625 * `icicle-help-in-mode-line-delay' - Secs to show candidate help
626 * `icicle-hide-common-match-in-Completions-flag'- Show common match?
627 * `icicle-hide-non-matching-lines-flag' - Hide non-match lines?
628 * `icicle-highlight-historical-candidates-flag'
629 - Highlight past input?
630 * `icicle-highlight-input-completion-failure*'- Input non-match sign
631 * `icicle-highlight-input-initial-whitespace-flag'
632 - Highlight input whitespace?
633 * `icicle-highlight-lighter-flag' - Highlight mode-line `Icy'
634 * `icicle-incremental-completion' - Icompletion? (`C-#')
635 * `icicle-incremental-completion-delay' - Delay before update cands
636 * `icicle-incremental-completion-threshold'- # of candidates for delay
637 * `icicle-inhibit-advice-functions' - Advice-inhibited functions
638 * `icicle-inhibit-ding-flag' - Suppress audible bell
639 * `icicle-input-string' - String inserted by `C-='
640 * `icicle-inter-candidates-min-spaces' - Min spaces among candidates
641 * `icicle-isearch-complete-keys' - Keys to complete search
642 * `icicle-key-complete-keys' - Keys to complete keys
643 * `icicle-key-descriptions-use-<>-flag' - Show key names with \"<>\"?
644 * `icicle-keymaps-for-key-completion' - `S-TAB' = key-complete maps
645 * `icicle-kmacro-ring-max' - Icicles `kmacro-ring-max'
646 * `icicle-levenshtein-distance' - Levenshtein match distance
647 * `icicle-list-join-string' - Multi-completion join
648 * `icicle-list-nth-parts-join-string' - Join split-candidate parts
649 * `icicle-mark-position-in-candidate' - Mark position in cycling
650 * `icicle-menu-items-to-history-flag' - Add menus to history?
651 * `icicle-minibuffer-key-bindings' - general minibuffer keys
652 * `icicle-minibuffer-setup-hook' - Functions run after setup
653 * `icicle-modal-cycle-*-keys' - Keys for modal cycling
654 * `icicle-option-type-prefix-arg-list' - Prefix-args for `C-h C-o'
655 * `icicle-point-position-in-candidate' - Cursor position in cycling
656 * `icicle-populate-interactive-history-flag'- Track interactive use?
657 * `icicle-pp-eval-expression-print-*' - Print control for `pp-*'
658 * `icicle-prefix-complete-keys*' - Keys to prefix-complete
659 * `icicle-prefix-cycle-*-keys' - Keys to prefix-cycle
660 * `icicle-quote-shell-file-name-flag' - Quote file name in shell?
661 * `icicle-read+insert-file-name-keys' - Keys for on-demand file
662 * `icicle-regexp-quote-flag' - Escape chars? (`C-`')
663 * `icicle-regexp-search-ring-max' - `regexp-search-ring-max'
664 * `icicle-region-background' - Background for region
665 * `icicle-require-match-flag' - Override REQUIRE-MATCH?
666 * `icicle-saved-completion-sets' - Completion sets for \
667 `\\[icicle-candidate-set-retrieve]'
668 * `icicle-search-cleanup-flag' - Remove search highlighting?
669 (`C-.')
670 * `icicle-search-from-isearch-keys' - Isearch-to-Icicles keys
671 * `icicle-search-highlight-all-current-flag'- In each hit (`C-^')
672 * `icicle-search-highlight-context-levels-flag' -
673 Highlight match subgroups?
674 * `icicle-search-highlight-threshold' - # hits to highlight at once
675 * `icicle-search-hook' - Functions run by `C-c `'
676 * `icicle-search-replace-common-match-flag' - Replace ECM? (`M-;')
677 * `icicle-search-replace-literally-flag' - Replace text literally?
678 * `icicle-search-replace-whole-candidate-flag' - Replace input match
679 or whole search hit?(`M-_')
680 * `icicle-search-ring-max' - Icicles `search-ring-max'
681 * `icicle-search-whole-word-flag' - Find whole words? (`M-q')
682 * `icicle-show-Completions-help-flag' - Show `*Completions*' help?
683 * `icicle-show-Completions-initially-flag'- Show `*Completions*' 1st?
684 * `icicle-show-multi-completion-flag' - Show extra candidate info?
685 * `icicle-sort-comparer' - Sort candidates (`C-,')
686 * `icicle-sort-orders-alist' - Predicates for sorting
687 * `icicle-special-candidate-regexp' - To highlight special cands
688 * `icicle-S-TAB-completion-methods-alist'- `S-TAB' methods (`M-(')
689 * `icicle-swank-*' - Swank completion control
690 * `icicle-TAB-completion-methods' - `TAB' methods (`C-(')
691 * `icicle-TAB-shows-candidates-flag' - 1st `TAB' shows candidates?
692 * `icicle-test-for-remote-files-flag' - Check remote files? (`C-^')
693 * `icicle-thing-at-point-functions' - Functions to yank things
694 * `icicle-top-level-key-bindings' - Top-level key bindings
695 * `icicle-top-level-when-sole-completion-*'- Exiting if one completion
696 * `icicle-touche-pas-aux-menus-flag' - Add to standard menus?
697 * `icicle-transform-function' - Remove duplicates (`C-$')
698 * `icicle-type-actions-alist' - Objects and their types
699 * `icicle-unpropertize-completion-result-flag'- Properties in result?
700 * `icicle-update-input-hook' - Fns run when input changes
701 * `icicle-use-~-for-home-dir-flag' - Use `~' for $HOME? (`M-~')
702 * `icicle-use-C-for-actions-flag' - `C-' for actions? (`M-g')
703 * `icicle-use-candidates-only-once-flag' - Remove used candidate?
704 * `icicle-word-completion-keys' - Keys for word completion
705 * `icicle-WYSIWYG-Completions-flag' - WYSIWYG `*Completions*'?
706 * `icicle-yank-function' - Yank function to use
707
708 Faces that highlight input in minibuffer.
709
710 * `icicle-complete-input' - Input when it is complete
711 * `icicle-completion' - Completing?
712 * `icicle-input-completion-fail*' - Non-match part of input
713 * `icicle-match-highlight-minibuffer' - Matched part of input
714 * `icicle-multi-command-completion' - Multi-command completion?
715 * `icicle-mustmatch-completion' - Strict completion?
716 * `icicle-whitespace-highlight' - Initial whitespace in input
717
718 Faces that highlight candidates in buffer `*Completions*'.
719
720 * `icicle-candidate-part' - Part of candidate
721 * `icicle-common-match-highlight-Completions' - Max common substring
722 * `icicle-current-candidate-highlight' - Current candidate (cycling)
723 * `icicle-extra-candidate' - Extra candidate
724 * `icicle-historical-candidate' - Highlight candidates used
725 * `icicle-match-highlight-Completions' - Matched part of input
726 * `icicle-proxy-candidate' - Proxy candidate
727 * `icicle-saved-candidate' - Saved candidate
728 * `icicle-special-candidate' - Special candidate
729
730 Faces that highlight information in the mode line.
731
732 * `icicle-completion' - Completing?
733 * `icicle-mode-line-help' - Candidate help
734 * `icicle-multi-command-completion' - Multi-command completion?
735 * `icicle-mustmatch-completion' - Strict completion?
736
737 Faces that highlight for command `icicle-search'.
738
739 * `icicle-search-context-level-*' - Regexp subgroup highlighting
740 * `icicle-search-current-input' - What input matches
741 * `icicle-search-main-regexp-current' - Current match of 1st regexp
742 * `icicle-search-main-regexp-others' - Other matches of 1st regexp
743
744 Icicle mode defines many top-level commands. For a list, see the
745 Commentary headers of files `icicles-cmd1.el' and `icicles-cmd2.el'.
746
747
748 These are all of the top-level bindings in Icicle mode:
749
750 \\{icicle-mode-map}"
751 "General help string included in `icicle-minibuffer-help'.")
752
753 (defvar icicle-get-alist-candidate-function 'icicle-get-alist-candidate
754 "Function used to retrieve a full completion candidate.
755 The signature must match that of the default value,
756 `icicle-get-alist-candidate'.")
757
758 (defvar icicle-hist-cands-no-highlight ()
759 "List of candidates not highlighted using `icicle-historical-candidate'.
760 Bind, don't assign this, since the same string can have different
761 meanings in different contexts.")
762
763 (defvar icicle-hist-var nil
764 "A history variable.
765 `let'-bind this to a history variable.
766 Leave the global value as `nil', to use it conditionally: (or ...).")
767
768 (defvar icicle-ignored-extensions completion-ignored-extensions
769 "Copy of `completion-ignored-extensions', serving as a control flag.
770 When `completion-ignored-extensions' changes, we remake
771 `icicle-ignored-extensions-regexp'.")
772
773 (defvar icicle-ignored-extensions-regexp
774 (concat "\\(" (mapconcat #'regexp-quote completion-ignored-extensions "$\\|")
775 "$\\)\\'")
776 "Regular expression matching ignored file extensions.
777 If this is nil, then no file extensions are ignored.
778 The ignored file extensions come from `completion-ignored-extensions'.")
779
780 (defvar icicle-incremental-completion-p nil
781 "Takes the place of `icicle-incremental-completion' during input.
782 The program updates this to `always' from `t' after `*Completions*' has
783 been displayed.")
784
785 (defvar icicle-Info-index-cache ()
786 "Cache list of index entries and their nodes and files.
787 Each cache entry has the form (TOPIC NODE INFO-FILE).")
788
789 (defvar icicle-Info-only-rest-of-book-p nil
790 "Non-nil means complete only Info nodes from the rest of the book.")
791
792 (defvar icicle-Info-tag-table-posn nil
793 "Tag table position in last Info file used by `icicle-Info-goto-node'.")
794
795 (defvar icicle-inhibit-sort-p nil
796 "Non-nil means that users cannot sort completion candidates.
797 They also cannot remove duplicates.")
798
799 (defvar icicle-inhibit-try-switch-buffer nil
800 "Non-nil means do not switch back to `icicle-orig-buff'.
801 \(The potential switching is in `icicle-try-switch-buffer'.)")
802
803 (defvar icicle-initial-value ""
804 "Initial value used in minibuffer completion.
805 Any function that reads from the minibuffer and accepts a default
806 value or initial value should, before reading, put that value in
807 `icicle-initial-value'. For example, `completing-read' does that.
808
809 In addition, `completing-read' and `read-file-name' will respect this
810 value, using it as the initial value if none is provided explicitly.
811 This means that you can bind `icicle-initial-value' around an
812 expression that calls `completing-read' or `read-file-name', and the
813 bound value will be used as the initial value.")
814
815 (defvar icicle-input-completion-fail-overlay nil
816 "Overlay used to highlight the input portion that does not complete.")
817
818 (defvar icicle-input-fail-pos nil
819 "Position in minibuffer of start of completion match failure.
820 Nil means no match failure is known.")
821
822 (defvar icicle-insert-string-at-pt-end nil
823 "Position of end of text `icicle-insert-string-at-point' inserted.")
824
825 (defvar icicle-insert-string-at-pt-start nil
826 "Position of start of text `icicle-insert-string-at-point' inserted.")
827
828 (defvar icicle-interactive-history ()
829 "History of commands called using `call-interactively'.")
830
831 (defvar icicle-key-prefix-description ""
832 "Description of a prefix key at some point during key completion.")
833
834 (defvar icicle-kill-history nil "History of kill-ring entries.")
835
836 (when (boundp 'kmacro-ring) ; Emacs 22+
837 (defvar icicle-kmacro-alist nil
838 "Alist with elements (CANDIDATE-NAME . RING-ITEM).
839 CANDIDATE-NAME is 1, 2, 3....
840
841 RING-ITEM is an item in `kmacro-ring' or `(kmacro-ring-head)'.")
842 (defvar icicle-kmacro-history nil "History for keyboard-macro names."))
843
844 (defvar icicle-last-apropos-complete-match-fn 'string-match
845 "Last value of `icicle-apropos-complete-match-fn'.")
846
847 (defvar icicle-last-completion-candidate ""
848 "Last completion candidate used in minibuffer completion.")
849
850 (defvar icicle-last-completion-command nil "Last completion command used.")
851
852 (defvar icicle-last-icomplete-mode-value (and (featurep 'icomplete) icomplete-mode)
853 "Value of `icomplete-mode' when completion started.")
854
855 (defvar icicle-last-input "" "Last minibuffer input typed (not from cycling).")
856
857 (defvar icicle-last-sort-comparer (or icicle-sort-comparer 'icicle-case-string-less-p)
858 "Local copy of `icicle-sort-comparer', so we can restore it.")
859
860 (defvar icicle-last-top-level-command nil "Last top-level command used.")
861
862 (defvar icicle-lighter-truncation "..."
863 "String appended to Icy lighter to show candidates-list truncation.")
864
865 (defvar icicle-list-use-nth-parts nil
866 "List of indexes of multi-completion pieces to use.
867 This is not an internal variable. You can bind this in your own Lisp
868 code to affect completion behavior.
869
870 An empty list means use the entire multi-completion. Otherwise,
871 concatenate, in order, the Nth parts of the multi-completion, where N
872 is each of the (one-based) indexes, in turn. Any index larger than
873 the actual number of parts in the multi-completion means use the last
874 part.
875
876 For example: If the value is (1), then use only the first part of the
877 multi-completion as the completion candidate. If the value is (2 1),
878 then use as candidate the second part followed by the first part, the
879 two parts being joined by option `icicle-list-nth-parts-join-string'.
880 If the value is (1 99) and the multi-completion has fewer than 99
881 parts, then use the first and last parts, joined by
882 `icicle-list-nth-parts-join-string'. If the value is (2 1 2), then
883 use the second part, first part, and second part again - you can use a
884 given part any number of times.")
885
886 (defvar icicle-menu-map nil "Icicles menu-bar menu keymap.")
887
888 (defvar icicle-minibuffer-message-ok-p t
889 "Non-nil means we can show messages in minibuffer.
890 This affects only `icicle-msg-maybe-in-minibuffer'.")
891
892 (defvar icicle-minor-mode-map-entry nil "Icicles mode entry in `minor-mode-map-alist'.")
893
894 (defvar icicle-mode-line-help nil "Current mode line help (a string), or nil if none.")
895
896 (defvar icicle-ms-windows-drive-hash (and (fboundp 'make-hash-table)
897 (make-hash-table :test 'equal))
898 "Hash table for caching result of MS Windows `NET USE' system calls.
899 For Emacs 20 and 21, this is not used unless you load library `cl.el'
900 at runtime.")
901
902 (defvar icicle-multi-completing-p nil
903 "Non-nil means we are currently completing with multi-completions.")
904
905 (defvar icicle-multi-inputs-action-fn nil
906 "Function to apply to candidates that result from splitting input.
907 The current minibuffer input is interpreted as a list of candidates.
908 This function is applied to each candidate in turn, in list order.
909 If nil then act using function `icicle-candidate-action-fn'.")
910
911 (defvar icicle-must-match-regexp nil
912 "A regexp that completion candidates must match, or nil.
913 If nil, then this does nothing. If a regexp (string), then show only
914 candidates whose display form matches it (and matches the user input).
915 The display form is the string shown in `*Completions*'.
916
917 Note: This is similar to the standard variable
918 `completion-regexp-list', except:
919 * `completion-regexp-list' is a list of regexps, not just one.
920 * `icicle-must-match-regexp' is used after filtering using option
921 `icicle-transform-function'.
922
923 See also `icicle-must-not-match-regexp'.")
924
925 (defvar icicle-must-not-match-regexp nil
926 "A regexp that completion candidates must not match, or nil.
927 If nil, then this does nothing. If a regexp (string), then show only
928 candidates whose display form does not match it.
929 The display form is the string shown in `*Completions*'.
930 See also `icicle-must-match-regexp'.")
931
932 (defvar icicle-must-pass-after-match-predicate nil
933 "Predicate that completions must satisfy after matching input, or nil.
934 This is just like `icicle-must-pass-predicate', except that it is
935 applied only to display candidates that match your current input.")
936
937 (defvar icicle-must-pass-predicate nil
938 "Predicate that completion display candidates must satisfy, or nil.
939 If nil, then this does nothing. Otherwise, this is a function of one
940 argument, a display candidate (a string), and only the display
941 candidates that satisfy the predicate are displayed. A display
942 candidate is a string of text such as you see in buffer
943 `*Completions*'.
944
945 Note that this predicate is different from the PREDICATE argument for
946 function `completing-read' or `read-file-name'. The latter applies to
947 the elements of the COLLECTION argument, which are typically alist
948 entries or obarray symbols. `icicle-must-pass-predicate' applies
949 instead to a string, the display form of a completion candidate.
950
951 See also `icicle-must-pass-after-match-predicate'.")
952
953 (defvar icicle-narrow-regexp nil
954 "Regexp matching each member of `icicle-completion-candidates'.
955 This is nil except during narrowing, and then only if
956 `icicle-compute-narrowing-regexp-p' is non-nil.")
957
958 (defvar icicle-nb-candidates-before-truncation 0
959 "Number of candidates, before truncation per `icicle-max-candidates'.")
960
961 (defvar icicle-nb-of-other-cycle-candidates 0
962 "Number of other candidates available for cycling.
963 This is for use by other libraries, in particular, `icomplete+.el'.")
964
965 (defvar icicle-new-last-cmd nil
966 "Copy of current command being executed.
967 Used by, e.g., `icicle-execute-extended-command'.")
968
969 (defvar icicle-next-apropos-complete-cycles-p nil
970 "Whether the next apropos-completion command should cycle.")
971
972 (defvar icicle-next-prefix-complete-cycles-p nil
973 "Whether the next prefix-completion command should cycle.")
974
975 (defvar icicle-orig-buff nil
976 "Current buffer when you invoked an Icicles multi-command.")
977
978 (defvar icicle-orig-font-lock-keywords nil
979 "Saved value of `font-lock-keywords'.")
980 (make-variable-buffer-local 'icicle-orig-font-lock-keywords)
981
982 (defvar icicle-orig-minibuffer-completion-pred nil
983 "Saved value of `minibufer-completion-predicate'.")
984
985 (defvar icicle-orig-minibuffer-completion-table nil
986 "Saved value of `minibufer-completion-table'.")
987
988 (defvar icicle-orig-must-match-regexp nil
989 "Saved value of `icicle-must-match-regexp'.")
990
991 (defvar icicle-orig-must-not-match-regexp nil
992 "Saved value of `icicle-must-not-match-regexp'.")
993
994 (defvar icicle-orig-must-pass-after-match-pred nil
995 "Saved value of `icicle-must-pass-after-match-predicate'.")
996
997 (defvar icicle-orig-must-pass-predicate nil
998 "Saved value of `icicle-must-pass-predicate'.")
999
1000 (defvar icicle-orig-pt-explore nil
1001 "Point when you invoked `icicle-explore'.")
1002
1003 (defvar icicle-orig-read-file-name-fn (and (not (boundp 'read-file-name-function)) ; Em 22+
1004 'icicle-ORIG-read-file-name) ; Emacs 20, 21
1005 "Value of `read-file-name-function' outside of Icicle mode.
1006 For versions of Emacs < 22, this is the original `read-file-name'.")
1007
1008 (defvar icicle-orig-window nil
1009 "Selected window when you invoked an Icicles multi-command.")
1010
1011 (defvar icicle-orig-win-explore nil
1012 "Selected window when you invoked `icicle-explore'.")
1013
1014 (defvar icicle-other-window nil
1015 "Window scrolled by `icicle-scroll-forward'/`icicle-scroll-backward'")
1016
1017 (defvar icicle-path-variables '(cd-path charset-map-path compilation-search-path
1018 custom-theme-load-path exec-path ffap-bib-path ffap-c-path
1019 ffap-fortran-path ffap-tex-path find-function-source-path
1020 image-load-path load-path x-bitmap-file-path)
1021 "List of variables whose value can be a list containing directories.
1022 The variables are not checked until they are used. At that time:
1023 * Any of them that are not bound are ignored.
1024 * If the value of any of them is not a list it is ignored.
1025 * If it is a list, any non-string elements in the list are ignored.")
1026
1027 (defvar icicle-plist-last-initial-cand-set ()
1028 "Cache for initial set of completion candidates for `icicle-plist'.")
1029
1030 (defvar icicle-post-command-hook nil
1031 "Functions added to `post-command-hook' when in Icicle mode.
1032 Use command `icy-mode' (aka `icicle-mode') to set this up properly.")
1033
1034 (defvar icicle-pre-command-hook nil
1035 "Functions added to `pre-command-hook' when in Icicle mode.
1036 Use command `icy-mode' (aka `icicle-mode') to set this up properly.")
1037
1038 (defvar icicle-predicate-types-alist
1039 '(("arrayp") ("atom") ("auto-save-file-name-p" . "file") ("backup-file-name-p" . "file")
1040 ("booleanp") ("bool-vector-p") ("bufferp" . "buffer")
1041 ("byte-code-function-p" . "function") ("byte-compile-const-symbol-p" . "symbol")
1042 ("case-table-p") ("char-or-string-p") ("char-table-p") ("color-defined-p" . "color")
1043 ("commandp" . "command") ("consp") ("custom-variable-p" . "option")
1044 ("display-table-p") ("facep" . "face") ("fboundp" . "function")
1045 ("ffap-file-remote-p" . "file") ("file-accessible-directory-p" . "file")
1046 ("file-directory-p" . "file") ("file-executable-p" . "file")
1047 ("file-exists-p" . "file") ("file-name-absolute-p" . "file")
1048 ("file-readable-p" . "file") ("file-regular-p" . "file") ("file-remote-p" . "file")
1049 ("file-symlink-p" . "file") ("file-writable-p" . "file") ("floatp")
1050 ("frame-configuration-p") ("frame-iconified-p" . "frame") ("frame-live-p" . "frame")
1051 ("frame-visible-p" . "frame") ("framep" . "frame") ("functionp" . "function")
1052 ("hash-table-p") ("icicle-binary-option-p" . "option") ("info-file-exists-p" . "file")
1053 ("integer-or-marker-p") ("integerp") ("keymapp") ("keywordp") ("listp")
1054 ("local-variable-p" . "variable") ("markerp") ("wholenump") ("nlistp") ("numberp")
1055 ("number-or-marker-p") ("overlayp") ("processp" . "process")
1056 ("process-running-child-p" . "process") ("risky-local-variable-p" . "variable")
1057 ("safe-local-variable-p" . "variable") ("sequencep") ("string-or-null-p") ("stringp")
1058 ("subrp") ("symbolp" . "symbol") ("syntax-table-p")
1059 ("thumfr-thumbnail-frame-p" . "frame") ("truncated-partial-width-window-p" . "window")
1060 ("user-variable-p" . "option") ("vectorp") ("window-configuration-p")
1061 ("window-fixed-size-p" . "window") ("window-full-width-p" . "window")
1062 ("window-live-p" . "window") ("window-minibuffer-p" . "window") ("windowp" . "window")
1063 ("window-safely-shrinkable-p" . "window") ("x-color-defined-p" . "color"))
1064 "Alist of type names that are predicate names.
1065 Each element is cons of a predicate name and the associated type from
1066 `icicle-type-actions-alist' (or nil if there is no associated type).")
1067
1068 (defvar icicle-pref-arg nil
1069 "Prefix arg value when you invoked an Icicles multi-command.")
1070
1071 (defvar icicle-pre-minibuffer-buffer nil
1072 "Buffer that was current before the minibuffer became active.")
1073
1074 (defvar icicle-previous-raw-file-name-inputs nil
1075 "Previous inputs user has typed during file-name completion.
1076 These are inputs typed but not necessarily entered with `RET'.")
1077
1078 (defvar icicle-previous-raw-non-file-name-inputs nil
1079 "Previous inputs user has typed during non-file-name completion.
1080 These are inputs typed but not necessarily entered with `RET'.")
1081
1082 (defvar icicle-progressive-completing-p nil
1083 "Non-nil means this completion is a narrowing completion.")
1084
1085 (defvar icicle-prompt nil
1086 "A minibuffer prompt.
1087 `let'-bind this to a string.
1088 Leave the global value as `nil', to use it conditionally: (or ...).")
1089
1090 (defvar icicle-proxy-candidate-regexp nil
1091 "Regexp to match proxy candidates, or nil to do nothing.
1092 The candidates are highlighted in buffer `*Completions*' using face
1093 `icicle-proxy-candidate'.")
1094
1095 (defvar icicle-proxy-candidates nil "List of proxy completion candidates (strings).")
1096
1097 (when (fboundp 'read-char-by-name) ; Emacs 23+
1098 (defvar icicle-read-char-history ()
1099 "History list for reading characters by name.
1100 Augmented by `icicle-read-char-maybe-completing' and
1101 `icicle-read-char-by-name'."))
1102
1103 (defvar icicle-read-expression-map nil
1104 "Icicle mode version of `read-expression-map'.
1105 Several Emacs-Lisp mode key bindings are used.")
1106 (unless icicle-read-expression-map
1107 (let ((map (make-sparse-keymap)))
1108 (define-key map (icicle-kbd "C-M-i") 'indent-lisp-line) ; `ESC TAB', `C-M-i'
1109 (define-key map (icicle-kbd "C-i") 'lisp-complete-symbol) ; `C-i', `TAB'
1110 (define-key map (icicle-kbd "ESC tab") 'indent-lisp-line) ; `ESC tab'
1111 (define-key map (icicle-kbd "C-M-x") 'eval-defun) ; `ESC C-x', `C-M-x'
1112 (define-key map (icicle-kbd "C-M-q") 'indent-pp-sexp) ; `ESC C-q', `C-M-q'
1113 ;;(define-key map (icicle-kbd "DEL") 'backward-delete-char-untabify)
1114 (set-keymap-parent map minibuffer-local-map)
1115 (setq icicle-read-expression-map map)))
1116
1117 (defvar icicle-remove-icicles-props-p t
1118 "Non-nil means to remove Icicles text properties from completion result.
1119 Icicles binds this internal variable to nil in contexts where it needs
1120 the completion result string to retain its Icicles text properties.
1121
1122 Otherwise, function `icicle-unpropertize-completion' removes at least
1123 the Icicles internal text properties from the final completion result.
1124 Depending on the value of option
1125 `icicle-unpropertize-completion-result-flag', it may also remove all
1126 text properties.")
1127
1128 ;; Same as `directory-files-no-dot-files-regexp' in `files.el', available for Emacs 23+.
1129 (defconst icicle-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
1130 "Regexp that matches anything except `.' and `..'.")
1131
1132 (defvar icicle-require-match-p nil
1133 "Current REQUIRE-MATCH arg to `completing-read' or `read-file-name'.
1134 Starting with Emacs 23, this is no longer enough to tell whether a
1135 match is required - use function `icicle-require-match-p' instead.")
1136
1137 (defvar icicle-reverse-multi-sort-p nil
1138 "Non-nil means the truth values returned by predicates are complemented.
1139 This changes the order of the sorting groups, but it does not in
1140 general reverse that order. The order within each group is unchanged
1141 \(not reversed).")
1142
1143 (defvar icicle-reverse-sort-p nil
1144 "Non-nil means that candidates are being sorted in the reverse order.")
1145
1146 (defvar icicle-saved-candidate-overlays nil
1147 "Overlays used to highlight saved completion candidates.")
1148
1149 (defvar icicle-saved-candidates-variables-obarray (make-vector 100 0)
1150 "Obarray of variables you have saved sets of completion candidates in.
1151 Used for completion in `icicle-candidate-set-retrieve-from-variable'.")
1152
1153 (defvar icicle-saved-completion-candidate nil
1154 "Completion candidate to be restored after recursive `completing-read'.")
1155
1156 (defvar icicle-saved-completion-candidates nil
1157 "Completion candidates saved using `icicle-candidate-set-save'.")
1158
1159 (defvar icicle-saved-completion-candidates-internal nil
1160 "Completion candidates saved temporarily by program.")
1161
1162 (defvar icicle-saved-ignored-extensions nil
1163 "Local copy of `icicle-ignored-extensions', so we can restore it.")
1164
1165 (when (boundp 'kmacro-ring) ; Emacs 22+
1166 (defvar icicle-saved-kmacro-ring-max kmacro-ring-max
1167 "Saved value of `kmacro-ring-max', so it can be restored."))
1168
1169 (defvar icicle-saved-regexp-search-ring-max regexp-search-ring-max
1170 "Saved value of `search-ring-max', so it can be restored.")
1171
1172 (defvar icicle-saved-proxy-candidates nil "Saved value of `icicle-proxy-candidates'.")
1173
1174 (defvar icicle-saved-region-background nil
1175 "Background of `region' face. Saved so it can be restored.")
1176
1177 (defvar icicle-saved-search-ring-max search-ring-max
1178 "Saved value of `search-ring-max', so it can be restored.")
1179
1180 (defvar icicle-scan-fn-or-regexp nil
1181 "`icicle-search' parameter SCAN-FN-OR-REGEXP. Used by `M-,'.")
1182
1183 (defvar icicle-scroll-Completions-reverse-p nil
1184 "Non-nil means `icicle-scroll-Completions-*' scrolls in opposite direction.")
1185
1186 (defvar icicle-search-command 'icicle-search
1187 "Command to use for Icicles searches.
1188 You can set a buffer-local value of this variable, to use a specific
1189 search command in a particular mode.")
1190
1191 (defvar icicle-search-complement-domain-p nil
1192 "Non-nil means complement the initial search candidates wrt the buffer.
1193 This has an effect only on (some) Icicles search commands.
1194 The scan function or regexp for the search command defines a set of
1195 matches in the buffer. If this option is non-nil then the actual
1196 candidates used are the sections of buffer text that are separated by
1197 the initial candidates, that is, the non-candidates as defined by the
1198 scan or regexp.")
1199
1200 (defvar icicle-search-context-level 0
1201 "Match level for `icicle-search' context regexp.
1202 0 means use whatever matches the whole context regexp as the search
1203 context. 1 means use whatever matches the first subgroup of the
1204 regexp as the search context, and so on.")
1205
1206 (defvar icicle-search-context-regexp ""
1207 "Current search-context regexp used in `icicle-search'.")
1208
1209 (defvar icicle-search-current-overlay nil
1210 "Overlay used to highlight current match of `icicle-search' regexp arg.")
1211
1212 (defvar icicle-search-final-choice nil
1213 "Final user input from `icicle-search'.
1214 This might or might not be one of the possible search candidates.")
1215
1216 (defvar icicle-search-history nil "History for `icicle-search' final choices.")
1217
1218 (defvar icicle-search-in-context-fn 'icicle-search-in-context-default-fn
1219 "Function used by `icicle-search-action' to act on search context.
1220 The default value is `icicle-search-in-context-default-fn'.
1221 The function must take two arguments:
1222 - A full search candidate object, which is a cons of the candidate
1223 name and its source-file marker.
1224 - A replacement string, or nil, if no replacement is to be made.
1225
1226 When the function is called, the region has been narrowed to the
1227 current search context.")
1228
1229 (defvar icicle-searching-p nil "Non-nil means an Icicles search command is in progress.")
1230
1231 (defvar icicle-search-level-overlays nil
1232 "Overlays used to highlight context levels other than the top level.")
1233
1234 (defvar icicle-search-map
1235 (let ((map (make-sparse-keymap)))
1236 (define-key map (icicle-kbd "b") 'icicle-search-buffer) ; `b'uffer
1237 (define-key map (icicle-kbd "c") 'icicle-search-char-property) ; `c'har property
1238 (define-key map (icicle-kbd "d") 'icicle-search-defs) ; `d'efinitions
1239 (define-key map (icicle-kbd "D") 'icicle-search-defs-full) ; `D'efinitions
1240 (define-key map (icicle-kbd ",") 'icicle-tags-search) ; Like `M-,' for `tags-loop-continue'
1241 (define-key map (icicle-kbd "f") 'icicle-search-file) ; `f'ile
1242 (define-key map (icicle-kbd "g") 'icicle-grep-saved-file-candidates) ; `g'rep
1243 (define-key map (icicle-kbd "i") 'icicle-imenu) ; `i'menu
1244 (define-key map (icicle-kbd "I") 'icicle-imenu-full) ; `I'menu
1245 (define-key map (icicle-kbd "j") 'icicle-search-bookmark) ; `j'ump to bookmark first
1246 (define-key map (icicle-kbd "J") 'icicle-search-bookmarks-together); `J'ump to bookmark 1st
1247 (define-key map (icicle-kbd "k") 'icicle-search-keywords) ; `k'eywords
1248 (define-key map (icicle-kbd "l") 'icicle-search-lines) ; `l'ines
1249 (define-key map (icicle-kbd "C-l") 'icicle-search-pages) ; `C-l' is the page separator
1250 ;; Save `m' for `marked'/`mode-specific'.
1251 (define-key map (icicle-kbd "o") 'icicle-occur) ; `o'ccur
1252 (define-key map (icicle-kbd "p") 'icicle-search-paragraphs) ; `p'aragraphs
1253 (define-key map (icicle-kbd "O") 'icicle-search-overlay-property) ; `O'verlay
1254 (define-key map (icicle-kbd "s") 'icicle-search-sentences) ; `s'entence
1255 (define-key map (icicle-kbd "M-s") 'icicle-search-generic)
1256 (define-key map (icicle-kbd "t") 'icicle-search-thing) ; `t'hing
1257 (define-key map (icicle-kbd "T") 'icicle-search-text-property) ; `T'ext
1258 (define-key map (icicle-kbd "w") 'icicle-search-word) ; `w'ord
1259 (define-key map (icicle-kbd "x") 'icicle-search-xml-element) ; `x'ml
1260 (define-key map (icicle-kbd "X") 'icicle-search-xml-element-text-node) ; `X'ml
1261 map)
1262 "Keymap for Icicles search commands.
1263 It is bound to the key prefix `icicle-search-key-prefix'.")
1264
1265 (defvar icicle-search-modes
1266 '((dired-mode (progn (unless (fboundp 'diredp-get-files)
1267 (icicle-user-error "You need library `Dired+' for this"))
1268 (diredp-get-files)))
1269 (ibuffer-mode (nreverse (ibuffer-get-marked-buffers)))
1270 (Buffer-menu-mode (Buffer-menu-marked-buffers))
1271 (bookmark-bmenu-mode (progn (unless (fboundp 'bmkp-bmenu-get-marked-files)
1272 (icicle-user-error "You need library `Bookmark+' for this"))
1273 (bmkp-bmenu-get-marked-files))))
1274 "Alist that maps `major-mode' values to sexps that return WHERE.
1275 Each entry is a two-element list (MODE SEXP).
1276 SEXP returns the WHERE argument for `icicle-search', for MODE.")
1277
1278 (defvar icicle-search-overlays nil
1279 "Overlays used to highlight match of `icicle-search' regexp argument.")
1280
1281 (defvar icicle-search-refined-overlays nil
1282 "Overlay(s) used to highlight match of current input for `icicle-search'.
1283 If `icicle-search-highlight-threshold' is less than one, then this is
1284 a single overlay (or nil). Otherwise, this is a list of overlays.")
1285
1286 (defvar icicle-search-replacement nil
1287 "Replacement string for use during `icicle-search'.")
1288
1289 (defvar icicle-search-replacement-history nil
1290 "History variable for reading replacement string for `icicle-search'.")
1291
1292 (defvar icicle-successive-grab-count 0
1293 "Number of text things to be grabbed by next `\\<minibuffer-local-map>\
1294 \\[icicle-insert-string-at-point]'.")
1295
1296 (defvar icicle-text-property-value-history nil
1297 "History variable for reading text properties.")
1298
1299 ;; (defvar icicle-text-properties-alist
1300 ;; '(;; Properties listed in Elisp manual node `Special Properties':
1301 ;; ("category") ("face") ("font-lock-face") ("mouse-face") ("fontified") ("display")
1302 ;; ("help-echo") ("keymap") ("local-map") ("syntax-table") ("read-only") ("invisible")
1303 ;; ("intangible") ("field") ("cursor") ("pointer") ("line-spacing") ("line-height")
1304 ;; ("modification-hooks") ("insert-in-front-hooks") ("insert-behind-hooks")
1305 ;; ("point-entered") ("point-left")
1306 ;; ;; Properties listed in Elisp manual node `Format Properties':
1307 ;; ("hard") ("right-margin") ("left-margin") ("justification")
1308 ;; ;; Properties listed in Elisp manual node `Links and Mouse-1':
1309 ;; ("follow-link")
1310 ;; ;; Others in Emacs-Lisp libraries in directory `lisp':
1311 ;; ("allout-was-hidden") ("ansi-color") ("buffer") ("buffer-name") ("column")
1312 ;; ("button") ("skip") ("literal") ("front-sticky") ("rear-nonsticky") ("composition")
1313 ;; ("untranslated-utf-8") ("yank-handler") ("dired-filename") ("read-face-name")
1314 ;; ("directory") ("message") ("debug") ("font-lock-multiline") ("unknown")
1315 ;; ("insert-in-front-hooks") ("kbd-help") ("hilit-chg") ("ibuffer-filter-group-name")
1316 ;; ("ibuffer-properties") ("ibuffer-title") ("ibuffer-summary")
1317 ;; ("ibuffer-title-header") ("inhibit-line-move-field-capture") ("image-counter")
1318 ;; ("header-line") ("cvs-goal-column") ("occur-target") ("occur-match")
1319 ;; ("foreign-selection") ("before-string") ("after-string") ("ses")
1320 ;; ("smerge-force-highlighting") ("speedbar-function") ("speedbar-token")
1321 ;; ("speedbar-text") ("type") ("stroke-glyph") ("data") ("thumb-image-file")
1322 ;; ("original-file-name") ("associated-dired-buffer") ("tags") ("comment")
1323 ;; ("tumme-thumbnail") ("tutorial-remark") ("vc-cvs-annotate-time") ("end-name")
1324 ;; ("old-name") ("end-link") ("old-link") ("end-perm") ("old-perm") ("perm-changed")
1325 ;; ("widget-doc") ("secret") ("real-field")
1326 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/emacs-lisp':
1327 ;; ("elp-symname") ("printed-value") ("duplicable")
1328 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/emulation':
1329 ;; ("cursor")
1330 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/erc':
1331 ;; ("erc-callback") ("erc-data") ("erc-identified") ("erc-parsed") ("erc-parsed")
1332 ;; ("timestamp") ("erc-prompt")
1333 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/eshell':
1334 ;; ("comment") ("arg-begin") ("arg-end") ("escaped") ("history") ("number")
1335 ;; ("test-func")
1336 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/gnus':
1337 ;; ("earcon-data") ("earcon-callback") ("gnus-category") ("gnus-part")
1338 ;; ("article-type") ("gnus-decoration") ("dummy-invisible") ("original-date")
1339 ;; ("gnus-data") ("gnus-callback") ("gnus-prev") ("gnus-next") ("gnus-mime-details")
1340 ;; ("gnus-line-format") ("gnus-backlog") ("gnus-image-category")
1341 ;; ("gnus-image-text-deletable") ("gnus-group") ("gnus-level") ("gnus-indentation")
1342 ;; ("gnus-unread") ("gnus-number") ("articles") ("gnus-server") ("gnus-named-server")
1343 ;; ("gnus-intangible") ("gnus-topic") ("gnus-topic-level") ("gnus-topic-unread")
1344 ;; ("gnus-topic-visible") ("gnus-active") ("gnus-position") ("gnus-time")
1345 ;; ("gnus-face") ("gnus-undeletable") ("message-rank") ("egg-end") ("egg-lang")
1346 ;; ("egg-start") ("message-hidden") ("message-deletable") ("buffer") ("from") ("mm")
1347 ;; ("script-name")
1348 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/international':
1349 ;; ("kkc-conversion-index") ("advice") ("untranslated-utf-8") ("composition")
1350 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/mail':
1351 ;; ("footnote-number") ("rmail-fontified")
1352 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/mh-e':
1353 ;; ("mh-data") ("mh-mime-inserted") ("mh-part") ("mh-region") ("mh-callback")
1354 ;; ("mh-button-pressed") ("mh-line-format") ("mh-folder") ("mh-children-p")
1355 ;; ("mh-expanded") ("mh-level") ("mh-count")
1356 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/net':
1357 ;; ("feed") ("w3m-image") ("nt-age") ("nt-title") ("nt-guid") ("nt-desc")
1358 ;; ("org-invisible") ("nt-link") ("nt-type") ("nt-face")
1359 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/progmodes':
1360 ;; ("c-type") ("c-awk-NL-prop") ("c-is-sws") ("c-decl-arg-start") ("c-decl-end")
1361 ;; ("c-decl-id-start") ("c-decl-type-start") ("message") ("REx-interpolated")
1362 ;; ("in-pod") ("here-doc-group") ("syntax-type") ("indentable") ("REx-part2")
1363 ;; ("first-format-line") ("attrib-group") ("cperl-postpone") ("cpp-data")
1364 ;; ("cpp-callback") ("token") ("ebrowse-tree") ("ebrowse-member") ("ebrowse-what")
1365 ;; ("gdb-enabled") ("gdb-bptno") ("gdb-max-frames") ("link") ("fetch") ("begin-glyph")
1366 ;; ("begin-glyph-layout") ("idlwave-class") ("data") ("source") ("keyword")
1367 ;; ("find-args")
1368 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/term':
1369 ;; ("mac-ts-active-input-string")
1370 ;; ;; Others in Emacs-Lisp libraries in directory `lisp/textmodes':
1371 ;; ("fill-space") ("priority") ("test") ("end-glyph") ("begin-glyph") ("org-cwidth")
1372 ;; ("org-dwidth") ("org-dwidth-n") ("org-linked-text") (":org-clock-minutes")
1373 ;; ("org-protected") ("org-date-line") ("org-today") ("day") ("org-agenda-type")
1374 ;; ("time-of-day") ("org-not-done-regexp") ("prefix-length") ("tags") ("org-marker")
1375 ;; ("org-agenda-diary-link") ("org-hd-marker") ("dotime") ("org-category")
1376 ;; ("undone-face") ("done-face") ("xr-alist") ("table-cell") ("text-clones")
1377 ;; ;; Others in my own libraries:
1378 ;; ("font-lock-ignore") ("highlight") ("back-link") ("forward-link"))
1379 ;; "Alist of text properties known to Emacs.
1380 ;; Each element is of form (PROP), where PROP is the name of a text
1381 ;; property (a string).")
1382
1383 (defvar icicle-thing-at-pt-fns-pointer 0
1384 "Current index into the car of `icicle-thing-at-point-functions'.
1385 This points to the current function in the list.")
1386
1387 (defvar icicle-toggle-transforming-message "Completion-candidate transformation is now %s"
1388 "Message used by `icicle-toggle-transforming'.
1389 A format string that includes one `%s', to be replaced by `ON'/`OFF'.")
1390
1391 (defvar icicle-transform-before-sort-p nil
1392 "Non-nil means transform each multi-completion candidate before sorting.
1393 Bind this to non-nil if you do not want sorting to use the whole
1394 multi-completion.")
1395
1396 (defvar icicle-transform-function nil ; Toggle with `C-$,'.
1397 "Function used to transform the list of completion candidates.
1398 This is applied to the list of initial candidates.
1399 If this is nil, then no transformation takes place.
1400
1401 You can toggle this at any time from the minibuffer using `C-$,'.
1402
1403 The value is changed by program locally, for use in particular
1404 contexts. E.g., when you use `C-c C-`' (`icicle-search-generic') in a
1405 `*shell*' buffer, Icicles uses this variable with a value of
1406 `icicle-remove-duplicates', to remove duplicate shell commands from
1407 your input history list.
1408
1409 You can use this variable in your Lisp code to transform the list of
1410 candidates any way you like. A typical use is to remove duplicates,
1411 by binding it to `icicle-remove-duplicates' or
1412 `icicle-remove-dups-if-extras'.")
1413
1414 (defvar icicle-last-transform-function (or icicle-transform-function
1415 'icicle-remove-duplicates)
1416 "Local copy of `icicle-transform-function', so we can restore it.")
1417
1418 (defvar icicle-universal-argument-map
1419 (let ((map (make-sparse-keymap))
1420 (universal-argument-minus
1421 (and (fboundp 'universal-argument--mode) ; Emacs 24.4+
1422 `(menu-item "" icicle-negative-argument
1423 :filter ,(lambda (cmd) (if (integerp prefix-arg) nil cmd))))))
1424 (cond ((fboundp 'universal-argument-other-key) ; Emacs < 24.4
1425 (define-key map [t] 'icicle-universal-argument-other-key)
1426 (define-key map (vector meta-prefix-char t) 'icicle-universal-argument-other-key)
1427 (define-key map [switch-frame] nil))
1428 (t ; Emacs 24.4+
1429 (define-key map [switch-frame] (lambda (evt)
1430 (interactive "e")
1431 (handle-switch-frame evt)
1432 (universal-argument--mode)))))
1433 (define-key map (icicle-kbd "C-u") 'icicle-universal-argument-more)
1434 (define-key map (icicle-kbd "-") (if (fboundp 'universal-argument--mode)
1435 universal-argument-minus ; Emacs 24.4+
1436 'icicle-universal-argument-minus))
1437 (define-key map (icicle-kbd "0") 'icicle-digit-argument)
1438 (define-key map (icicle-kbd "1") 'icicle-digit-argument)
1439 (define-key map (icicle-kbd "2") 'icicle-digit-argument)
1440 (define-key map (icicle-kbd "3") 'icicle-digit-argument)
1441 (define-key map (icicle-kbd "4") 'icicle-digit-argument)
1442 (define-key map (icicle-kbd "5") 'icicle-digit-argument)
1443 (define-key map (icicle-kbd "6") 'icicle-digit-argument)
1444 (define-key map (icicle-kbd "7") 'icicle-digit-argument)
1445 (define-key map (icicle-kbd "8") 'icicle-digit-argument)
1446 (define-key map (icicle-kbd "9") 'icicle-digit-argument)
1447 (define-key map (icicle-kbd "kp-0") 'icicle-digit-argument)
1448 (define-key map (icicle-kbd "kp-1") 'icicle-digit-argument)
1449 (define-key map (icicle-kbd "kp-2") 'icicle-digit-argument)
1450 (define-key map (icicle-kbd "kp-3") 'icicle-digit-argument)
1451 (define-key map (icicle-kbd "kp-4") 'icicle-digit-argument)
1452 (define-key map (icicle-kbd "kp-5") 'icicle-digit-argument)
1453 (define-key map (icicle-kbd "kp-6") 'icicle-digit-argument)
1454 (define-key map (icicle-kbd "kp-7") 'icicle-digit-argument)
1455 (define-key map (icicle-kbd "kp-8") 'icicle-digit-argument)
1456 (define-key map (icicle-kbd "kp-9") 'icicle-digit-argument)
1457 (define-key map (icicle-kbd "kp-subtract") (if (fboundp 'universal-argument--mode)
1458 universal-argument-minus ; Emacs 24.4+
1459 'icicle-universal-argument-minus))
1460 map)
1461 "Keymap used while processing `C-u' during Icicles completion.")
1462
1463 (defvar icicle-use-candidates-only-once-alt-p nil
1464 "*Non-nil means remove each candidate from the set after using it.
1465 This is similar to `icicle-use-candidates-only-once-flag', but it is
1466 used only for alternative actions (e.g. `C-S-RET').")
1467
1468 (defvar icicle-vardoc-last-initial-cand-set ()
1469 "Cache for initial set of completion candidates for `icicle-vardoc'.")
1470
1471 (defvar icicle-whole-candidate-as-text-prop-p nil
1472 "Non-nil means string candidate has candidate data as text property.
1473 If non-nil, then the value of text property `icicle-whole-candidate'
1474 for a string completion candidate (e.g. what is displayed) is the cdr
1475 of the full completion-candidate alist element. The car of that
1476 element is the string.")
1477
1478 (defvar icicle-variable-name-history nil "History for variable names.")
1479
1480 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1481
1482 (provide 'icicles-var)
1483
1484 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1485 ;;; icicles-var.el ends here