From: Mauro Aranda Date: Mon, 7 Oct 2019 01:36:09 +0000 (+0200) Subject: Fix message when no completions available for editable field X-Git-Tag: emacs-27.0.90~1246 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=22af213f804d1405a5266a9d0e0e51a69daabef7;p=emacs.git Fix message when no completions available for editable field * 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). --- diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 916d41af252..a5999c0de8d 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -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.