Throw a user-error when no result found

That way the usual buffer isn't raised.
This commit is contained in:
TEC 2021-07-30 02:08:42 +08:00
parent 26c7cdac16
commit 25c8d839cf
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 3 additions and 3 deletions

View File

@ -604,9 +604,9 @@ by `lexic-format-result' in successful case, `cases-format-failure' otherwise."
(let ((dicts? (not (string-match-p "\\`Dictionary's name +Word count[\n ]+\\'"
(shell-command-to-string (concat lexic-program-path " -l"))))))
(if dicts?
(message "Couldn't find anything similar to your search, sorry :(")
(message "No results found, but you don't seem to have any dictionaries installed! Try %s"
(propertize "M-x lexic-dictionary-help" 'face 'font-lock-keyword-face)))))
(user-error "Couldn't find anything similar to your search, sorry :(")
(user-error "No results found, but you don't seem to have any dictionaries installed! Try %s"
(propertize "M-x lexic-dictionary-help" 'face 'font-lock-keyword-face)))))
(defun lexic-parse-results (result)
"Loop through every entry in RESULT and parse each one.