3 (defun skelrc-banner (title &optional block)
4 (let* ((start (skel-lookup 'block-start))
5 (end (skel-lookup (if block 'block-banner-knob 'block-banner-end)))
6 (barlen (- 77 (length (concat start end " ----- " title)))))
7 (concat start "----- " title " " (make-string barlen ?-) end)))
9 (defvar skelrc-forced-major-mode 0)
11 (defun skelrc-force-mode (new-mode &optional priority)
12 (or priority (setq priority 1))
13 (if (> priority skelrc-forced-major-mode)
15 (or (eq new-mode major-mode)
16 (let ((old-skel-alist skel-alist))
18 (make-variable-buffer-local 'skel-alist)
19 (setq skel-alist old-skel-alist)))
20 (make-variable-buffer-local 'skelrc-forced-major-mode)
21 (setq skelrc-forced-major-mode priority))))
23 (defun skelrc-decode-major-mode ()
24 (let* ((name (symbol-name major-mode))
25 (endind (string-match "-mode$" name)))
26 (if endind (substring name 0 endind)
30 "[[cont-comment]] This file is part of [[full-title]].
32 [[cont-comment]] [[program]] is free software; you can redistribute it and/or modify
33 [[cont-comment]] it under the terms of the GNU General Public License as published by
34 [[cont-comment]] the Free Software Foundation; either version 2 of the License, or
35 [[cont-comment]] (at your option) any later version.
37 [[cont-comment]] [[program]] is distributed in the hope that it will be useful,
38 [[cont-comment]] but WITHOUT ANY WARRANTY; without even the implied warranty of
39 [[cont-comment]] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 [[cont-comment]] GNU General Public License for more details.
42 [[cont-comment]] You should have received a copy of the GNU General Public License
43 [[cont-comment]] along with [[program]]; if not, write to the Free Software Foundation,
44 [[cont-comment]] Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.")
47 "[[cont-comment]] This file is part of [[full-title]].
49 [[cont-comment]] [[program]] is free software; you can redistribute it and/or modify
50 [[cont-comment]] it under the terms of the GNU Library General Public License as
51 [[cont-comment]] published by the Free Software Foundation; either version 2 of the
52 [[cont-comment]] License, or (at your option) any later version.
54 [[cont-comment]] [[program]] is distributed in the hope that it will be useful,
55 [[cont-comment]] but WITHOUT ANY WARRANTY; without even the implied warranty of
56 [[cont-comment]] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 [[cont-comment]] GNU Library General Public License for more details.
59 [[cont-comment]] You should have received a copy of the GNU Library General Public
60 [[cont-comment]] License along with [[program]]; if not, write to the Free Software
61 [[cont-comment]] Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.")
63 (defun skel-basename ()
64 (file-name-sans-extension (file-name-nondirectory buffer-file-name)))
68 '((emacs-mode . (skelrc-decode-major-mode))
69 (year . (substring (current-time-string) 20 24))
70 (header . "[[licence]][[revisions]][[preamble]]")
71 (basename . (skel-basename))
72 (licence . "[[licence-banner]]\n[[cont-comment]]\n[[licence-text]][[block-end]]\n\n")
73 (licence-banner . (skelrc-banner "Licensing notice" t))
74 (licence-text . "[[gpl]]")
77 (revisions . "[[revision-banner]]\n[[cont-comment]]\n[[cont-comment]] $Log$[[block-end]]\n\n")
78 (revision-banner . (skelrc-banner "Revision history" t))
80 (trailer . "[[tag-line]][[postamble]]\n")
82 (tag-line . (skelrc-banner "That's all, folks"))
83 (block-start . (skel-lookup 'new-comment))
84 (block-banner-knob . "")
85 (block-banner-end . "")