mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
; * lisp/completion.el (load-completions-from-file): Simplify
Use a condition-case :success clause instead flags for control.
This commit is contained in:
parent
35610b870e
commit
b4173443fb
1 changed files with 49 additions and 53 deletions
|
|
@ -1917,23 +1917,19 @@ If file is not specified, then use `save-completions-file-name'."
|
|||
(clear-visited-file-modtime)
|
||||
(erase-buffer)
|
||||
|
||||
(let ((insert-okay-p nil)
|
||||
(buffer (current-buffer))
|
||||
(let ((buffer (current-buffer))
|
||||
string entry last-use-time
|
||||
cmpl-entry cmpl-last-use-time
|
||||
(current-completion-source cmpl-source-init-file)
|
||||
(total-in-file 0) (total-perm 0))
|
||||
;; insert the file into a buffer
|
||||
(condition-case nil
|
||||
(progn (insert-file-contents filename t)
|
||||
(setq insert-okay-p t))
|
||||
|
||||
(insert-file-contents filename t)
|
||||
(file-error
|
||||
(message "File error trying to load completion file %s."
|
||||
filename)))
|
||||
filename))
|
||||
(:success
|
||||
;; parse it
|
||||
(if insert-okay-p
|
||||
(progn
|
||||
(goto-char (point-min))
|
||||
|
||||
(condition-case nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue