changeset 95423:727011ae8ff8

(checkdoc-this-string-valid-engine): Don't encourage naming variables with "-flag".
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 30 May 2008 14:51:48 +0000
parents d3eb9cc70765
children f03be7461a37
files lisp/ChangeLog lisp/emacs-lisp/checkdoc.el
diffstat 2 files changed, 26 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri May 30 13:21:57 2008 +0000
+++ b/lisp/ChangeLog	Fri May 30 14:51:48 2008 +0000
@@ -1,3 +1,8 @@
+2008-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
+	Don't encourage naming variables with "-flag".
+
 2008-05-30  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (update-elclist): Hide the warning when it does not apply,
--- a/lisp/emacs-lisp/checkdoc.el	Fri May 30 13:21:57 2008 +0000
+++ b/lisp/emacs-lisp/checkdoc.el	Fri May 30 14:51:48 2008 +0000
@@ -1636,25 +1636,28 @@
 		 (checkdoc-create-error
 		  "Flag variable doc strings should usually start: Non-nil means"
 		  s (marker-position e) t))
+             ;; Don't rename variable to "foo-flag".  This is unnecessary
+             ;; and such names often end up inconvenient when the variable
+             ;; is later expanded to non-boolean values. --Stef
 	     ;; If the doc string starts with "Non-nil means"
-	     (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+")
-		      (not (string-match "-flag$" (car fp))))
-		 (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 occurrences? "
-			 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)))))
+	     ;; (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+")
+	     ;;          (not (string-match "-flag$" (car fp))))
+	     ;;     (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 occurrences? "
+	     ;;    	 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