(rmail-retry-failure): Bind inhibit-read-only.
[bpt/emacs.git] / lisp / forms.el
index 8f7947c..9466077 100644 (file)
@@ -1,7 +1,8 @@
-;;; forms.el -- Forms mode: edit a file as a form to fill in.
-;;; Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+;;; forms.el --- Forms mode: edit a file as a form to fill in
 
-;; Author: Johan Vromans <jv@nl.net>
+;; Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+
+;; Author: Johan Vromans <jvromans@squirrel.nl>
 
 ;; This file is part of GNU Emacs.
 
@@ -39,7 +40,7 @@
 ;;; Forms mode means visiting a data file which is supposed to consist
 ;;; of records each containing a number of fields.  The records are
 ;;; separated by a newline, the fields are separated by a user-defined
-;;; field separater (default: TAB).
+;;; field separator (default: TAB).
 ;;; When shown, a record is transferred to an Emacs buffer and
 ;;; presented using a user-defined form.  One record is shown at a
 ;;; time.
@@ -53,7 +54,7 @@
 ;;; will be buried, for it is never accessed directly.
 ;;;
 ;;; Forms mode is invoked using M-x forms-find-file control-file .
-;;; Alternativily `forms-find-file-other-window' can be used.
+;;; Alternatively `forms-find-file-other-window' can be used.
 ;;;
 ;;; You may also visit the control file, and switch to forms mode by hand
 ;;; with M-x forms-mode .
 ;;;                    the form.
 ;;;                    This variable denotes the separator character
 ;;;                    to be used for this purpose.  Upon display, all
-;;;                    occurrencies of this character are translated
+;;;                    occurrences of this character are translated
 ;;;                    to newlines.  Upon storage they are translated
 ;;;                    back to the separator character.
 ;;;
 ;;; is left.  The contents of the form are parsed using information
 ;;; obtained from `forms-format-list', and the fields which are
 ;;; deduced from the form are modified.  Fields not shown on the forms
-;;; retain their origional values.  The newly formed record then
+;;; retain their original values.  The newly formed record then
 ;;; replaces the contents of the old record in `forms--file-buffer'.
 ;;; A parse routine `forms--parser' is built upon startup to parse
 ;;; the records.
 (provide 'forms)                       ;;; official
 (provide 'forms-mode)                  ;;; for compatibility
 
-(defconst forms-version (substring "$Revision: 2.19 $" 11 -2)
+(defconst forms-version (substring "$Revision: 2.23 $" 11 -2)
   "The version number of forms-mode (as string).  The complete RCS id is:
 
-  $Id: forms.el,v 2.19 1995/07/08 13:16:54 jvromans Exp rms $")
+  $Id: forms.el,v 2.23 1995/11/16 20:04:57 jvromans Exp kwzh $")
 
 (defvar forms-mode-hooks nil
   "Hook functions to be run upon entering Forms mode.")
 ;;; Optional variables with default values.
 
 (defvar forms-check-number-of-fields t
-  "If non-nil, warn about records with wrong number of fields.")
+  "*If non-nil, warn about records with wrong number of fields.")
 
 (defvar forms-field-sep "\t"
   "Field separator character (default TAB).")
@@ -700,7 +701,7 @@ Commands:                        Equivalent keys in read-only mode:
   ;; of the fields on the display. This array is used by 
   ;; `forms--parser-using-text-properties' to extract the fields data
   ;; from the form on the screen.
-  ;; Upon completion, `forms-format-list' is garanteed correct, so
+  ;; Upon completion, `forms-format-list' is guaranteed correct, so
   ;; `forms--make-format' and `forms--make-parser' do not need to perform
   ;; any checks.
 
