Skip to content

Commit

Permalink
Autoload hotfuzz--adjust-metadata
Browse files Browse the repository at this point in the history
An all-completions operation will call the autoloaded function
hotfuzz-all-completions, and as such hotfuzz--adjust-metadata gets
defined before it is subsequently called. However, for try-completion
operations hotfuzz piggybacks on the built-in function
completion-flex-try-completion, and so will not be automatically
loaded. This commit fixes this by also autoloading
hotfuzz--adjust-metadata.

An alternative would have been defining an autoloaded alias for
completion-flex-try-completion, which, though exposing a redundant
symbol, would avoid autoloading a "private" function.
  • Loading branch information
axelf4 committed Jan 14, 2024
1 parent f91c097 commit 0d89041
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hotfuzz.el
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ list before passing it to `display-sort-function' or
(setcar all (propertize (car all) 'completion-sorted t)))
(if (string= prefix "") all (nconc all (length prefix))))))

;;;###autoload
(defun hotfuzz--adjust-metadata (metadata)
"Adjust completion METADATA for hotfuzz sorting."
(let ((existing-dsf (completion-metadata-get metadata 'display-sort-function))
Expand Down

0 comments on commit 0d89041

Please sign in to comment.