From 129fcb3d38b60f15c70f72851ddc3abeff39efe6 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 3 Oct 2022 21:40:27 +0200 Subject: [PATCH] Improve messaging in ecomplete-remove * lisp/ecomplete.el (ecomplete-remove): Make messaging better. --- lisp/ecomplete.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el index 6e40eb74564..6ff67d46d20 100644 --- a/lisp/ecomplete.el +++ b/lisp/ecomplete.el @@ -314,12 +314,17 @@ non-nil and there is only a single completion option available." (elems (seq-filter (lambda (elem) (string-match-p match (car elem))) data))) - (when (yes-or-no-p (format "Delete %s matching ecomplete entries? " - (length elems))) - (dolist (elem elems) - (ecomplete--remove-item type (car elem))) - (ecomplete-save) - (message "Deleted entries")))) + (if (length= elems 0) + (message "No matching entries for %s" match) + (when (yes-or-no-p (format "Delete %s matching ecomplete %s? " + (length elems) + (if (length= elems 1) + "entry" + "entries"))) + (dolist (elem elems) + (ecomplete--remove-item type (car elem))) + (ecomplete-save) + (message "Deleted entries"))))) (provide 'ecomplete) -- 2.39.2