Mercurial > emacs
comparison lisp/completion.el @ 68379:311328d6ca44
Minor fixes in introductory comment.
(completion-def-wrapper): Fix alist.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Wed, 25 Jan 2006 04:11:05 +0000 |
parents | 554ddf754b2b |
children | 3bd95f4f2941 5b7d410e31f9 |
comparison
equal
deleted
inserted
replaced
68378:ebc946c50b50 | 68379:311328d6ca44 |
---|---|
80 ;; database by changing the value of enable-completion. | 80 ;; database by changing the value of enable-completion. |
81 ;; | 81 ;; |
82 ;; SAVING/LOADING COMPLETIONS | 82 ;; SAVING/LOADING COMPLETIONS |
83 ;; Completions are automatically saved from one session to another | 83 ;; Completions are automatically saved from one session to another |
84 ;; (unless save-completions-flag or enable-completion is nil). | 84 ;; (unless save-completions-flag or enable-completion is nil). |
85 ;; Activating this minor-mode calling completion-initialize) causes Emacs | 85 ;; Activating this minor-mode (calling completion-initialize) loads |
86 ;; to load a completions database for a saved completions file | 86 ;; a completions database for a saved completions file |
87 ;; (default: ~/.completions). When you exit, Emacs saves a copy of the | 87 ;; (default: ~/.completions). When you exit, Emacs saves a copy of the |
88 ;; completions that you | 88 ;; completions that you often use. When you next start, Emacs loads in |
89 ;; often use. When you next start, Emacs loads in the saved completion file. | 89 ;; the saved completion file. |
90 ;; | 90 ;; |
91 ;; The number of completions saved depends loosely on | 91 ;; The number of completions saved depends loosely on |
92 ;; *saved-completions-decay-factor*. Completions that have never been | 92 ;; *saved-completions-decay-factor*. Completions that have never been |
93 ;; inserted via "complete" are not saved. You are encouraged to experiment | 93 ;; inserted via "complete" are not saved. You are encouraged to experiment |
94 ;; with different functions (see compute-completion-min-num-uses). | 94 ;; with different functions (see compute-completion-min-num-uses). |
2248 (defun completion-def-wrapper (function-name type) | 2248 (defun completion-def-wrapper (function-name type) |
2249 "Add a call to update the completion database before function execution. | 2249 "Add a call to update the completion database before function execution. |
2250 TYPE is the type of the wrapper to be added. Can be :before or :under." | 2250 TYPE is the type of the wrapper to be added. Can be :before or :under." |
2251 (put function-name 'completion-function | 2251 (put function-name 'completion-function |
2252 (cdr (assq type | 2252 (cdr (assq type |
2253 '((:separator 'use-completion-before-separator) | 2253 '((:separator . use-completion-before-separator) |
2254 (:before 'use-completion-before-point) | 2254 (:before . use-completion-before-point) |
2255 (:backward-under 'use-completion-backward-under) | 2255 (:backward-under . use-completion-backward-under) |
2256 (:backward 'use-completion-backward) | 2256 (:backward . use-completion-backward) |
2257 (:under 'use-completion-under-point) | 2257 (:under . use-completion-under-point) |
2258 (:under-or-before 'use-completion-under-or-before-point) | 2258 (:under-or-before . use-completion-under-or-before-point) |
2259 (:minibuffer-separator 'use-completion-minibuffer-separator)))))) | 2259 (:minibuffer-separator |
2260 . use-completion-minibuffer-separator)))))) | |
2260 | 2261 |
2261 (defun use-completion-minibuffer-separator () | 2262 (defun use-completion-minibuffer-separator () |
2262 (let ((completion-syntax-table completion-standard-syntax-table)) | 2263 (let ((completion-syntax-table completion-standard-syntax-table)) |
2263 (use-completion-before-separator))) | 2264 (use-completion-before-separator))) |
2264 | 2265 |
2352 (c-mode-hook . completion-c-mode-hook) | 2353 (c-mode-hook . completion-c-mode-hook) |
2353 (fortran-mode-hook . completion-setup-fortran-mode))) | 2354 (fortran-mode-hook . completion-setup-fortran-mode))) |
2354 (if dynamic-completion-mode | 2355 (if dynamic-completion-mode |
2355 (add-hook (car x) (cdr x)) | 2356 (add-hook (car x) (cdr x)) |
2356 (remove-hook (car x) (cdr x)))) | 2357 (remove-hook (car x) (cdr x)))) |
2357 | 2358 |
2358 ;; "Complete" Key Keybindings. We don't want to use a minor-mode | 2359 ;; "Complete" Key Keybindings. We don't want to use a minor-mode |
2359 ;; map because these have too high a priority. We could/should | 2360 ;; map because these have too high a priority. We could/should |
2360 ;; probably change the interpretation of minor-mode-map-alist such | 2361 ;; probably change the interpretation of minor-mode-map-alist such |
2361 ;; that a map has lower precedence if the symbol is not buffer-local. | 2362 ;; that a map has lower precedence if the symbol is not buffer-local. |
2362 (while completion-saved-bindings | 2363 (while completion-saved-bindings |