changeset 4867:3349947f33e6

(forms--set-minor-mode): Rewrite so that describe-mode 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.
author Richard M. Stallman <rms@gnu.org>
date Thu, 21 Oct 1993 00:43:51 +0000
parents 56713fbab9ad
children 6de32c7b6045
files lisp/forms.el
diffstat 1 files changed, 11 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/forms.el	Wed Oct 20 18:06:27 1993 +0000
+++ b/lisp/forms.el	Thu Oct 21 00:43:51 1993 +0000
@@ -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.
 
@@ -266,10 +266,10 @@
 (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 @@
   ;; 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 @@
       (setq forms--field nil)))
    ))
 
-(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 @@
 	  (insert ret)))))
 
 ;;; forms.el ends here.
-