comparison lisp/emacs-lisp/checkdoc.el @ 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 be541feb06cc
children be966e885dcc
comparison
equal deleted inserted replaced
43132:0dd2ebecd217 43133:c929176c272b
1590 "Flag variable doc strings should usually start: Non-nil means" 1590 "Flag variable doc strings should usually start: Non-nil means"
1591 s (marker-position e) t)) 1591 s (marker-position e) t))
1592 ;; If the doc string starts with "Non-nil means" 1592 ;; If the doc string starts with "Non-nil means"
1593 (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+") 1593 (if (and (looking-at "\"\\*?Non-nil\\s-+means\\s-+")
1594 (not (string-match "-flag$" (car fp)))) 1594 (not (string-match "-flag$" (car fp))))
1595 (if (checkdoc-y-or-n-p 1595 (let ((newname
1596 (format 1596 (if (string-match "-p$" (car fp))
1597 "Rename to %s and Query-Replace all occurances? " 1597 (concat (substring (car fp) 0 -2) "-flag")
1598 (concat (car fp) "-flag"))) 1598 (concat (car fp) "-flag"))))
1599 (progn 1599 (if (checkdoc-y-or-n-p
1600 (beginning-of-defun) 1600 (format
1601 (query-replace-regexp 1601 "Rename to %s and Query-Replace all occurances? "
1602 (concat "\\<" (regexp-quote (car fp)) "\\>") 1602 newname))
1603 (concat (car fp) "-flag"))) 1603 (progn
1604 (checkdoc-create-error 1604 (beginning-of-defun)
1605 "Flag variable names should normally end in `-flag'" s 1605 (query-replace-regexp
1606 (marker-position e)))) 1606 (concat "\\<" (regexp-quote (car fp)) "\\>")
1607 newname))
1608 (checkdoc-create-error
1609 "Flag variable names should normally end in `-flag'" s
1610 (marker-position e)))))
1607 ;; Done with variables 1611 ;; Done with variables
1608 )) 1612 ))
1609 (t 1613 (t
1610 ;; This if we are in a function definition 1614 ;; This if we are in a function definition
1611 (or 1615 (or