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)
|
(clear-visited-file-modtime)
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
|
|
||||||
(let ((insert-okay-p nil)
|
(let ((buffer (current-buffer))
|
||||||
(buffer (current-buffer))
|
|
||||||
string entry last-use-time
|
string entry last-use-time
|
||||||
cmpl-entry cmpl-last-use-time
|
cmpl-entry cmpl-last-use-time
|
||||||
(current-completion-source cmpl-source-init-file)
|
(current-completion-source cmpl-source-init-file)
|
||||||
(total-in-file 0) (total-perm 0))
|
(total-in-file 0) (total-perm 0))
|
||||||
;; insert the file into a buffer
|
;; insert the file into a buffer
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(progn (insert-file-contents filename t)
|
(insert-file-contents filename t)
|
||||||
(setq insert-okay-p t))
|
|
||||||
|
|
||||||
(file-error
|
(file-error
|
||||||
(message "File error trying to load completion file %s."
|
(message "File error trying to load completion file %s."
|
||||||
filename)))
|
filename))
|
||||||
|
(:success
|
||||||
;; parse it
|
;; parse it
|
||||||
(if insert-okay-p
|
|
||||||
(progn
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue