(pcase res
(`(,_ ,beg ,end ,table . ,plist)
(let* ((pred (plist-get plist :predicate))
+ (exit-fn (plist-get plist :exit-function))
(string (buffer-substring beg end))
(md (completion-metadata string table pred))
(sort-fn (or (completion-metadata-get md 'cycle-sort-function)
(setq completion-preview--overlay (make-overlay end end))
(overlay-put completion-preview--overlay 'after-string after)
(overlay-put completion-preview--overlay 'completion-preview-data
- (append (list beg end (list cand)) plist))
+ (list beg end (list cand) :exit-function exit-fn))
(completion-preview-active-mode)))))))))))
(defun completion-preview--post-command ()