[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 211/352: Hiotaan vielä oikolukuehdotusten ohjelmavirheenkäsittel
From: |
Stefan Monnier |
Subject: |
[elpa] 211/352: Hiotaan vielä oikolukuehdotusten ohjelmavirheenkäsittelyä |
Date: |
Mon, 07 Jul 2014 14:04:11 +0000 |
monnier pushed a commit to branch master
in repository elpa.
commit 4385e542be01e3907285210b3ef33aca517c50d3
Author: Teemu Likonen <address@hidden>
Date: Sun Jan 2 10:46:13 2011 +0000
Hiotaan vielä oikolukuehdotusten ohjelmavirheenkäsittelyä
---
wcheck-mode.el | 41 +++++++++++++++++++++++------------------
1 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/wcheck-mode.el b/wcheck-mode.el
index 2c9ab16..3bd51a0 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -612,9 +612,12 @@ This is used when language does not define a face."
(wcheck-define-condition wcheck-error error)
(wcheck-define-condition wcheck-language-does-not-exist-error wcheck-error)
(wcheck-define-condition wcheck-program-not-configured-error wcheck-error)
+(wcheck-define-condition wcheck-not-a-list-of-strings-error wcheck-error)
(wcheck-define-condition wcheck-suggestion-error wcheck-error)
(wcheck-define-condition wcheck-suggestion-program-error
wcheck-suggestion-error)
+(wcheck-define-condition wcheck-parser-function-not-configured-error
+ wcheck-suggestion-error)
;;; Interactive commands
@@ -1283,9 +1286,22 @@ was replaced."
(if (markerp start) (set-marker start nil))
(if (markerp end) (set-marker end nil))))
return-value)
+
+ (wcheck-suggestion-program-error
+ (message (concat "Language \"%s\": suggestion program or "
+ "function not configured")
+ (cdr error-data)))
+
+ (wcheck-parser-function-not-configured-error
+ (message "Language \"%s\": parser function is not configured"
+ (cdr error-data)))
+
+ (wcheck-not-a-list-of-strings-error
+ (message (concat "Suggestion program or parser function did not return "
+ "a list of strings (or nil)")))
+
(wcheck-suggestion-error
- (message "%s" (cdr error-data))
- nil)))
+ (message "%s" (cdr error-data)))))
(defun wcheck-get-suggestions (language text)
@@ -1310,17 +1326,12 @@ there aren't any)."
(parser suggestion-parser))
(cond ((not (wcheck-suggestion-program-configured-p language))
- (signal 'wcheck-suggestion-program-error
- (format (concat "Language \"%s\": suggestion program or "
- "function not configured")
- language)))
+ (signal 'wcheck-suggestion-program-error language))
((and (stringp program)
(not parser))
- (signal 'wcheck-suggestion-program-error
- (format (concat "Language \"%s\": parser function is not "
- "configured")
- language)))
+ (signal 'wcheck-parser-function-not-configured-error language
+ language))
((stringp program)
(with-temp-buffer
@@ -1331,19 +1342,13 @@ there aren't any)."
(let ((suggestions (save-match-data (funcall parser))))
(if (wcheck-list-of-strings-p suggestions)
suggestions
- (progn
- (message
- "Parser function must return a list of strings or nil")
- 'error)))))
+ (signal 'wcheck-not-a-list-of-strings-error nil)))))
((functionp program)
(let ((suggestions (save-match-data (funcall program text))))
(if (wcheck-list-of-strings-p suggestions)
suggestions
- (progn
- (message
- "Suggestion function must return a list of strings or nil")
- 'error)))))))
+ (signal 'wcheck-not-a-list-of-strings-error nil)))))))
(defun wcheck-choose-suggestion-popup (suggestions event)
- [elpa] 265/352: Emphasize wcheck-language-data-defaults in read-or-skip-faces doc, (continued)
- [elpa] 265/352: Emphasize wcheck-language-data-defaults in read-or-skip-faces doc, Stefan Monnier, 2014/07/07
- [elpa] 270/352: Revert "Clarify that OPERATION-MODE can be also be nil", Stefan Monnier, 2014/07/07
- [elpa] 285/352: Make "syntax" and "case-fold" effective with "program" function, Stefan Monnier, 2014/07/07
- [elpa] 193/352: Vaihdetaan muuttujan nimi paremmin tarkoitusta kuvaamvaksi, Stefan Monnier, 2014/07/07
- [elpa] 291/352: Version 2011.07.04, Stefan Monnier, 2014/07/07
- [elpa] 172/352: Lisätään autoload-komento alun asennusohjeisiin (-spelling-suggestions), Stefan Monnier, 2014/07/07
- [elpa] 348/352: Enchant must be restarted after calling enchant-add-to-dictionary, Stefan Monnier, 2014/07/07
- [elpa] 338/352: Silence byte-compiler warning about SHOW-ENTRY function, Stefan Monnier, 2014/07/07
- [elpa] 297/352: Remove "A" from the README file's subtitle, Stefan Monnier, 2014/07/07
- [elpa] 304/352: A minor document fix, Stefan Monnier, 2014/07/07
- [elpa] 211/352: Hiotaan vielä oikolukuehdotusten ohjelmavirheenkäsittelyä,
Stefan Monnier <=
- [elpa] 126/352: Parannetaan virhetilanteiden tarkistusta ja virheilmoituksia, Stefan Monnier, 2014/07/07
- [elpa] 298/352: Update link to README.org, Stefan Monnier, 2014/07/07
- [elpa] 350/352: Use PUSH instead of ADD-TO-LIST, Stefan Monnier, 2014/07/07
- [elpa] 213/352: Poistetaan ylimääräinen parametri signal-funktiolta, Stefan Monnier, 2014/07/07
- [elpa] 128/352: Siirretään funktion wcheck-receive-words paikkaa, Stefan Monnier, 2014/07/07
- [elpa] 127/352: Siirretään ylläpitotehtäviä funktioon, jossa niitä muutenkin tehdään, Stefan Monnier, 2014/07/07
- [elpa] 196/352: Uusi macro: wcheck-with-language-data, Stefan Monnier, 2014/07/07
- [elpa] 330/352: Add hyperlinks to Emacs, Flyspell and Speck mode, Stefan Monnier, 2014/07/07
- [elpa] 300/352: Simplify the customize code of wcheck-language-data, Stefan Monnier, 2014/07/07
- [elpa] 328/352: Add another <>'s around the email address, Stefan Monnier, 2014/07/07