aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1995-08-14 06:45:37 +0000
committerRichard M. Stallman1995-08-14 06:45:37 +0000
commit4fd3a710d01606ee4e20bf030ee84bd9cdd3cf94 (patch)
treef203507286e8811116e1fc0261e1bf95cafa5744 /lisp
parent945e196506572ea4a248b9b4751af9ee4e34e3a4 (diff)
downloademacs-4fd3a710d01606ee4e20bf030ee84bd9cdd3cf94.tar.gz
emacs-4fd3a710d01606ee4e20bf030ee84bd9cdd3cf94.zip
(forms-check-number-of-fields): New vbl.
(forms-mode): Don't issue warning if vbl says not to.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/forms.el20
1 files changed, 15 insertions, 5 deletions
diff --git a/lisp/forms.el b/lisp/forms.el
index 5f257671647..8f7947ce2a9 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -102,6 +102,11 @@
102;;; If no write access to the data file is 102;;; If no write access to the data file is
103;;; possible, view mode is enforced. 103;;; possible, view mode is enforced.
104;;; 104;;;
105;;; forms-check-number-of-fields [bool, default t]
106;;; If non-nil, a warning will be issued whenever
107;;; a record is found that does not have the number
108;;; of fields specified by `forms-number-of-fields'.
109;;;
105;;; forms-multi-line [string, default "^K"] 110;;; forms-multi-line [string, default "^K"]
106;;; If non-null the records of the data file may 111;;; If non-null the records of the data file may
107;;; contain fields that can span multiple lines in 112;;; contain fields that can span multiple lines in
@@ -282,10 +287,10 @@
282(provide 'forms) ;;; official 287(provide 'forms) ;;; official
283(provide 'forms-mode) ;;; for compatibility 288(provide 'forms-mode) ;;; for compatibility
284 289
285(defconst forms-version (substring "$Revision: 2.18 $" 11 -2) 290(defconst forms-version (substring "$Revision: 2.19 $" 11 -2)
286 "The version number of forms-mode (as string). The complete RCS id is: 291 "The version number of forms-mode (as string). The complete RCS id is:
287 292
288 $Id: forms.el,v 2.18 1995/06/18 14:43:23 jvromans Exp jvromans $") 293 $Id: forms.el,v 2.19 1995/07/08 13:16:54 jvromans Exp rms $")
289 294
290(defvar forms-mode-hooks nil 295(defvar forms-mode-hooks nil
291 "Hook functions to be run upon entering Forms mode.") 296 "Hook functions to be run upon entering Forms mode.")
@@ -303,6 +308,9 @@
303 308
304;;; Optional variables with default values. 309;;; Optional variables with default values.
305 310
311(defvar forms-check-number-of-fields t
312 "If non-nil, warn about records with wrong number of fields.")
313
306(defvar forms-field-sep "\t" 314(defvar forms-field-sep "\t"
307 "Field separator character (default TAB).") 315 "Field separator character (default TAB).")
308 316
@@ -1484,9 +1492,11 @@ Commands: Equivalent keys in read-only mode:
1484 ;; Verify the number of fields, extend forms--the-record-list if needed. 1492 ;; Verify the number of fields, extend forms--the-record-list if needed.
1485 (if (= (length forms--the-record-list) forms-number-of-fields) 1493 (if (= (length forms--the-record-list) forms-number-of-fields)
1486 nil 1494 nil
1487 (beep) 1495 (if (null forms-check-number-of-fields)
1488 (message "Warning: this record has %d fields instead of %d" 1496 nil
1489 (length forms--the-record-list) forms-number-of-fields) 1497 (beep)
1498 (message "Warning: this record has %d fields instead of %d"
1499 (length forms--the-record-list) forms-number-of-fields))
1490 (if (< (length forms--the-record-list) forms-number-of-fields) 1500 (if (< (length forms--the-record-list) forms-number-of-fields)
1491 (setq forms--the-record-list 1501 (setq forms--the-record-list
1492 (append forms--the-record-list 1502 (append forms--the-record-list