SiteMap Search ElispArea HowTo Glossary RecentChanges News Problems Suggestions
Jordan, Independence Day, Argentina, National Day

Icicles - Specifying Match Functions for Commands

Last edit

Changed:

< By default, '''Icicles''' lets users use [[prefix completion]] (with `TAB') or [[apropos completion]] (with `S-TAB'). They can alternatively use [[fuzzy completion]] with `TAB' or [[scatter-match completion]] with `S-TAB':
< * They can use '''`##C-(##'''' during completion to toggle between prefix completion and fuzzy completion.
< * They can use '''`##M-(##'''' to cycle among apropos completion and scatter-match completion. (Actually, they can [[Icicles - Customization and General Tips#icicle-apropos-match-fns-alist|customize]] the match types among which `##M-(##' cycles.)

to

> By default, '''Icicles''' lets users use basic [[prefix completion]] (with `TAB') or [[apropos completion]] (with `S-TAB'). They can alternatively use other completion methods with `TAB' and `S-TAB':
> * They can use '''`##C-(##'''' during completion to cycle among `TAB'
> completion methods.
> * They can use '''`##M-(##'''' to cycle among `S-TAB' completion methods.
> * They can customize [[option]]s '''`<tt>[[Icicles - Customization and General Tips#icicle-TAB-completion-methods|icicle-TAB-completion-methods]]</tt>'''' and '''`<tt>[[Icicles - Customization and General Tips#icicle-S-TAB-completion-methods-alist|icicle-S-TAB-completion-methods-alist]]</tt>'''', to define the completion methods among which they can cycle.

Changed:

< You can bind `icicle-apropos-complete-match-fn' to any function that matches strings. You will probably also want to ensure that it is available for `##M-(##' cycling, by adding it to `icicle-apropos-match-fns-alist' in a `let' binding. For example, to use matching function `my-match' in `my-cmd', you might do this:

to

> You can bind `icicle-apropos-complete-match-fn' to any function that matches strings. You will probably also want to ensure that it is available for `##M-(##' cycling, by adding it to `icicle-S-TAB-completion-methods-alist' in a `let' binding. For example, to use matching function `my-match' in `my-cmd', you might do this:

Changed:

< (icicle-apropos-match-fns-alist (cons (cons "mine" 'my-match)
< icicle-apropos-match-fns-alist)))

to

> (icicle-S-TAB-completion-methods-alist
> (cons (cons "mine" 'my-match)
> icicle-S-TAB-completion-methods-alist)))


iciclesimage
Previous: Icicles - Global FiltersIciclesIciclesIndexNext: Icicles - Defining Completion for Comint Modes

Defining Commands that Use Specific Match Functions

This section is for EmacsLisp programmers.

By default, Icicles lets users use basic prefix completion (with ‘TAB’) or apropos completion (with ‘S-TAB’). They can alternatively use other completion methods with ‘TAB’ and ‘S-TAB’:

When you define an Icicles command, you can specify which string-matching functions the command uses during completion:

You can bind ‘icicle-apropos-complete-match-fn’ to any function that matches strings. You will probably also want to ensure that it is available for `M-(’ cycling, by adding it to ‘icicle-S-TAB-completion-methods-alist’ in a ‘let’ binding. For example, to use matching function ‘my-match’ in ‘my-cmd’, you might do this:

  (defun my-cmd ()
    "..."
    (interactive)
    (let ((icicle-apropos-complete-match-fn  'my-match)
          (icicle-S-TAB-completion-methods-alist
           (cons (cons "mine" 'my-match)
                 icicle-S-TAB-completion-methods-alist)))
      (do-something (completing-read "Choose: " ...) ...)))

Previous: Icicles - Global FiltersIciclesIciclesIndexNext: Icicles - Defining Completion for Comint Modes

DrewsElispLibraries referenced here: Lisp:icicles.el

CategoryCommands CategoryBufferSwitching CategoryCompletion CategoryRegexp CategoryProgrammerUtils CategoryCode