From: Lars Ingebrigtsen Date: Mon, 3 Oct 2022 19:40:27 +0000 (+0200) Subject: Improve messaging in ecomplete-remove X-Git-Tag: emacs-29.0.90~1856^2~53 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=129fcb3d38b60f15c70f72851ddc3abeff39efe6;p=emacs.git Improve messaging in ecomplete-remove * lisp/ecomplete.el (ecomplete-remove): Make messaging better. --- 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)