Function: add-completion
add-completion is an interactive and byte-compiled function defined in
completion.el.gz.
Signature
(add-completion STRING &optional NUM-USES LAST-USE-TIME)
Documentation
Add STRING to completion list, or move it to head of list.
The completion is altered appropriately if NUM-USES and/or LAST-USE-TIME are specified.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/completion.el.gz
(defun add-completion (string &optional num-uses last-use-time)
"Add STRING to completion list, or move it to head of list.
The completion is altered appropriately if NUM-USES and/or LAST-USE-TIME
are specified."
(interactive (interactive-completion-string-reader "Completion to add"))
(check-completion-length string)
(let* ((current-completion-source (if (called-interactively-p 'interactive)
cmpl-source-interactive
current-completion-source))
(entry (add-completion-to-head string)))
(if num-uses (set-completion-num-uses entry num-uses))
(if last-use-time
(set-completion-last-use-time entry last-use-time))))