]> git.eshelyaron.com Git - emacs.git/commitdiff
(checkdoc-this-string-valid-engine):
authorRichard M. Stallman <rms@gnu.org>
Wed, 6 Feb 2002 15:33:23 +0000 (15:33 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 6 Feb 2002 15:33:23 +0000 (15:33 +0000)
Replace foo-p as var name with foo-flag, not foo-p-flag.

lisp/emacs-lisp/checkdoc.el

index f6100122730d5969287fb85f8b72c34126956bf0..17aab149a472e0e96a37ceb05a9f0923c51cf951 100644 (file)
@@ -1592,18 +1592,22 @@ function,command,variable,option or symbol." ms1))))))
             ;; If the doc string starts with "Non-nil means"
             (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+")
                      (not (string-match "-flag$" (car fp))))
-                (if (checkdoc-y-or-n-p
-                     (format
-                      "Rename to %s and Query-Replace all occurances? "
-                      (concat (car fp) "-flag")))
-                    (progn
-                      (beginning-of-defun)
-                      (query-replace-regexp
-                       (concat "\\<" (regexp-quote (car fp)) "\\>")
-                       (concat (car fp) "-flag")))
-                  (checkdoc-create-error
-                   "Flag variable names should normally end in `-flag'" s
-                   (marker-position e))))
+                (let ((newname
+                       (if (string-match "-p$" (car fp))
+                           (concat (substring (car fp) 0 -2) "-flag")
+                         (concat (car fp) "-flag"))))
+                  (if (checkdoc-y-or-n-p
+                       (format
+                        "Rename to %s and Query-Replace all occurances? "
+                        newname))
+                      (progn
+                        (beginning-of-defun)
+                        (query-replace-regexp
+                         (concat "\\<" (regexp-quote (car fp)) "\\>")
+                         newname))
+                    (checkdoc-create-error
+                     "Flag variable names should normally end in `-flag'" s
+                     (marker-position e)))))
             ;; Done with variables
             ))
           (t