1 ;;; forms-d2.el --- demo forms-mode
3 ;; Author: Johan Vromans <jvromans@squirrel.nl>
6 ;; This sample forms exploit most of the features of forms mode.
8 ;; Set the name of the data file.
9 (setq forms-file
"forms-d2.dat")
11 ;; Use 'forms-enumerate' to set field names and number thereof.
12 (setq forms-number-of-fields
18 arch-shortname
; ... ... on
26 ;; The following functions are used by this form for layout purposes.
28 (defun arch-tocol (target &optional fill
)
29 "Produces a string to skip to column TARGET. Prepends newline if needed.
30 The optional FILL should be a character, used to fill to the column."
33 (if (< target
(current-column))
34 (concat "\n" (make-string target fill
))
35 (make-string (- target
(current-column)) fill
)))
37 (defun arch-rj (target field
&optional fill
)
38 "Produces a string to skip to column TARGET minus the width of field FIELD.
39 Prepends newline if needed. The optional FILL should be a character,
40 used to fill to the column."
41 (arch-tocol (- target
(length (nth field forms-fields
))) fill
))
45 (defun arch-new-record-filter (the-record)
46 "Form a new record with some defaults."
47 (aset the-record arch-from
(user-full-name))
48 (aset the-record arch-date
(current-time-string))
49 the-record
; return it
51 (setq forms-new-record-filter
'arch-new-record-filter
)
54 (setq forms-format-list
56 "====== Public Domain Software Archive ======\n\n"
60 "Article: " arch-newsgroup
69 "Submitted by: " arch-from
73 "Keywords: " arch-keywords
76 "\n\n====== Remarks ======\n\n"