diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-30 14:51:48 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-30 14:51:48 +0000 |
commit | 145b63776b1beebd20faa429c278e2b7d9d0e260 (patch) | |
tree | 5e8dd1f5504d7201119c6d697b4418d2b202501d /lisp/emacs-lisp | |
parent | a266686a02fa5068dbf172fbef6726d28a47bfbe (diff) | |
download | emacs-145b63776b1beebd20faa429c278e2b7d9d0e260.tar.gz emacs-145b63776b1beebd20faa429c278e2b7d9d0e260.tar.bz2 emacs-145b63776b1beebd20faa429c278e2b7d9d0e260.zip |
(checkdoc-this-string-valid-engine):
Don't encourage naming variables with "-flag".
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 8da93b7a327..de23111754a 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1636,25 +1636,28 @@ function,command,variable,option or symbol." ms1)))))) (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 |