]> git.eshelyaron.com Git - emacs.git/commitdiff
(forms--set-minor-mode): Rewrite so that describe-mode
authorRichard M. Stallman <rms@gnu.org>
Thu, 21 Oct 1993 00:43:51 +0000 (00:43 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 21 Oct 1993 00:43:51 +0000 (00:43 +0000)
can parse the value of minor-mode-alist correctly.  The string
" View" is now dependent on the value of forms-read-only.

Documentation: `forms-forms-scroll' and `forms-forms-jump'
now default to nil.
`forms-new-record-filter' and `forms-modified-record-filter'
cannot be redefined as functions.
Commands and keymaps are changed.
Add function key defs.

(forms-version): Docstring includes full RCS id.
(forms-forms-scroll): Defaults to nil.
(forms-forms-jump): Defaults to nil.
(forms-mode-edit-map, forms-mode-ro-map): Additional keymaps
for edit mode and read-only mode.
(forms--new-record-filter, forms--modified-record-filter): Deleted.
(forms-mode): Docstring now includes the key bindings, since
both edit mode and read-only mode must be supported.
Changed `forms-new-record-filter' and `forms-modified-record-filter'
semantics: the variable must point to a function and may
not be defined as a function anymore.
Use three keymaps: `forms-mode-map' (C-c commands),
`forms-mode-edit-map' (normal mode) and `forms-mode-ro-map'
(read-only mode). The maps are not buffer local.
Corrected error message text.
Moved setting up write-file-hooks and revert-buffer-function
to function `forms--change-commands'.
(forms--process-format-list): Changed error messages to be more descriptive.
(forms--set-keymaps): Setup the three keymaps.
(forms--mode-commands): Use new command key bindings.
(forms--mode-commands1): New helper function for `forms--mode-commands'.
(forms--change-commands): Handle setup of
local-write-file-hooks and revert-buffer-function.
(forms--help): Show new command bindings.
(forms--show-record): Replaced `forms--modified-record-filter' by
`forms-modified-record-filter'.
(forms-jump-record): Changed error message.
(forms-toggle-read-only): New function.
(forms-view-mode, forms-edit-mode): Deleted.
(forms-insert-record): Replaced `forms--new-record-filter' by
`forms-new-record-filter'.
(forms-insert-record, forms-delete-record): Disallow in read-only mode.
(forms-prev-field): New function.

lisp/forms.el

index a2a296d78a125696452a63948782f93b9d74ca9b..e5ea04ea97d9fd6c726af3a1dbc3f91070d90843 100644 (file)
@@ -1,8 +1,8 @@
 ;;; forms.el -- Forms mode: edit a file as a form to fill in.
 ;;; Copyright (C) 1991, 1993 Free Software Foundation, Inc.
 
-;; Author: Johan Vromans <jv@mh.nl>
-;; Version: $Revision: 2.3 $
+;; Author: Johan Vromans <jv@nl.net>
+;; Version: $Revision: 2.4 $
 
 ;; This file is part of GNU Emacs.
 
 (provide 'forms)                       ;;; official
 (provide 'forms-mode)                  ;;; for compatibility
 
-(defconst forms-version (substring "$Revision: 2.3 $" 11 -2)
+(defconst forms-version (substring "$Revision: 2.4 $" 11 -2)
   "The version number of forms-mode (as string).  The complete RCS id is:
 
-  $Id: forms.el,v 2.3 1993/09/26 14:07:12 jv Exp $")
+  $Id: forms.el,v 2.4 1993/10/20 20:39:47 jv Exp $")
 
 (defvar forms-mode-hooks nil
   "Hook functions to be run upon entering Forms mode.")
@@ -568,9 +568,13 @@ Commands:                        Equivalent keys in read-only mode:
   ;; set the major mode indicator
   (setq major-mode 'forms-mode)
   (setq mode-name "Forms")
-  (make-local-variable 'minor-mode-alist) ; needed?
-  ;;(message "forms: proceeding setup (minor mode)...")
-  (forms--set-minor-mode)
+
+  ;; Since we aren't really implementing a minor mode, we hack the modeline
+  ;; directly to get the text " View " into forms-read-only form buffers.  For
+  ;; that reason, this variable must be buffer only.
+  (make-local-variable 'minor-mode-alist)
+  (setq minor-mode-alist (list (list 'forms-read-only " View")))
+
   ;;(message "forms: proceeding setup (keymaps)...")
   (forms--set-keymaps)
   ;;(message "forms: proceeding setup (commands)...")
@@ -1071,12 +1075,6 @@ Commands:                        Equivalent keys in read-only mode:
       (setq forms--field nil)))
    ))
 \f
-(defun forms--set-minor-mode ()
-  (setq minor-mode-alist
-       (if forms-read-only
-           " View"
-         nil)))
-
 (defun forms--set-keymaps ()
   "Set the keymaps used in this mode."
 
@@ -1720,4 +1718,3 @@ Usage: (setq forms-number-of-fields
          (insert ret)))))
 
 ;;; forms.el ends here.
-