]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve messaging in ecomplete-remove
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 3 Oct 2022 19:40:27 +0000 (21:40 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 3 Oct 2022 19:40:27 +0000 (21:40 +0200)
* lisp/ecomplete.el (ecomplete-remove): Make messaging better.

lisp/ecomplete.el

index 6e40eb7456432fed0ed424fe47726281283762d3..6ff67d46d20c7d3fb8da86f70d27dfdf3aa6465c 100644 (file)
@@ -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)