1 ;;; forms-d2.el --- demo forms-mode
3 ;; Author: Johan Vromans
6 ;;; Synched up with: FSF 19.34.
8 ;; This sample forms exploit most of the features of forms mode.
10 ;; Set the name of the data file.
11 (setq forms-file "forms-d2.dat")
13 ;; Use 'forms-enumerate' to set field names and number thereof.
14 (setq forms-number-of-fields
20 arch-shortname ; ... ... on
28 ;; The following functions are used by this form for layout purposes.
30 (defun arch-tocol (target &optional fill)
31 "Produces a string to skip to column TARGET. Prepends newline if needed.
32 The optional FILL should be a character, used to fill to the column."
35 (if (< target (current-column))
36 (concat "\n" (make-string target fill))
37 (make-string (- target (current-column)) fill)))
39 (defun arch-rj (target field &optional fill)
40 "Produces a string to skip to column TARGET minus the width of field FIELD.
41 Prepends newline if needed. The optional FILL should be a character,
42 used to fill to the column."
43 (arch-tocol (- target (length (nth field forms-fields))) fill))
47 (defun arch-new-record-filter (the-record)
48 "Form a new record with some defaults."
49 (aset the-record arch-from (user-full-name))
50 (aset the-record arch-date (current-time-string))
51 the-record ; return it
53 (setq forms-new-record-filter 'arch-new-record-filter)
56 (setq forms-format-list
58 "====== Public Domain Software Archive ======\n\n"
62 "Article: " arch-newsgroup
71 "Submitted by: " arch-from
75 "Keywords: " arch-keywords
78 "\n\n====== Remarks ======\n\n"