changeset 43133:c929176c272b

(checkdoc-this-string-valid-engine): Replace foo-p as var name with foo-flag, not foo-p-flag.
author Richard M. Stallman <rms@gnu.org>
date Wed, 06 Feb 2002 15:33:23 +0000
parents 0dd2ebecd217
children ecd029f63cc0
files lisp/emacs-lisp/checkdoc.el
diffstat 1 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/checkdoc.el	Wed Feb 06 15:32:16 2002 +0000
+++ b/lisp/emacs-lisp/checkdoc.el	Wed Feb 06 15:33:23 2002 +0000
@@ -1592,18 +1592,22 @@
 	     ;; 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