diff options
| author | Juanma Barranquero | 2008-04-08 11:47:48 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-04-08 11:47:48 +0000 |
| commit | 66e9f105e0db4fea80738db3613afe0207dba945 (patch) | |
| tree | 7ebae266f6459866101fb3c7947976ada02561a8 | |
| parent | 80817d7b5e773d3be5ef4e17947ad841e4ccf91a (diff) | |
| download | emacs-66e9f105e0db4fea80738db3613afe0207dba945.tar.gz emacs-66e9f105e0db4fea80738db3613afe0207dba945.zip | |
(checkdoc-this-string-valid-engine): Use `string-match-p'.
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index b2979693f6c..d833a358d94 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -1774,10 +1774,9 @@ function,command,variable,option or symbol." ms1)))))) | |||
| 1774 | checkdoc-common-verbs-wrong-voice)) | 1774 | checkdoc-common-verbs-wrong-voice)) |
| 1775 | (if (not rs) (error "Verb voice alist corrupted")) | 1775 | (if (not rs) (error "Verb voice alist corrupted")) |
| 1776 | (setq replace (let ((case-fold-search nil)) | 1776 | (setq replace (let ((case-fold-search nil)) |
| 1777 | (save-match-data | 1777 | (if (string-match-p "^[A-Z]" original) |
| 1778 | (if (string-match "^[A-Z]" original) | 1778 | (capitalize (cdr rs)) |
| 1779 | (capitalize (cdr rs)) | 1779 | (cdr rs)))) |
| 1780 | (cdr rs))))) | ||
| 1781 | (if (checkdoc-autofix-ask-replace | 1780 | (if (checkdoc-autofix-ask-replace |
| 1782 | (match-beginning 1) (match-end 1) | 1781 | (match-beginning 1) (match-end 1) |
| 1783 | (format "Use the imperative for \"%s\". \ | 1782 | (format "Use the imperative for \"%s\". \ |
| @@ -1805,11 +1804,10 @@ Replace with \"%s\"? " original replace) | |||
| 1805 | "[^-([`':a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^]']" | 1804 | "[^-([`':a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^]']" |
| 1806 | e t)) | 1805 | e t)) |
| 1807 | (setq ms (match-string 1)) | 1806 | (setq ms (match-string 1)) |
| 1808 | (save-match-data | 1807 | ;; A . is a \s_ char, so we must remove periods from |
| 1809 | ;; A . is a \s_ char, so we must remove periods from | 1808 | ;; sentences more carefully. |
| 1810 | ;; sentences more carefully. | 1809 | (when (string-match-p "\\.$" ms) |
| 1811 | (if (string-match "\\.$" ms) | 1810 | (setq ms (substring ms 0 (1- (length ms))))) |
| 1812 | (setq ms (substring ms 0 (1- (length ms)))))) | ||
| 1813 | (if (and (not (checkdoc-in-sample-code-p start e)) | 1811 | (if (and (not (checkdoc-in-sample-code-p start e)) |
| 1814 | (not (checkdoc-in-example-string-p start e)) | 1812 | (not (checkdoc-in-example-string-p start e)) |
| 1815 | (not (member ms checkdoc-symbol-words)) | 1813 | (not (member ms checkdoc-symbol-words)) |