diff options
Diffstat (limited to 'lisp/completion.el')
-rw-r--r-- | lisp/completion.el | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/lisp/completion.el b/lisp/completion.el index 7248d0d89fe..b9c3a21f5ea 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -409,10 +409,7 @@ Used to decide whether to save completions.") (defun cmpl-coerce-string-case (string case-type) (cond ((eq case-type :down) (downcase string)) ((eq case-type :up) (upcase string)) - ((eq case-type :capitalized) - (setq string (downcase string)) - (aset string 0 (logand ?\337 (aref string 0))) - string) + ((eq case-type :capitalized) (capitalize string)) (t string))) (defun cmpl-merge-string-cases (string-to-coerce given-string) @@ -435,7 +432,7 @@ Used to decide whether to save completions.") (defun cmpl-hours-since-origin () - (floor (float-time) 3600)) + (floor (encode-time nil 'integer) 3600)) ;;--------------------------------------------------------------------------- ;; "Symbol" parsing functions @@ -518,6 +515,9 @@ Used to decide whether to save completions.") (modify-syntax-entry char "w" table))) table)) +;; Old name, non-namespace-clean. +(defvaralias 'cmpl-syntax-table 'completion-syntax-table) + (defvar completion-syntax-table completion-standard-syntax-table "This variable holds the current completion syntax table.") (make-variable-buffer-local 'completion-syntax-table) @@ -1062,7 +1062,9 @@ and downcased. Sets up `cmpl-db-prefix-symbol'." (defvar inside-locate-completion-entry nil) ;; 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. Returns a pointer to the element before the completion entry or nil if the completion entry is at the head. @@ -1085,14 +1087,16 @@ Must be called after `find-exact-completion'." cmpl--completion-string)) (inside-locate-completion-entry ;; recursive error: really scrod - (locate-completion-db-error)) + (completion-locate-db-error)) (t ;; Patch out (set cmpl-db-symbol nil) ;; 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)) (add-completion (completion-string old-entry) (completion-num-uses old-entry) @@ -1105,11 +1109,13 @@ Must be called after `find-exact-completion'." 0 completion-prefix-min-length))))) (if (and cmpl-entry pref-entry) ;; try again - (locate-completion-entry cmpl-entry pref-entry) + (completion-locate-entry cmpl-entry pref-entry) ;; 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 (error "Completion database corrupted. Try M-x clear-all-completions. Send bug report")) @@ -1158,7 +1164,7 @@ Returns the completion entry." (let* ((prefix-entry (find-cmpl-prefix-entry (substring cmpl-db-downcase-string 0 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))) ;; update entry (set-completion-string cmpl-db-entry completion-string) @@ -1202,7 +1208,8 @@ String must be longer than `completion-prefix-min-length'." (let* ((prefix-entry (find-cmpl-prefix-entry (substring cmpl-db-downcase-string 0 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 (set cmpl-db-symbol nil) ;; remove from prefix list @@ -2225,7 +2232,10 @@ TYPE is the type of the wrapper to be added. Can be :before or :under." (modify-syntax-entry char "_" table)) table)) +(declare-function cl-set-difference "cl-seq" (cl-list1 cl-list2 &rest cl-keys)) + (defun completion-lisp-mode-hook () + (require 'cl-lib) (setq completion-syntax-table completion-lisp-syntax-table) ;; Lisp Mode diffs (setq-local completion-separator-chars @@ -2269,10 +2279,7 @@ TYPE is the type of the wrapper to be added. Can be :before or :under." ;;;###autoload (define-minor-mode dynamic-completion-mode - "Toggle dynamic word-completion on or off. -With a prefix argument ARG, enable the mode if ARG is positive, -and disable it otherwise. If called from Lisp, enable the mode -if ARG is omitted or nil." + "Toggle dynamic word-completion on or off." :global t :group 'completion ;; This is always good, not specific to dynamic-completion-mode. @@ -2357,8 +2364,7 @@ if ARG is omitted or nil." (completion-def-wrapper 'delete-backward-char :backward) (completion-def-wrapper 'delete-backward-char-untabify :backward) -;; Old names, non-namespace-clean. -(defvaralias 'cmpl-syntax-table 'completion-syntax-table) +;; Old name, non-namespace-clean. (defalias 'initialize-completions 'completion-initialize) (provide 'completion) |