Commit 65b2faf6 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Rename function in completion.el to use completion- prefixes

* lisp/completion.el (locate-completion-entry)
(completion-locate-entry, locate-completion-entry-retry)
(completion-locate-entry-retry, locate-completion-db-error):
Rename to use a completion- prefix and make the old names obsolete
aliases.
(add-completion-to-head, delete-completion): Use the new function
names.
parent a2dc7498
Pipeline #2163 failed with stage
in 90 minutes and 2 seconds
...@@ -1062,7 +1062,9 @@ and downcased. Sets up `cmpl-db-prefix-symbol'." ...@@ -1062,7 +1062,9 @@ and downcased. Sets up `cmpl-db-prefix-symbol'."
(defvar inside-locate-completion-entry nil) (defvar inside-locate-completion-entry nil)
;; used to trap lossage in silent error correction ;; used to trap lossage in silent error correction
(defun locate-completion-entry (completion-entry prefix-entry) (define-obsolete-function-alias 'locate-completion-entry
#'completion-locate-entry "27.1")
(defun completion-locate-entry (completion-entry prefix-entry)
"Locate the completion entry. "Locate the completion entry.
Returns a pointer to the element before the completion entry or nil if Returns a pointer to the element before the completion entry or nil if
the completion entry is at the head. the completion entry is at the head.
...@@ -1085,14 +1087,16 @@ Must be called after `find-exact-completion'." ...@@ -1085,14 +1087,16 @@ Must be called after `find-exact-completion'."
cmpl--completion-string)) cmpl--completion-string))
(inside-locate-completion-entry (inside-locate-completion-entry
;; recursive error: really scrod ;; recursive error: really scrod
(locate-completion-db-error)) (completion-locate-db-error))
(t (t
;; Patch out ;; Patch out
(set cmpl-db-symbol nil) (set cmpl-db-symbol nil)
;; Retry ;; Retry
(locate-completion-entry-retry completion-entry))))))) (completion-locate-entry-retry completion-entry)))))))
(defun locate-completion-entry-retry (old-entry) (define-obsolete-function-alias 'locate-completion-entry-retry
#'completion-locate-entry-retry "27.1")
(defun completion-locate-entry-retry (old-entry)
(let ((inside-locate-completion-entry t)) (let ((inside-locate-completion-entry t))
(add-completion (completion-string old-entry) (add-completion (completion-string old-entry)
(completion-num-uses old-entry) (completion-num-uses old-entry)
...@@ -1105,11 +1109,13 @@ Must be called after `find-exact-completion'." ...@@ -1105,11 +1109,13 @@ Must be called after `find-exact-completion'."
0 completion-prefix-min-length))))) 0 completion-prefix-min-length)))))
(if (and cmpl-entry pref-entry) (if (and cmpl-entry pref-entry)
;; try again ;; try again
(locate-completion-entry cmpl-entry pref-entry) (completion-locate-entry cmpl-entry pref-entry)
;; still losing ;; still losing
(locate-completion-db-error))))) (completion-locate-db-error)))))
(defun locate-completion-db-error () (define-obsolete-function-alias 'locate-completion-db-error
#'completion-locate-db-error "27.1")
(defun completion-locate-db-error ()
;; recursive error: really scrod ;; recursive error: really scrod
(error "Completion database corrupted. Try M-x clear-all-completions. Send bug report")) (error "Completion database corrupted. Try M-x clear-all-completions. Send bug report"))
...@@ -1158,7 +1164,7 @@ Returns the completion entry." ...@@ -1158,7 +1164,7 @@ Returns the completion entry."
(let* ((prefix-entry (find-cmpl-prefix-entry (let* ((prefix-entry (find-cmpl-prefix-entry
(substring cmpl-db-downcase-string 0 (substring cmpl-db-downcase-string 0
completion-prefix-min-length))) completion-prefix-min-length)))
(splice-ptr (locate-completion-entry cmpl-db-entry prefix-entry)) (splice-ptr (completion-locate-entry cmpl-db-entry prefix-entry))
(cmpl-ptr (cdr splice-ptr))) (cmpl-ptr (cdr splice-ptr)))
;; update entry ;; update entry
(set-completion-string cmpl-db-entry completion-string) (set-completion-string cmpl-db-entry completion-string)
...@@ -1202,7 +1208,8 @@ String must be longer than `completion-prefix-min-length'." ...@@ -1202,7 +1208,8 @@ String must be longer than `completion-prefix-min-length'."
(let* ((prefix-entry (find-cmpl-prefix-entry (let* ((prefix-entry (find-cmpl-prefix-entry
(substring cmpl-db-downcase-string 0 (substring cmpl-db-downcase-string 0
completion-prefix-min-length))) completion-prefix-min-length)))
(splice-ptr (locate-completion-entry cmpl-db-entry prefix-entry))) (splice-ptr (completion-locate-entry
cmpl-db-entry prefix-entry)))
;; delete symbol reference ;; delete symbol reference
(set cmpl-db-symbol nil) (set cmpl-db-symbol nil)
;; remove from prefix list ;; remove from prefix list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment