changeset 12847:61961ca01260

(forms-check-number-of-fields): New vbl. (forms-mode): Don't issue warning if vbl says not to.
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Aug 1995 06:45:37 +0000
parents fc74ffbce5a9
children 84beb7f8321f
files lisp/forms.el
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/forms.el	Sun Aug 13 16:48:13 1995 +0000
+++ b/lisp/forms.el	Mon Aug 14 06:45:37 1995 +0000
@@ -102,6 +102,11 @@
 ;;;			If no write access to the data file is
 ;;;			possible, view mode is enforced. 
 ;;;
+;;;     forms-check-number-of-fields            [bool, default t]
+;;;                   If non-nil, a warning will be issued whenever
+;;;                   a record is found that does not have the number
+;;;                   of fields specified by `forms-number-of-fields'.
+;;;
 ;;;	forms-multi-line			[string, default "^K"]
 ;;;			If non-null the records of the data file may
 ;;;			contain fields that can span multiple lines in
@@ -282,10 +287,10 @@
 (provide 'forms)			;;; official
 (provide 'forms-mode)			;;; for compatibility
 
-(defconst forms-version (substring "$Revision: 2.18 $" 11 -2)
+(defconst forms-version (substring "$Revision: 2.19 $" 11 -2)
   "The version number of forms-mode (as string).  The complete RCS id is:
 
-  $Id: forms.el,v 2.18 1995/06/18 14:43:23 jvromans Exp jvromans $")
+  $Id: forms.el,v 2.19 1995/07/08 13:16:54 jvromans Exp rms $")
 
 (defvar forms-mode-hooks nil
   "Hook functions to be run upon entering Forms mode.")
@@ -303,6 +308,9 @@
 
 ;;; Optional variables with default values.
 
+(defvar forms-check-number-of-fields t
+  "If non-nil, warn about records with wrong number of fields.")
+
 (defvar forms-field-sep "\t"
   "Field separator character (default TAB).")
 
@@ -1484,9 +1492,11 @@
   ;; Verify the number of fields, extend forms--the-record-list if needed.
   (if (= (length forms--the-record-list) forms-number-of-fields)
       nil
-    (beep)
-    (message "Warning: this record has %d fields instead of %d"
-	     (length forms--the-record-list) forms-number-of-fields)
+    (if (null forms-check-number-of-fields)
+	nil
+      (beep)
+      (message "Warning: this record has %d fields instead of %d"
+	       (length forms--the-record-list) forms-number-of-fields))
     (if (< (length forms--the-record-list) forms-number-of-fields)
 	(setq forms--the-record-list 
 	      (append forms--the-record-list