;;; checkdoc.el --- check documentation strings for style requirements
;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Version: 0.6.2
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
:version "20.3")
(defcustom checkdoc-minor-mode-string " CDoc"
- "*String to display in mode line when Checkdoc mode is enabled; nil for none."
+ "String to display in mode line when Checkdoc mode is enabled; nil for none."
:type '(choice string (const :tag "None" nil))
:group 'checkdoc
:version "23.1")
(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
(checkdoc-output-mode)
(setq default-directory dir)
(goto-char (point-max))
- (insert "\n\n\C-l\n*** " label ": " check-type " V " checkdoc-version))))
+ (let ((inhibit-read-only t))
+ (insert "\n\n\C-l\n*** " label ": "
+ check-type " V " checkdoc-version)))))
(defun checkdoc-error (point msg)
"Store POINT and MSG as errors in the checkdoc diagnostic buffer."
": " msg)))
(with-current-buffer (get-buffer checkdoc-diagnostic-buffer)
(goto-char (point-max))
- (apply 'insert text))))
+ (let ((inhibit-read-only t))
+ (apply 'insert text)))))
(defun checkdoc-show-diagnostics ()
"Display the checkdoc diagnostic buffer in a temporary window."