diff options
author | Mauro Aranda <maurooaranda@gmail.com> | 2019-10-07 03:36:09 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-07 03:36:54 +0200 |
commit | 22af213f804d1405a5266a9d0e0e51a69daabef7 (patch) | |
tree | 9a433c3c473d4ec81f9475c0deab81811893e87f /lisp/wid-edit.el | |
parent | 785dda9406e2bb2950cc23db42329c8fd8fb3868 (diff) | |
download | emacs-22af213f804d1405a5266a9d0e0e51a69daabef7.tar.gz emacs-22af213f804d1405a5266a9d0e0e51a69daabef7.tar.bz2 emacs-22af213f804d1405a5266a9d0e0e51a69daabef7.zip |
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).
Diffstat (limited to 'lisp/wid-edit.el')
-rw-r--r-- | lisp/wid-edit.el | 7 |
1 files changed, 4 insertions, 3 deletions
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. |