@@ -1092,9 +1093,9 @@ Commands:                        Equivalent keys in read-only mode:
        (if (setq there 
                  (next-single-property-change here 'read-only))
            (aset forms--recordv (aref forms--elements i)
-                 (buffer-substring here there))
+                 (buffer-substring-no-properties here there))
          (aset forms--recordv (aref forms--elements i)
-               (buffer-substring here (point-max)))))
+               (buffer-substring-no-properties here (point-max)))))
       (setq i (1+ i)))))
 
 (defun forms--make-parser-elt (el)
@@ -1116,7 +1117,7 @@ Commands:                        Equivalent keys in read-only mode:
   ;;     (setq here (point))
   ;;     (if (not (search-forward "\nmore text: " nil t nil))
   ;;       (error "Parse error: cannot find \"\\nmore text: \""))
-  ;;     (aset forms--recordv 5 (buffer-substring here (- (point) 12)))
+  ;;     (aset forms--recordv 5 (buffer-substring-no-properties here (- (point) 12)))
   ;;
   ;;    ;;  (tocol 40)
   ;;   (let ((forms--dyntext (car-safe forms--dynamic-text)))
@@ -1126,7 +1127,7 @@ Commands:                        Equivalent keys in read-only mode:
   ;;     (setq forms--dynamic-text (cdr-safe forms--dynamic-text)))
   ;;     ... 
   ;;     ;; final flush (due to terminator sentinel, see below)
-  ;;   (aset forms--recordv 7 (buffer-substring (point) (point-max)))
+  ;;   (aset forms--recordv 7 (buffer-substring-no-properties (point) (point-max)))
 
   (cond
    ((stringp el)
@@ -1136,7 +1137,7 @@ Commands:                        Equivalent keys in read-only mode:
                (if (not (search-forward (, el) nil t nil))
                    (error "Parse error: cannot find \"%s\"" (, el)))
                (aset forms--recordv (, (1- forms--field))
-                     (buffer-substring here
+                     (buffer-substring-no-properties here
                                        (- (point) (, (length el)))))))
          (` ((if (not (looking-at (, (regexp-quote el))))
                  (error "Parse error: not looking at \"%s\"" (, el)))
@@ -1152,7 +1153,7 @@ Commands:                        Equivalent keys in read-only mode:
    ((null el)
     (if forms--field
        (` ((aset forms--recordv (, (1- forms--field))
-                 (buffer-substring (point) (point-max)))))))
+                 (buffer-substring-no-properties (point) (point-max)))))))
    ((listp el)
     (prog1
        (if forms--field
@@ -1161,7 +1162,7 @@ Commands:                        Equivalent keys in read-only mode:
                  (if (not (search-forward forms--dyntext nil t nil))
                      (error "Parse error: cannot find \"%s\"" forms--dyntext))
                  (aset forms--recordv (, (1- forms--field))
-                       (buffer-substring here
+                       (buffer-substring-no-properties here
                                          (- (point) (length forms--dyntext)))))))
          (` ((let ((forms--dyntext (aref forms--dyntexts (, forms--dyntext))))
                (if (not (looking-at (regexp-quote forms--dyntext)))
@@ -1461,7 +1462,7 @@ Commands:                        Equivalent keys in read-only mode:
   (let ((here (point)))
     (prog2
      (end-of-line)
-     (buffer-substring here (point))
+     (buffer-substring-no-properties here (point))
      (goto-char here))))
 
 (defun forms--show-record (the-record)
@@ -1705,7 +1706,7 @@ As a side effect: re-calculates the number of records in the data file."
 (defun forms-toggle-read-only (arg)
   "Toggles read-only mode of a forms mode buffer.
 With an argument, enables read-only mode if the argument is positive.
-Otherwise enables edit mode if the visited file is writeable."
+Otherwise enables edit mode if the visited file is writable."
 
   (interactive "P")
 
@@ -1983,7 +1984,7 @@ Calls `forms-write-file-filter' before writing out the data."
 (defun forms-enumerate (the-fields)
   "Take a quoted list of symbols, and set their values to sequential numbers.
 The first symbol gets number 1, the second 2 and so on.
-It returns the higest number.
+It returns the highest number.
 
 Usage: (setq forms-number-of-fields
              (forms-enumerate