diff --git a/cape.el b/cape.el index dfb1e7a95c..f10decb5ff 100644 --- a/cape.el +++ b/cape.el @@ -199,13 +199,17 @@ VALID is the input comparator, see `cape--input-valid-p'." (end (copy-marker end t)) (table nil)) (lambda (str pred action) - (let ((new-input (buffer-substring-no-properties beg end))) - (when (or (eq input 'init) (not (cape--input-valid-p input new-input valid))) - ;; NOTE: We have to make sure that the completion table is interruptible. - ;; An interruption should not happen between the setqs. - (setq table (funcall fun new-input) - input new-input))) - (complete-with-action action table str pred)))) + (if (or (eq action 'metadata) (eq (car-safe action) 'boundaries)) + nil + (let ((new-input (buffer-substring-no-properties beg end))) + (when (or (eq input 'init) + (not (cape--input-valid-p input new-input valid))) + ;; NOTE: We have to make sure that the completion table is + ;; interruptible. An interruption should not happen + ;; between the setqs. + (setq table (funcall fun new-input) + input new-input))) + (complete-with-action action table str pred))))) ;;;; Capfs