]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix message when no completions available for editable field
authorMauro Aranda <maurooaranda@gmail.com>
Mon, 7 Oct 2019 01:36:09 +0000 (03:36 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 7 Oct 2019 01:36:54 +0000 (03:36 +0200)
* lisp/wid-edit.el (widget-completions-at-point): Detect here if point
is not in an editable field.
(widget-complete): And here say there are no completions available
(bug#11562).

lisp/wid-edit.el

index 916d41af252cb03ca9707590d3fe3ca8d78b4d6c..a5999c0de8d249d5e9abb2ee70f03b6103c2a6ee 100644 (file)
@@ -1166,7 +1166,7 @@ When not inside a field, signal an error."
                               (plist-get completion-extra-properties
                                          :predicate))))
      (t
-      (error "Not in an editable field")))))
+      (error "No completions available for this field")))))
 ;; We may want to use widget completion in buffers where the major mode
 ;; hasn't added widget-completions-at-point to completion-at-point-functions,
 ;; so it's not really obsolete (yet).
@@ -1174,8 +1174,9 @@ When not inside a field, signal an error."
 
 (defun widget-completions-at-point ()
   (let ((field (widget-field-find (point))))
-    (when field
-      (widget-apply field :completions-function))))
+    (if field
+        (widget-apply field :completions-function)
+      (error "Not in an editable field"))))
 
 ;;; Setting up the buffer.