;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; with all optimizations.



(byte-code "\300\301!\210\302\303\304\"\207" [require cl-lib add-to-list completion-styles-alist (external external-completion--try-completion external-completion--all-completions "Ad-hoc completion style provided by the completion table.")] 3)#@2669 Make completion table using the `external' completion style.

The `external' style is particularly useful when the caller
interfaces with an external tool that provides completions.  This
may be a shell utility, an inferior process, an http server, etc.
Given a pattern string, the external tool matches it to an
arbitrarily large set of candidates.  Since the full set doesn't
need to be transferred to Emacs's address space, this often
results in much faster overall experience, at the expense of the
convenience of offered by other completion styles.

CATEGORY is a symbol uniquely naming the external tool.  This
function links CATEGORY to the style `external', by modifying
`completion-category-defaults', overriding any styles normally
set in `completion-styles'.

LOOKUP is a function taking a string PATTERN and a number
POINT. The function should contact the tool and return a list of
strings representing the completions for PATTERN given that POINT
is the location of point within it.  LOOKUP decides if PATTERN is
interpreted as a substring, a regular expression, or any other
type of matching method.  The strings returned may be propertized
with `completions-common-part' to illustrate the specific method
used.  LOOKUP may ignore POINT if it doesn't meaningfully alter
the results.

LOOKUP is a synchronous blocking function.  Since it contacts an
external tool, it's possible that it takes significant time to
return results.  To maintain Emacs's responsiveness, LOOKUP
should detect pending user input using `while-no-input' or
`sit-for' (which see).  In those cases, LOOKUP should attempt to
cancel the request (if possible) and immediately return any
non-list.

METADATA is an alist of additional properties such as
`cycle-sort-function' to associate with CATEGORY.  This means
that the caller may still retain control the sorting of the
candidates while the tool controls the matching.

Optional TRY-COMPLETION-FUNCTION helps some frontends partially
or fully expand PATTERN before finishing the completion
operation.  If supplied, it is a function taking a (PATTERN POINT
ALL-COMPLETIONS), where PATTERN and POINT are as described above
and ALL-COMPLETIONS are gathered by LOOKUP for these
arguments (this function ensures LOOKUP isn't called more than
needed).  If you know the matching method that the external tool
using, TRY-COMPLETION-FUNCTION may return a cons
cell (EXPANDED-PATTERN . NEW-POINT).  For example, if the tool is
completing by prefix, one could call `try-completion' to find the
largest common prefix in ALL-COMPLETIONS and then return that as
EXPANDED-PATTERN.

(fn CATEGORY LOOKUP &optional METADATA TRY-COMPLETION-FUNCTION)
(defalias 'external-completion-table #[1026 "\301\"\211\203 \301\302\"\303\232\204$ \304\305\306\307C$\266\202% \310BB\210\311\312\313\"\314\315#\314\316\n%\207" [completion-category-defaults alist-get styles #1=(external) cl--assertion-failed (equal '#1# (alist-get 'styles probe)) "Category `%s' must only use `external' style" nil ((styles external)) make-hash-table :test equal make-closure #[514 "B\302\300\303#\211\303=\203 \304\301\"\300#\207\207" [V0 V1 gethash external--notfound puthash] 9 "\n\n(fn STRING POINT)"] #[771 "\304\305=\203 \305\306\303B\302BB\207:\203\\ \242\211\307\267\202Q \243\310\301\2031 \301\300\n\"#\2025 BB\207\243\300\"\311\203L \312\"\202M B\207\313\207\300\211%\207\211\300\211%\207" [V0 V1 V2 V3 #[1285 "\211G\"\300$\207" [complete-with-action] 11 "\n\n(fn --CL-LOOKUP-INTERNAL-- STRING PRED ACTION METHOD)"] metadata category #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (external-completion--tryc 28 external-completion--allc 55 boundaries 79)) external-completion--tryc external-completion--allc cl-remove-if-not nil] 13 "\n\n(fn STRING PRED ACTION)"]] 12 (#$ . 330)])#@35 

(fn OP STRING TABLE PRED POINT)
(defalias 'external-completion--call #[1285 "\300!\205 B#\242=\205 \211A\262\207" [functionp] 10 (#$ . 4220)])#@32 

(fn STRING TABLE PRED POINT)
(defalias 'external-completion--try-completion #[1028 "\300\301%\207" [external-completion--call external-completion--tryc] 10 (#$ . 4382)])#@32 

(fn STRING TABLE PRED POINT)
(defalias 'external-completion--all-completions #[1028 "\300\301%\207" [external-completion--call external-completion--allc] 10 (#$ . 4563)])
(provide 'external-completion)
