[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/wcheck-mode 03ea5f1 01/39: Sync changes from GNU Elpa (
From: |
Teemu Likonen |
Subject: |
[elpa] externals/wcheck-mode 03ea5f1 01/39: Sync changes from GNU Elpa (minor fixes; no functional changes) |
Date: |
Sun, 4 Oct 2020 07:55:17 -0400 (EDT) |
branch: externals/wcheck-mode
commit 03ea5f18194d00f5e31075ebefe73289652ac3c8
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Teemu Likonen <tlikonen@iki.fi>
Sync changes from GNU Elpa (minor fixes; no functional changes)
---
wcheck-mode.el | 69 ++++++++++++++++++++++++++++------------------------------
1 file changed, 33 insertions(+), 36 deletions(-)
diff --git a/wcheck-mode.el b/wcheck-mode.el
index dd38361..989215d 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -62,7 +62,6 @@
;; and, based on their output, decides if some parts of text should be
;; marked in the buffer.
-
;;; Code:
@@ -215,7 +214,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
@@ -1233,10 +1234,9 @@ requested it."
(remove-hook (car hook) (cdr hook))))
-(defun wcheck--hook-window-scroll (window window-start)
+(defun wcheck--hook-window-scroll (window _window-start)
"`wcheck-mode' hook for window scroll.
-Request update for the buffer when its window have been
-scrolled."
+Request update for the buffer when its window have been scrolled."
(with-current-buffer (window-buffer window)
(when wcheck-mode
(wcheck--buffer-data-set (current-buffer) :read-req t))))
@@ -1268,7 +1268,7 @@ changed."
'currentframe))
-(defun wcheck--hook-after-change (beg end len)
+(defun wcheck--hook-after-change (_beg _end _len)
"`wcheck-mode' hook for buffer content change.
Request update for the buffer when its content has been edited."
;; The buffer that has changed is the current buffer when this hook
@@ -1858,7 +1858,7 @@ or nil."
nil))
-(defun wcheck-parser-lines (&rest ignored)
+(defun wcheck-parser-lines (&rest _ignored)
"Parser for newline-separated output.
Return current buffer's lines as a list of strings."
(delete-dups (split-string (buffer-substring-no-properties
@@ -1866,7 +1866,7 @@ Return current buffer's lines as a list of strings."
"\n+" t)))
-(defun wcheck-parser-whitespace (&rest ignored)
+(defun wcheck-parser-whitespace (&rest _ignored)
"Parser for whitespace-separated output.
Split current buffer's content to whitespace-separated tokens and
return them as a list of strings."
@@ -1875,7 +1875,7 @@ return them as a list of strings."
"[ \f\t\n\r\v]+" t)))
-(defun wcheck-parser-ispell-suggestions (&rest ignored)
+(defun wcheck-parser-ispell-suggestions (&rest _ignored)
"Parser for Ispell-compatible programs' spelling suggestions."
(let ((search-spaces-regexp nil))
(when (re-search-forward "^& [^ ]+ \\([0-9]+\\) [0-9]+: \\(.+\\)$" nil t)
@@ -1900,17 +1900,17 @@ return them as a list of strings."
(delete-dups faces)))
-(defun wcheck--major-mode-face-settings (language major-mode)
- "Return read/skip face settings for MAJOR-MODE."
+(defun wcheck--major-mode-face-settings (language mode)
+ "Return read/skip face settings for MODE."
(let ((data (wcheck-query-language-data language 'read-or-skip-faces))
conf)
(catch 'answer
(while data
(setq conf (pop data))
(when (or (eq nil (car conf))
- (eq major-mode (car conf))
+ (eq mode (car conf))
(and (listp (car conf))
- (memq major-mode (car conf))))
+ (memq mode (car conf))))
(throw 'answer conf))))))
@@ -1923,14 +1923,14 @@ Both arguments are lists."
(throw 'found t)))))
-(defun wcheck--generate-face-predicate (language major-mode)
- "Generates a face predicate expression for scanning buffer.
+(defun wcheck--generate-face-predicate (language mode)
+ "Generate a face predicate expression for scanning buffer.
Return a predicate expression that is used to decide whether
`wcheck-mode' should read or paint text at the current point
-position with LANGUAGE and MAJOR-MODE. Evaluating the predicate
+position with LANGUAGE and MODE. Evaluating the predicate
expression will return a boolean."
(let* ((face-settings (wcheck--major-mode-face-settings
- language major-mode))
+ language mode))
(mode (nth 1 face-settings))
(faces (nthcdr 2 face-settings)))
(cond ((not font-lock-mode)
@@ -1954,25 +1954,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)))))
@@ -2020,11 +2017,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)
@@ -2128,7 +2125,7 @@ range BEG to END. Otherwise remove all overlays."
(remove-overlays beg end 'wcheck-mode t))
-(defun wcheck--remove-changed-overlay (overlay after beg end &optional len)
+(defun wcheck--remove-changed-overlay (overlay after _beg _end &optional _len)
"Hook for removing overlay which is being edited."
(unless after
(delete-overlay overlay)))
- [elpa] branch externals/wcheck-mode created (now 0c744a4), Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 029b031 04/39: Merge branch 'master' of github.com:tlikonen/wcheck-mode, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 841dc3b 07/39: Precalculate (expt 2 16): 65536, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode d391262 05/39: Update package version: 2015.10.15, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 4cf2503 09/39: Update MELPA URL, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 866954f 11/39: New version, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 6f5e9fa 12/39: Small changes to introduction texts, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 53555c6 17/39: Fix wcheck--generate-face-predicate: return lambda in all cases, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode ed77898 16/39: Remove Marmalade package archive, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 2b696d5 18/39: Revert "Use jit-lock-fontify-now instead of font-lock-fontify-region", Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 03ea5f1 01/39: Sync changes from GNU Elpa (minor fixes; no functional changes),
Teemu Likonen <=
- [elpa] externals/wcheck-mode a8dcccb 02/39: Allow exec-path search to find external program, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 011219f 03/39: Merge pull request #6 from justbur/master, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 0edd086 06/39: Update copyright year: 2015, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode f92887e 08/39: Eval wcheck--buffer-data-key-index only once in wcheck--buffer-data-get, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode a6e2865 10/39: Add link to PGP key, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 07fdd27 14/39: Update copyright year, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 9693712 20/39: If exists use font-lock-ensure, else font-lock-fontify-region, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 6aa2662 24/39: Fix `wcheck--language-exists-p` if executable does not exist, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode 9564d6da 30/39: Add (require 'outline) to wcheck--timer-jump-event function, Teemu Likonen, 2020/10/04
- [elpa] externals/wcheck-mode a2affd8 28/39: Improve the doc string of wcheck--generate-face-predicate function, Teemu Likonen, 2020/10/04