aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-10-21 00:43:51 +0000
committerRichard M. Stallman1993-10-21 00:43:51 +0000
commit891f0daae1904635e7004c749c876ab949e1a113 (patch)
tree18ef33aa070816f67d8263dcbc87f96727ea8804
parentb0fd51982e4bfd2991c99665830125b965266f85 (diff)
downloademacs-891f0daae1904635e7004c749c876ab949e1a113.tar.gz
emacs-891f0daae1904635e7004c749c876ab949e1a113.zip
(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.
-rw-r--r--lisp/forms.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/forms.el b/lisp/forms.el
index a2a296d78a1..e5ea04ea97d 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -1,8 +1,8 @@
1;;; forms.el -- Forms mode: edit a file as a form to fill in. 1;;; forms.el -- Forms mode: edit a file as a form to fill in.
2;;; Copyright (C) 1991, 1993 Free Software Foundation, Inc. 2;;; Copyright (C) 1991, 1993 Free Software Foundation, Inc.
3 3
4;; Author: Johan Vromans <jv@mh.nl> 4;; Author: Johan Vromans <jv@nl.net>
5;; Version: $Revision: 2.3 $ 5;; Version: $Revision: 2.4 $
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -266,10 +266,10 @@
266(provide 'forms) ;;; official 266(provide 'forms) ;;; official
267(provide 'forms-mode) ;;; for compatibility 267(provide 'forms-mode) ;;; for compatibility
268 268
269(defconst forms-version (substring "$Revision: 2.3 $" 11 -2) 269(defconst forms-version (substring "$Revision: 2.4 $" 11 -2)
270 "The version number of forms-mode (as string). The complete RCS id is: 270 "The version number of forms-mode (as string). The complete RCS id is:
271 271
272 $Id: forms.el,v 2.3 1993/09/26 14:07:12 jv Exp $") 272 $Id: forms.el,v 2.4 1993/10/20 20:39:47 jv Exp $")
273 273
274(defvar forms-mode-hooks nil 274(defvar forms-mode-hooks nil
275 "Hook functions to be run upon entering Forms mode.") 275 "Hook functions to be run upon entering Forms mode.")
@@ -568,9 +568,13 @@ Commands: Equivalent keys in read-only mode:
568 ;; set the major mode indicator 568 ;; set the major mode indicator
569 (setq major-mode 'forms-mode) 569 (setq major-mode 'forms-mode)
570 (setq mode-name "Forms") 570 (setq mode-name "Forms")
571 (make-local-variable 'minor-mode-alist) ; needed? 571
572 ;;(message "forms: proceeding setup (minor mode)...") 572 ;; Since we aren't really implementing a minor mode, we hack the modeline
573 (forms--set-minor-mode) 573 ;; directly to get the text " View " into forms-read-only form buffers. For
574 ;; that reason, this variable must be buffer only.
575 (make-local-variable 'minor-mode-alist)
576 (setq minor-mode-alist (list (list 'forms-read-only " View")))
577
574 ;;(message "forms: proceeding setup (keymaps)...") 578 ;;(message "forms: proceeding setup (keymaps)...")
575 (forms--set-keymaps) 579 (forms--set-keymaps)
576 ;;(message "forms: proceeding setup (commands)...") 580 ;;(message "forms: proceeding setup (commands)...")
@@ -1071,12 +1075,6 @@ Commands: Equivalent keys in read-only mode:
1071 (setq forms--field nil))) 1075 (setq forms--field nil)))
1072 )) 1076 ))
1073 1077
1074(defun forms--set-minor-mode ()
1075 (setq minor-mode-alist
1076 (if forms-read-only
1077 " View"
1078 nil)))
1079
1080(defun forms--set-keymaps () 1078(defun forms--set-keymaps ()
1081 "Set the keymaps used in this mode." 1079 "Set the keymaps used in this mode."
1082 1080
@@ -1720,4 +1718,3 @@ Usage: (setq forms-number-of-fields
1720 (insert ret))))) 1718 (insert ret)))))
1721 1719
1722;;; forms.el ends here. 1720;;; forms.el ends here.
1723