Mercurial > emacs
comparison lisp/forms.el @ 3827:4089cf0e3f06
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 19 Jun 1993 00:08:24 +0000 |
parents | 994bb6dc9249 |
children | c9f18a7140f9 |
comparison
equal
deleted
inserted
replaced
3826:647bef18618f | 3827:4089cf0e3f06 |
---|---|
199 ;;; s forms-search | 199 ;;; s forms-search |
200 ;;; v forms-view-mode | 200 ;;; v forms-view-mode |
201 ;;; x forms-exit-no-save | 201 ;;; x forms-exit-no-save |
202 ;;; DEL forms-prev-record | 202 ;;; DEL forms-prev-record |
203 ;;; | 203 ;;; |
204 ;;; Standard functions scroll-up, scroll-down, beginning-of-buffer and | 204 ;;; The bindings of standard functions scroll-up, scroll-down, |
205 ;;; end-of-buffer are wrapped with re-definitions, which map them to | 205 ;;; beginning-of-buffer and end-of-buffer are locally replaced with |
206 ;;; next/prev record and first/last record. | 206 ;;; forms mode functions next/prev record and first/last |
207 ;;; Buffer-local variables forms-forms-scroll and forms-forms-jump | 207 ;;; record. Buffer-local variables forms-forms-scroll and |
208 ;;; may be used to control these redefinitions. | 208 ;;; forms-forms-jump (default: t) may be set to nil to inhibit |
209 ;;; | 209 ;;; rebinding. |
210 ;;; Function save-buffer is also wrapped to perform a sensible action. | 210 ;;; |
211 ;;; A revert-file-hook is defined to revert a forms to original. | 211 ;;; A local-write-file hook is defined to save the actual data file |
212 ;;; instead of the buffer data, a revert-file-hook is defined to | |
213 ;;; revert a forms to original. | |
212 ;;; | 214 ;;; |
213 ;;; For convenience, TAB is always bound to forms-next-field, so you | 215 ;;; For convenience, TAB is always bound to forms-next-field, so you |
214 ;;; don't need the C-c prefix for this command. | 216 ;;; don't need the C-c prefix for this command. |
215 | 217 |
216 ;;; Code: | 218 ;;; Code: |
432 ;; Hence we'll leave it global. | 434 ;; Hence we'll leave it global. |
433 ;;(make-local-variable 'forms-mode-map) | 435 ;;(make-local-variable 'forms-mode-map) |
434 (if forms-mode-map ; already defined | 436 (if forms-mode-map ; already defined |
435 nil | 437 nil |
436 (setq forms-mode-map (make-keymap)) | 438 (setq forms-mode-map (make-keymap)) |
437 (forms--mode-commands forms-mode-map) | 439 (forms--mode-commands forms-mode-map)) |
438 (forms--change-commands)) | |
439 | 440 |
440 ;; find the data file | 441 ;; find the data file |
441 (setq forms--file-buffer (find-file-noselect forms-file)) | 442 (setq forms--file-buffer (find-file-noselect forms-file)) |
442 | 443 |
443 ;; count the number of records, and set see if it may be modified | 444 ;; count the number of records, and set see if it may be modified |
455 (setq major-mode 'forms-mode) | 456 (setq major-mode 'forms-mode) |
456 (setq mode-name "Forms") | 457 (setq mode-name "Forms") |
457 (make-local-variable 'minor-mode-alist) ; needed? | 458 (make-local-variable 'minor-mode-alist) ; needed? |
458 (forms--set-minor-mode) | 459 (forms--set-minor-mode) |
459 (forms--set-keymaps) | 460 (forms--set-keymaps) |
461 (make-local-variable 'local-write-file-hooks) | |
462 (forms--change-commands) | |
460 | 463 |
461 (set-buffer-modified-p nil) | 464 (set-buffer-modified-p nil) |
462 | 465 |
463 ;; We have our own revert function - use it | 466 ;; We have our own revert function - use it |
464 (make-local-variable 'revert-buffer-function) | 467 (make-local-variable 'revert-buffer-function) |