diff options
| author | Richard M. Stallman | 2002-02-06 15:33:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-02-06 15:33:23 +0000 |
| commit | 1c511be4d963f4882e9ff03d484be99260c355e4 (patch) | |
| tree | 92c9edb624f232a6e978e3aa4976f896299a023d | |
| parent | e711842f4bcb1e92555b7e80b33ddcda8b9f55f1 (diff) | |
| download | emacs-1c511be4d963f4882e9ff03d484be99260c355e4.tar.gz emacs-1c511be4d963f4882e9ff03d484be99260c355e4.zip | |
(checkdoc-this-string-valid-engine):
Replace foo-p as var name with foo-flag, not foo-p-flag.
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index f6100122730..17aab149a47 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -1592,18 +1592,22 @@ function,command,variable,option or symbol." ms1)))))) | |||
| 1592 | ;; If the doc string starts with "Non-nil means" | 1592 | ;; If the doc string starts with "Non-nil means" |
| 1593 | (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+") | 1593 | (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+") |
| 1594 | (not (string-match "-flag$" (car fp)))) | 1594 | (not (string-match "-flag$" (car fp)))) |
| 1595 | (if (checkdoc-y-or-n-p | 1595 | (let ((newname |
| 1596 | (format | 1596 | (if (string-match "-p$" (car fp)) |
| 1597 | "Rename to %s and Query-Replace all occurances? " | 1597 | (concat (substring (car fp) 0 -2) "-flag") |
| 1598 | (concat (car fp) "-flag"))) | 1598 | (concat (car fp) "-flag")))) |
| 1599 | (progn | 1599 | (if (checkdoc-y-or-n-p |
| 1600 | (beginning-of-defun) | 1600 | (format |
| 1601 | (query-replace-regexp | 1601 | "Rename to %s and Query-Replace all occurances? " |
| 1602 | (concat "\\<" (regexp-quote (car fp)) "\\>") | 1602 | newname)) |
| 1603 | (concat (car fp) "-flag"))) | 1603 | (progn |
| 1604 | (checkdoc-create-error | 1604 | (beginning-of-defun) |
| 1605 | "Flag variable names should normally end in `-flag'" s | 1605 | (query-replace-regexp |
| 1606 | (marker-position e)))) | 1606 | (concat "\\<" (regexp-quote (car fp)) "\\>") |
| 1607 | newname)) | ||
| 1608 | (checkdoc-create-error | ||
| 1609 | "Flag variable names should normally end in `-flag'" s | ||
| 1610 | (marker-position e))))) | ||
| 1607 | ;; Done with variables | 1611 | ;; Done with variables |
| 1608 | )) | 1612 | )) |
| 1609 | (t | 1613 | (t |