1
Fork 0
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:
Mattias Engdegård 2021-07-27 20:29:40 +02:00
parent 35610b870e
commit b4173443fb

View file

@ -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