diff options
author | Richard M. Stallman <rms@gnu.org> | 2002-02-06 15:33:23 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2002-02-06 15:33:23 +0000 |
commit | 1c511be4d963f4882e9ff03d484be99260c355e4 (patch) | |
tree | 92c9edb624f232a6e978e3aa4976f896299a023d /lisp/emacs-lisp/checkdoc.el | |
parent | e711842f4bcb1e92555b7e80b33ddcda8b9f55f1 (diff) | |
download | emacs-1c511be4d963f4882e9ff03d484be99260c355e4.tar.gz emacs-1c511be4d963f4882e9ff03d484be99260c355e4.tar.bz2 emacs-1c511be4d963f4882e9ff03d484be99260c355e4.zip |
(checkdoc-this-string-valid-engine):
Replace foo-p as var name with foo-flag, not foo-p-flag.
Diffstat (limited to 'lisp/emacs-lisp/checkdoc.el')
-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)))))) ;; 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 |