Mercurial > hg > xemacs-beta
comparison lisp/lisp-mnt.el @ 4633:199ecf2503c8
Add standard section headers in preparation for 21.5.29.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Sat, 18 Apr 2009 03:18:27 +0900 |
parents | 866681a74bd9 |
children | 308d34e9f07d |
comparison
equal
deleted
inserted
replaced
4632:b93587f33338 | 4633:199ecf2503c8 |
---|---|
575 (if version (concat " version " version) "") | 575 (if version (concat " version " version) "") |
576 "\n\n") | 576 "\n\n") |
577 (message | 577 (message |
578 (substitute-command-keys "Type \\[mail-send] to send bug report.")))) | 578 (substitute-command-keys "Type \\[mail-send] to send bug report.")))) |
579 | 579 |
580 ;;; Entry point: insert boilerplate | |
581 | |
582 (defconst lm-standard-permission | |
583 "\n;; This file is part of XEmacs. | |
584 | |
585 ;; XEmacs is free software; you can redistribute it and/or modify it | |
586 ;; under the terms of the GNU General Public License as published by | |
587 ;; the Free Software Foundation; either version 2, or (at your option) | |
588 ;; any later version. | |
589 | |
590 ;; XEmacs is distributed in the hope that it will be useful, but | |
591 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
592 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
593 ;; General Public License for more details. | |
594 | |
595 ;; You should have received a copy of the GNU General Public License | |
596 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
597 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
598 ;; Boston, MA 02110-1301, USA.\n" | |
599 "Standard permissions notice for Lisp files that are part of XEmacs. | |
600 License version and FSF address are current as of 2009-04-01.") | |
601 | |
602 (defconst lm-change-log | |
603 "\n;;; Change Log: | |
604 | |
605 ;; %s %s <%s> | |
606 ;; | |
607 ;; * Created.\n" | |
608 "GNU standard change-log template.") | |
609 | |
610 (defconst lm-boilerplate | |
611 ";;; %s --- %s | |
612 | |
613 ;; Copyright (C) %s %s | |
614 | |
615 ;; Author: %s <%s> | |
616 ;; Created: %s | |
617 ;; Keywords: %s | |
618 %s | |
619 ;;; Synched up with: Not in GNU. | |
620 | |
621 ;;; Commentary: | |
622 | |
623 ;; PLACE YOUR COMMENTARY (DESCRIPTION OF THE LIBRARY'S CONTENTS AND FUNCTION) | |
624 ;; IN THIS SECTION. | |
625 %s | |
626 ;;; Code:\n\n" | |
627 "lisp-mnt standard boilerplate.") | |
628 | |
629 ;; #### Need to improve the interactive declaration. | |
630 ;; #### Need to check for existing boilerplate. | |
631 (defun lm-insert-boilerplate (file synopsis permission author email keys log) | |
632 "Insert lisp-mnt standard header and footer. | |
633 FILE is the file name of the library. | |
634 SYNOPSIS is a one line description of the file. | |
635 Total length of FILE and SYNOPSIS should be less than 70 characters. | |
636 PERMISSION, if non-nil, means to use a simple \"All Rights Reserved.\" | |
637 Otherwise, the standard boilerplate for XEmacs sources is inserted. | |
638 AUTHOR is the name of the author, defaulting to `user-full-name'. | |
639 EMAIL is the contact email address, defaulting to `user-mail-address'. | |
640 KEYS is a comma-separated list of finder keywords. | |
641 LOG, if non-nil, means to insert a Change Log section. | |
642 Otherwise, it will be omitted." | |
643 | |
644 (interactive "FName of file: \nsSynopsis: \nP\nsAuthor: \nsEmail: | |
645 sKeywords: \ncInsert a Change Log section? (y/n)") | |
646 | |
647 (save-restriction | |
648 (widen) | |
649 (let ((file (file-name-nondirectory file)) | |
650 (year (format-time-string "%Y")) | |
651 (date (format-time-string "%Y-%m-%d")) | |
652 (author (if (> (length author) 0) | |
653 author | |
654 user-full-name)) | |
655 (email (if (> (length email) 0) | |
656 email | |
657 user-mail-address)) | |
658 (log (eql (upcase log) ?Y))) | |
659 (goto-char (point-min)) | |
660 (insert (format lm-boilerplate | |
661 file synopsis | |
662 year author | |
663 author email | |
664 date | |
665 keys | |
666 (if permission | |
667 "\n;; All Rights Reserved.\n" | |
668 lm-standard-permission) | |
669 (if log | |
670 (format lm-change-log date author email) | |
671 ""))) | |
672 (goto-char (point-max)) | |
673 (insert (format "\n;;; %s ends here\n" file))))) | |
674 | |
580 (provide 'lisp-mnt) | 675 (provide 'lisp-mnt) |
581 | 676 |
582 ;;; lisp-mnt.el ends here | 677 ;;; lisp-mnt.el ends here |