[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 03/05: * packages/wcheck-mode/wcheck-mode.el (wcheck--program-exe
From: |
Stefan Monnier |
Subject: |
[elpa] 03/05: * packages/wcheck-mode/wcheck-mode.el (wcheck--program-executable-p): Use executable-find. (wcheck--language-data-valid-p): Use memq and give better diagnostics. |
Date: |
Wed, 15 Oct 2014 19:35:26 +0000 |
monnier pushed a commit to branch master
in repository elpa.
commit 3ccaa6f8172f3b66bd8ed3158207694d62f265e6
Author: Stefan Monnier <address@hidden>
Date: Wed Oct 15 15:32:23 2014 -0400
* packages/wcheck-mode/wcheck-mode.el (wcheck--program-executable-p):
Use executable-find.
(wcheck--language-data-valid-p): Use memq and give better diagnostics.
---
packages/wcheck-mode/wcheck-mode.el | 37 +++++++++++++++++------------------
1 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/packages/wcheck-mode/wcheck-mode.el
b/packages/wcheck-mode/wcheck-mode.el
index b8c2b65..ed46e78 100644
--- a/packages/wcheck-mode/wcheck-mode.el
+++ b/packages/wcheck-mode/wcheck-mode.el
@@ -213,7 +213,9 @@
;;;###autoload
-(defcustom wcheck-language-data nil
+(defcustom wcheck-language-data
+ ;; FIXME: Auto-fill by looking at installed spell-checkers and dictionaries!
+ nil
"Language configuration for `wcheck-mode'.
The variable is an association list (alist) and its elements are
@@ -1951,25 +1953,22 @@ expression will return a boolean."
(syntax-table-p (and (boundp value) (eval value)))))
((and (eq key 'face)
(facep value)))
- ((and (or (eq key 'regexp-start)
- (eq key 'regexp-body)
- (eq key 'regexp-end)
- (eq key 'regexp-discard))
+ ((and (memq key '(regexp-start regexp-body regexp-end regexp-discard))
(stringp value)))
- ((and (or (eq key 'program)
- (eq key 'action-program))
+ ((and (memq key '(program action-program))
(or (stringp value)
- (functionp value))))
+ (functionp value)
+ (and value (symbolp value)
+ (error "Invalid %s value: %S" key value)))))
((and (eq key 'args)
(wcheck--list-of-strings-p value)))
((and (eq key 'action-args)
(wcheck--list-of-strings-p value)))
- ((and (or (eq key 'parser)
- (eq key 'action-parser))
- (functionp value)))
- ((or (eq key 'connection)
- (eq key 'case-fold)
- (eq key 'action-autoselect)))
+ ((and (memq key '(parser action-parser))
+ (or (functionp value)
+ (and value
+ (error "%s not a function: %S" key value)))))
+ ((memq key '(connection case-fold action-autoselect)))
((and (eq key 'read-or-skip-faces)
(wcheck--list-of-lists-p value)))))
@@ -2017,11 +2016,11 @@ a (valid) value for the KEY then query the value from
(defun wcheck--program-executable-p (program)
- "Return t if PROGRAM is executable regular file."
- (and (stringp program)
- (file-regular-p program)
- (file-executable-p program)
- t))
+ "Return non-nil if PROGRAM is executable regular file."
+ (when (stringp program)
+ (let ((f (executable-find program)))
+ (and (file-regular-p f)
+ (file-executable-p f)))))
(defun wcheck--program-configured-p (language)
- [elpa] branch master updated (c9d8a70 -> 25c579d), Stefan Monnier, 2014/10/15
- [elpa] 01/05: * packages/lmc/lmc.el (lmc--load-word): Remove unused vars. (lmc-after-change, lmc-tool-bar-to-string): Mark unused args., Stefan Monnier, 2014/10/15
- [elpa] 03/05: * packages/wcheck-mode/wcheck-mode.el (wcheck--program-executable-p): Use executable-find. (wcheck--language-data-valid-p): Use memq and give better diagnostics.,
Stefan Monnier <=
- [elpa] 05/05: * packages/debbugs/debbugs-org.el: Miscellanous cleanups. (debbugs-org-search): Remove unused var `date-format'. (debbugs-org-show-reports): Avoid add-to-list on local var. * packages/debbugs/debbugs.el (debbugs-get-usertag, debbugs-search-est): Avoid add-to-list on local var., Stefan Monnier, 2014/10/15
- [elpa] 02/05: * packages/sml-mode/sml-mode.el (sml-smie-grammar): Add "withtype". (sml-smie-rules): Use pcase. (sml-smie-non-nested-of-p): Rewrite to avoid regexp and stay closer to point., Stefan Monnier, 2014/10/15
- [elpa] 04/05: * packages/lex/lex.el: Use lexical-binding., Stefan Monnier, 2014/10/15