From: Eshel Yaron Date: Wed, 11 Jun 2025 20:14:39 +0000 (+0200) Subject: (c-a-p-f-with-frecency-sorting): Respect existing :exit-function X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4616d30f40c2547f6a1bad0b35c5e452ca4c413b;p=emacs.git (c-a-p-f-with-frecency-sorting): Respect existing :exit-function --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 915c930a9dd..be3cfd3dcb5 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3393,6 +3393,7 @@ modify CAPF." (let* ((pred (plist-get plist :predicate)) (completion-extra-properties plist) (md (completion-metadata (buffer-substring beg end) table pred)) + (ef (completion-metadata-get md 'exit-function)) (sf (completion-metadata-get md 'sort-function))) `( ,beg ,end ,(completion-table-with-metadata @@ -3409,11 +3410,12 @@ modify CAPF." ,@(plist-put (copy-sequence plist) :exit-function - (lambda (str _sts) + (lambda (str sts) (let* ((str (substring-no-properties str)) (ts (gethash str cache))) (setf (gethash str cache) - (cons (float-time) (1+ (or (cdr ts) 0)))))))))))))) + (cons (float-time) (1+ (or (cdr ts) 0))))) + (when (functionp ef) (funcall ef str sts))))))))))) (defun completion-at-point () "Perform completion on the text around point.