diff options
| author | Richard M. Stallman | 2002-08-09 01:56:00 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-08-09 01:56:00 +0000 |
| commit | 84003f382e9b713f451e65d54e103546df6febeb (patch) | |
| tree | 43d9552174bc2a3ef01265555b07052a61f1561d | |
| parent | d90ed3b46f7cbee36a60ce73deb4f5ad9917b65a (diff) | |
| download | emacs-84003f382e9b713f451e65d54e103546df6febeb.tar.gz emacs-84003f382e9b713f451e65d54e103546df6febeb.zip | |
(checkdoc, checkdoc-interactive)
(checkdoc-message-interactive, checkdoc-interactive-loop)
(checkdoc-current-buffer, checkdoc-continue, checkdoc-comments)
(checkdoc-defun):
Update checkdoc-spellcheck-documentation-flag correctly.
(checkdoc-ispell-docstring-engine): Don't test for
checkdoc-autofix-flag = nil.
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 98366036ca2..3720984196c 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -91,7 +91,7 @@ | |||
| 91 | ;; The variable `checkdoc-spellcheck-documentation-flag' can be set | 91 | ;; The variable `checkdoc-spellcheck-documentation-flag' can be set |
| 92 | ;; to customize how spell checking is to be done. Since spell | 92 | ;; to customize how spell checking is to be done. Since spell |
| 93 | ;; checking can be quite slow, you can optimize how best you want your | 93 | ;; checking can be quite slow, you can optimize how best you want your |
| 94 | ;; checking done. The default is 'defun, which spell checks each time | 94 | ;; checking done. The default is `defun', which spell checks each time |
| 95 | ;; `checkdoc-defun' or `checkdoc-eval-defun' is used. Setting to nil | 95 | ;; `checkdoc-defun' or `checkdoc-eval-defun' is used. Setting to nil |
| 96 | ;; prevents spell checking during normal usage. | 96 | ;; prevents spell checking during normal usage. |
| 97 | ;; Setting this variable to nil does not mean you cannot take | 97 | ;; Setting this variable to nil does not mean you cannot take |
| @@ -467,8 +467,8 @@ the users will view as each check is completed." | |||
| 467 | (interactive) | 467 | (interactive) |
| 468 | (let ((status (list "Checking..." "-" "-" "-")) | 468 | (let ((status (list "Checking..." "-" "-" "-")) |
| 469 | (checkdoc-spellcheck-documentation-flag | 469 | (checkdoc-spellcheck-documentation-flag |
| 470 | (member checkdoc-spellcheck-documentation-flag | 470 | (car (memq checkdoc-spellcheck-documentation-flag |
| 471 | '(buffer interactive t))) | 471 | '(buffer interactive t)))) |
| 472 | ;; if the user set autofix to never, then that breaks the | 472 | ;; if the user set autofix to never, then that breaks the |
| 473 | ;; obviously requested asking implied by using this function. | 473 | ;; obviously requested asking implied by using this function. |
| 474 | ;; Set it to paranoia level. | 474 | ;; Set it to paranoia level. |
| @@ -535,8 +535,8 @@ Optional argument SHOWSTATUS indicates that we should update the | |||
| 535 | checkdoc status window instead of the usual behavior." | 535 | checkdoc status window instead of the usual behavior." |
| 536 | (interactive "P") | 536 | (interactive "P") |
| 537 | (let ((checkdoc-spellcheck-documentation-flag | 537 | (let ((checkdoc-spellcheck-documentation-flag |
| 538 | (member checkdoc-spellcheck-documentation-flag | 538 | (car (memq checkdoc-spellcheck-documentation-flag |
| 539 | '(interactive t)))) | 539 | '(interactive t))))) |
| 540 | (checkdoc-interactive-loop start-here showstatus 'checkdoc-next-error))) | 540 | (checkdoc-interactive-loop start-here showstatus 'checkdoc-next-error))) |
| 541 | 541 | ||
| 542 | ;;;###autoload | 542 | ;;;###autoload |
| @@ -550,8 +550,8 @@ Optional argument SHOWSTATUS indicates that we should update the | |||
| 550 | checkdoc status window instead of the usual behavior." | 550 | checkdoc status window instead of the usual behavior." |
| 551 | (interactive "P") | 551 | (interactive "P") |
| 552 | (let ((checkdoc-spellcheck-documentation-flag | 552 | (let ((checkdoc-spellcheck-documentation-flag |
| 553 | (member checkdoc-spellcheck-documentation-flag | 553 | (car (memq checkdoc-spellcheck-documentation-flag |
| 554 | '(interactive t)))) | 554 | '(interactive t))))) |
| 555 | (checkdoc-interactive-loop start-here showstatus | 555 | (checkdoc-interactive-loop start-here showstatus |
| 556 | 'checkdoc-next-message-error))) | 556 | 'checkdoc-next-message-error))) |
| 557 | 557 | ||
| @@ -569,8 +569,8 @@ style." | |||
| 569 | (if (not start-here) (goto-char (point-min))))) | 569 | (if (not start-here) (goto-char (point-min))))) |
| 570 | ;; Assign a flag to spellcheck flag | 570 | ;; Assign a flag to spellcheck flag |
| 571 | (checkdoc-spellcheck-documentation-flag | 571 | (checkdoc-spellcheck-documentation-flag |
| 572 | (member checkdoc-spellcheck-documentation-flag | 572 | (car (memq checkdoc-spellcheck-documentation-flag |
| 573 | '(buffer interactive t))) | 573 | '(buffer interactive t)))) |
| 574 | ;; Fetch the error list | 574 | ;; Fetch the error list |
| 575 | (err-list (list (funcall findfunc nil))) | 575 | (err-list (list (funcall findfunc nil))) |
| 576 | (cdo nil) | 576 | (cdo nil) |
| @@ -803,7 +803,8 @@ otherwise stop after the first error." | |||
| 803 | (if (interactive-p) (message "Checking buffer for style...")) | 803 | (if (interactive-p) (message "Checking buffer for style...")) |
| 804 | ;; Assign a flag to spellcheck flag | 804 | ;; Assign a flag to spellcheck flag |
| 805 | (let ((checkdoc-spellcheck-documentation-flag | 805 | (let ((checkdoc-spellcheck-documentation-flag |
| 806 | (memq checkdoc-spellcheck-documentation-flag '(buffer t))) | 806 | (car (memq checkdoc-spellcheck-documentation-flag |
| 807 | '(buffer t)))) | ||
| 807 | (checkdoc-autofix-flag (if take-notes 'never | 808 | (checkdoc-autofix-flag (if take-notes 'never |
| 808 | checkdoc-autofix-flag)) | 809 | checkdoc-autofix-flag)) |
| 809 | (checkdoc-generate-compile-warnings-flag | 810 | (checkdoc-generate-compile-warnings-flag |
| @@ -847,8 +848,8 @@ is the starting location. If this is nil, `point-min' is used instead." | |||
| 847 | (let ((wrong nil) (msg nil) (errors nil) | 848 | (let ((wrong nil) (msg nil) (errors nil) |
| 848 | ;; Assign a flag to spellcheck flag | 849 | ;; Assign a flag to spellcheck flag |
| 849 | (checkdoc-spellcheck-documentation-flag | 850 | (checkdoc-spellcheck-documentation-flag |
| 850 | (member checkdoc-spellcheck-documentation-flag | 851 | (car (memq checkdoc-spellcheck-documentation-flag |
| 851 | '(buffer t))) | 852 | '(buffer t)))) |
| 852 | (checkdoc-autofix-flag (if take-notes 'never | 853 | (checkdoc-autofix-flag (if take-notes 'never |
| 853 | checkdoc-autofix-flag)) | 854 | checkdoc-autofix-flag)) |
| 854 | (checkdoc-generate-compile-warnings-flag | 855 | (checkdoc-generate-compile-warnings-flag |
| @@ -891,8 +892,8 @@ if there is one." | |||
| 891 | (if (not buffer-file-name) | 892 | (if (not buffer-file-name) |
| 892 | (error "Can only check comments for a file buffer")) | 893 | (error "Can only check comments for a file buffer")) |
| 893 | (let* ((checkdoc-spellcheck-documentation-flag | 894 | (let* ((checkdoc-spellcheck-documentation-flag |
| 894 | (member checkdoc-spellcheck-documentation-flag | 895 | (car (memq checkdoc-spellcheck-documentation-flag |
| 895 | '(buffer t))) | 896 | '(buffer t)))) |
| 896 | (checkdoc-autofix-flag (if take-notes 'never checkdoc-autofix-flag)) | 897 | (checkdoc-autofix-flag (if take-notes 'never checkdoc-autofix-flag)) |
| 897 | (e (checkdoc-file-comments-engine)) | 898 | (e (checkdoc-file-comments-engine)) |
| 898 | (checkdoc-generate-compile-warnings-flag | 899 | (checkdoc-generate-compile-warnings-flag |
| @@ -971,8 +972,8 @@ space at the end of each line." | |||
| 971 | (forward-sexp 1) | 972 | (forward-sexp 1) |
| 972 | (skip-chars-forward " \n\t") | 973 | (skip-chars-forward " \n\t") |
| 973 | (let* ((checkdoc-spellcheck-documentation-flag | 974 | (let* ((checkdoc-spellcheck-documentation-flag |
| 974 | (member checkdoc-spellcheck-documentation-flag | 975 | (car (memq checkdoc-spellcheck-documentation-flag |
| 975 | '(defun t))) | 976 | '(defun t)))) |
| 976 | (beg (save-excursion (beginning-of-defun) (point))) | 977 | (beg (save-excursion (beginning-of-defun) (point))) |
| 977 | (end (save-excursion (end-of-defun) (point))) | 978 | (end (save-excursion (end-of-defun) (point))) |
| 978 | (msg (checkdoc-this-string-valid))) | 979 | (msg (checkdoc-this-string-valid))) |
| @@ -2052,7 +2053,11 @@ before using the Ispell engine on it." | |||
| 2052 | (if (or (not checkdoc-spellcheck-documentation-flag) | 2053 | (if (or (not checkdoc-spellcheck-documentation-flag) |
| 2053 | ;; If the user wants no questions or fixing, then we must | 2054 | ;; If the user wants no questions or fixing, then we must |
| 2054 | ;; disable spell checking as not useful. | 2055 | ;; disable spell checking as not useful. |
| 2055 | (not checkdoc-autofix-flag) | 2056 | ;; FIXME: Somehow, `checkdoc-autofix-flag' is always nil |
| 2057 | ;; when `checkdoc-ispell-docstring-engine' is called to be | ||
| 2058 | ;; used on a docstring. As a workround, I commented out the | ||
| 2059 | ;; next line. | ||
| 2060 | ;; (not checkdoc-autofix-flag) | ||
| 2056 | (eq checkdoc-autofix-flag 'never)) | 2061 | (eq checkdoc-autofix-flag 'never)) |
| 2057 | nil | 2062 | nil |
| 2058 | (checkdoc-ispell-init) | 2063 | (checkdoc-ispell-init) |