Build system spring-clean.
[skel] / skelrc
diff --git a/skelrc b/skelrc
index 011a9e1..b607b57 100644 (file)
--- a/skelrc
+++ b/skelrc
@@ -1,10 +1,21 @@
 ;;; -*-emacs-lisp-*-
 
+(defun skelrc-strip-trailing-whitespace (string)
+  (let ((i (1- (length string))))
+    (while (and (>= i 0) (= (char-syntax (aref string i)) ? ))
+      (setq i (1- i)))
+    (substring string 0 (1+ i))))
+
 (defun skelrc-banner (title &optional block)
   (let* ((start (skel-lookup 'block-start))
         (end (skel-lookup (if block 'block-banner-knob 'block-banner-end)))
         (barlen (- 77 (length (concat start end " ----- " title)))))
-    (concat start "----- " title " " (make-string barlen ?-) end)))
+    (skelrc-strip-trailing-whitespace (concat start
+                                             "----- "
+                                             title
+                                             " "
+                                             (make-string barlen ?-)
+                                             end))))
 
 (defvar skelrc-forced-major-mode 0)
 
 [[cont-comment]] it under the terms of the GNU General Public License as published by
 [[cont-comment]] the Free Software Foundation; either version 2 of the License, or
 [[cont-comment]] (at your option) any later version.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] [[Program-name]] is distributed in the hope that it will be useful,
 [[cont-comment]] but WITHOUT ANY WARRANTY; without even the implied warranty of
 [[cont-comment]] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 [[cont-comment]] GNU General Public License for more details.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] You should have received a copy of the GNU General Public License
 [[cont-comment]] along with [[program-name]]; if not, write to the Free Software Foundation,
 [[cont-comment]] Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.")
 [[cont-comment]] it under the terms of the GNU General Public License as published by
 [[cont-comment]] the Free Software Foundation; either version 2 of the License, or
 [[cont-comment]] (at your option) any later version.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] [[Program-name]] is distributed in the hope that it will be useful,
 [[cont-comment]] but WITHOUT ANY WARRANTY; without even the implied warranty of
 [[cont-comment]] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 [[cont-comment]] GNU General Public License for more details.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] You should have received a copy of the GNU General Public License
 [[cont-comment]] along with [[program-name]]; if not, write to the Free
 [[cont-comment]] Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 [[cont-comment]] it under the terms of the GNU Library General Public License as
 [[cont-comment]] published by the Free Software Foundation; either version 2 of the
 [[cont-comment]] License, or (at your option) any later version.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] [[Library-name]] is distributed in the hope that it will be useful,
 [[cont-comment]] but WITHOUT ANY WARRANTY; without even the implied warranty of
 [[cont-comment]] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 [[cont-comment]] GNU Library General Public License for more details.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] You should have received a copy of the GNU Library General Public
 [[cont-comment]] License along with [[library-name]]; if not, write to the Free
 [[cont-comment]] Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 [[cont-comment]] MA 02111-1307, USA.")
 
-(setq skelrc-bsd 
+(setq skelrc-bsd
 "[[cont-comment]] Copyright (c) [[year]] [[author]]
 [[cont-comment]] All rights reserved.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] Redistribution and use in source and binary forms, with or without
 [[cont-comment]] modification, are permitted provided that the following conditions are
 [[cont-comment]] met:
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] 1. Redistributions of source code must retain the above copyright
 [[cont-comment]]    notice, this list of conditions and the following disclaimer.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] 2, Redistributions in binary form must reproduce the above copyright
 [[cont-comment]]    notice, this list of conditions and the following disclaimer in the
 [[cont-comment]]    documentation and/or other materials provided with the distribution.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] 3. The name of the authors may not be used to endorse or promote
 [[cont-comment]]    products derived from this software without specific prior written
 [[cont-comment]]    permission.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
 [[cont-comment]] WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 [[cont-comment]] MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
 [[cont-comment]] STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 [[cont-comment]] ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 [[cont-comment]] POSSIBILITY OF SUCH DAMAGE.
-[[cont-comment]] 
+[[cont-comment]]
 [[cont-comment]] Instead of accepting the above terms, you may redistribute and/or modify
 [[cont-comment]] this software under the terms of either the GNU General Public License,
 [[cont-comment]] or the GNU Library General Public License, published by the Free
       (append
        '((emacs-mode . (skelrc-decode-major-mode))
         (year . (substring (current-time-string) 20 24))
-        (header . "[[licence]][[revisions]][[preamble]]")
+        (header . "[[licence]][[preamble]]")
         (basename . (skel-basename))
         (licence . "[[licence-banner]]\n[[cont-comment]]\n[[component]][[licence-text]][[block-end]]\n\n")
         (licence-banner . (skelrc-banner "Licensing notice" t))