Function: add-completions-from-file
add-completions-from-file is an interactive and byte-compiled function
defined in completion.el.gz.
Signature
(add-completions-from-file FILE)
Documentation
Parse possible completions from a FILE and add them to database.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/completion.el.gz
;;---------------------------------------------------------------------------
;; Parsing definitions from files into the database
;;---------------------------------------------------------------------------
;;-----------------------------------------------
;; Top Level functions ::
;;-----------------------------------------------
;; User interface
(defun add-completions-from-file (file)
"Parse possible completions from a FILE and add them to database."
(interactive "fFile: ")
(setq file (expand-file-name file))
(let* ((buffer (get-file-buffer file))
(buffer-already-there-p buffer))
(if (not buffer-already-there-p)
(let ((completions-merging-modes nil))
(setq buffer (find-file-noselect file))))
(unwind-protect
(with-current-buffer buffer
(add-completions-from-buffer))
(if (not buffer-already-there-p)
(kill-buffer buffer)))))