annotate lisp/lisp-mnt.el @ 5043:d0c14ea98592

various frame-geometry fixes -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-02-15 Ben Wing <ben@xemacs.org> * EmacsFrame.c: * EmacsFrame.c (EmacsFrameResize): * console-msw-impl.h: * console-msw-impl.h (struct mswindows_frame): * console-msw-impl.h (FRAME_MSWINDOWS_TARGET_RECT): * device-tty.c: * device-tty.c (tty_asynch_device_change): * event-msw.c: * event-msw.c (mswindows_wnd_proc): * faces.c (Fface_list): * faces.h: * frame-gtk.c: * frame-gtk.c (gtk_set_initial_frame_size): * frame-gtk.c (gtk_set_frame_size): * frame-msw.c: * frame-msw.c (mswindows_init_frame_1): * frame-msw.c (mswindows_set_frame_size): * frame-msw.c (mswindows_size_frame_internal): * frame-msw.c (msprinter_init_frame_3): * frame.c: * frame.c (enum): * frame.c (Fmake_frame): * frame.c (adjust_frame_size): * frame.c (store_minibuf_frame_prop): * frame.c (Fframe_property): * frame.c (Fframe_properties): * frame.c (Fframe_displayable_pixel_height): * frame.c (Fframe_displayable_pixel_width): * frame.c (internal_set_frame_size): * frame.c (Fset_frame_height): * frame.c (Fset_frame_pixel_height): * frame.c (Fset_frame_displayable_pixel_height): * frame.c (Fset_frame_width): * frame.c (Fset_frame_pixel_width): * frame.c (Fset_frame_displayable_pixel_width): * frame.c (Fset_frame_size): * frame.c (Fset_frame_pixel_size): * frame.c (Fset_frame_displayable_pixel_size): * frame.c (frame_conversion_internal_1): * frame.c (get_frame_displayable_pixel_size): * frame.c (change_frame_size_1): * frame.c (change_frame_size): * frame.c (generate_title_string): * frame.h: * gtk-xemacs.c: * gtk-xemacs.c (gtk_xemacs_size_request): * gtk-xemacs.c (gtk_xemacs_size_allocate): * gtk-xemacs.c (gtk_xemacs_paint): * gutter.c: * gutter.c (update_gutter_geometry): * redisplay.c (end_hold_frame_size_changes): * redisplay.c (redisplay_frame): * toolbar.c: * toolbar.c (update_frame_toolbars_geometry): * window.c: * window.c (frame_pixsize_valid_p): * window.c (check_frame_size): Various fixes to frame geometry to make it a bit easier to understand and fix some bugs. 1. IMPORTANT: Some renamings. Will need to be applied carefully to the carbon repository, in the following order: -- pixel_to_char_size -> pixel_to_frame_unit_size -- char_to_pixel_size -> frame_unit_to_pixel_size -- pixel_to_real_char_size -> pixel_to_char_size -- char_to_real_pixel_size -> char_to_pixel_size -- Reverse second and third arguments of change_frame_size() and change_frame_size_1() to try to make functions consistent in putting width before height. -- Eliminate old round_size_to_char, because it didn't really do anything differently from round_size_to_real_char() -- round_size_to_real_char -> round_size_to_char; any places that called the old round_size_to_char should just call the new one. 2. IMPORTANT FOR CARBON: The set_frame_size() method is now passed sizes in "frame units", like all other frame-sizing functions, rather than some hacked-up combination of char-cell units and total pixel size. This only affects window systems that use "pixelated geometry", and I'm not sure if Carbon is one of them. MS Windows is pixelated, X and GTK are not. For pixelated-geometry systems, the size in set_frame_size() is in displayable pixels rather than total pixels and needs to be converted appropriately; take a look at the changes made to mswindows_set_frame_size() method if necessary. 3. Add a big long comment in frame.c describing how frame geometry works. 4. Remove MS Windows-specific character height and width fields, duplicative and unused. 5. frame-displayable-pixel-* and set-frame-displayable-pixel-* didn't use to work on MS Windows, but they do now. 6. In general, clean up the handling of "pixelated geometry" so that fewer functions have to worry about this. This is really an abomination that should be removed entirely but that will have to happen later. Fix some buggy code in frame_conversion_internal() that happened to "work" because it was countered by oppositely buggy code in change_frame_size(). 7. Clean up some frame-size code in toolbar.c and use functions already provided in frame.c instead of rolling its own. 8. Fix check_frame_size() in window.c, which formerly didn't take pixelated geometry into account.
author Ben Wing <ben@xemacs.org>
date Mon, 15 Feb 2010 22:14:11 -0600
parents 199ecf2503c8
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Maintainer: Eric S. Raymond <esr@snark.thyrsus.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Created: 14 Jul 1992
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Keywords: docs, maint
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 ;; X-Modified-by: Bob Weiner <weiner@beopen.com>, 4/14/95, to support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; InfoDock headers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 ;; X-Bogus-Bureaucratic-Cruft: Gruad will get you if you don't watch out!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 ;; along with XEmacs; see the file COPYING. If not, write to the Free
4630
64e5e393f15d Update FSF address in permissions notice.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 776
diff changeset
27 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
64e5e393f15d Update FSF address in permissions notice.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 776
diff changeset
28 ;; Boston, MA 02110-1301, USA.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 ;;; Synched up with: FSF 20.2.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;; This minor mode adds some services to Emacs-Lisp editing mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 ;;
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
36 ;; It provides knowledge about the header conventions for library packages.
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
37 ;; `lm-synopsis' supports generating synopses from a library directory.
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
38 ;; `lm-verify' can be used to check for missing headers in library files.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 ;;
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
40 ;; `lm-report-bug' automatically addresses bug mail to a package's
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 ;; maintainer or author.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
43 ;; This file can be loaded by your lisp-mode-hook with `(require 'lisp-mnt)'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 ;; This file is an example of the header conventions. Note the following
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 ;; features:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 ;; * Header line --- makes it possible to extract a one-line summary of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 ;; the package's uses automatically for use in library synopses, KWIC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 ;; indexes and the like.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 ;; Format is three semicolons, followed by the filename, followed by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 ;; three dashes, followed by the summary. All fields space-separated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 ;; * Author line --- contains the name and net address of at least
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 ;; the principal author.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ;; If there are multiple authors, they should be listed on continuation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 ;; lines led by ;;<TAB><TAB> (or multiple blanks), like this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 ;; ;; Author: Ashwin Ram <Ram-Ashwin@cs.yale.edu>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 ;; ;; Dave Sill <de5@ornl.gov>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 ;; ;; David Lawrence <tale@pawl.rpi.edu>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 ;; ;; Noah Friedman <friedman@ai.mit.edu>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 ;; ;; Joe Wells <jbw@maverick.uswest.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 ;; ;; Dave Brennan <brennan@hal.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 ;; ;; Eric Raymond <esr@snark.thyrsus.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 ;; This field may have some special values; notably "FSF", meaning
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 ;; "Free Software Foundation".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 ;; * Maintainer line --- should be a single name/address as in the Author
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 ;; line, or an address only, or the string "FSF". If there is no maintainer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 ;; line, the person(s) in the Author field are presumed to be it. The example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 ;; in this file is mildly bogus because the maintainer line is redundant.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 ;; The idea behind these two fields is to be able to write a Lisp function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 ;; that does "send mail to the author" without having to mine the name out by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 ;; hand. Please be careful about surrounding the network address with <> if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 ;; there's also a name in the field.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 ;; * Created line --- optional, gives the original creation date of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 ;; file. For historical interest, basically.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 ;; * Version line --- intended to give the reader a clue if they're looking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 ;; at a different version of the file than the one they're accustomed to. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 ;; may be an RCS or SCCS header.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 ;; * Adapted-By line --- this is for FSF's internal use. The person named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 ;; in this field was the one responsible for installing and adapting the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 ;; package for the distribution. (This file doesn't have one because the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 ;; author *is* one of the maintainers.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 ;;
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
93 ;; * Keywords line --- used by the finder code (now direly bit-rotted)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 ;; for finding Emacs Lisp code related to a topic.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 ;; * X-Bogus-Bureaucratic-Cruft line --- this is a joke and an example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 ;; of a comment header. Headers starting with `X-' should never be used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 ;; for any real purpose; this is the way to safely add random headers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 ;; without invoking the wrath of any program.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 ;; * Commentary line --- enables Lisp code to find the developer's and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 ;; maintainers' explanations of the package internals.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 ;; * Change log line --- optional, exists to terminate the commentary
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 ;; section and start a change-log part, if one exists.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 ;; * Code line --- exists so Lisp can know where commentary and/or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 ;; change-log sections end.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 ;; * Footer line --- marks end-of-file so it can be distinguished from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 ;; an expanded formfeed or the results of truncation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 ;;; Change Log:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 ;; Tue Jul 14 23:44:17 1992 ESR
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 ;; * Created.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 (require 'picture) ; provides move-to-column-force
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 ;;; Variables:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 (defvar lm-header-prefix "^;;*[ \t]+\\(@\(#\)\\)?[ \t]*\\([\$]\\)?"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 "Prefix that is ignored before the tag.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 For example, you can write the 1st line synopsis string and headers like this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 in your Lisp package:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 ;; @(#) package.el -- package description
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 ;; @(#) $Maintainer: Person Foo Bar $
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 The @(#) construct is used by unix what(1) and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 then $identifier: doc string $ is used by GNU ident(1)")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 (defvar lm-comment-column 16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 "Column used for placing formatted output.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (defvar lm-commentary-header "Commentary\\|Documentation"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 "Regexp which matches start of documentation section.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 (defvar lm-history-header "Change Log\\|History"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 "Regexp which matches the start of code log section.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 ;;; Functions:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 ;; These functions all parse the headers of the current buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 (defsubst lm-get-header-re (header &optional mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 "Returns regexp for matching HEADER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 If called with optional MODE and with value `section',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 return section regexp instead."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 (cond ((eq mode 'section)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 (concat "^;;;;* " header ":[ \t]*$"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 (concat lm-header-prefix header ":[ \t]*"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 (defsubst lm-get-package-name ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 "Returns package name by looking at the first line."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 (if (and (looking-at (concat lm-header-prefix))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 (progn (goto-char (match-end 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 (looking-at "\\([^\t ]+\\)")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 (match-end 1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 (buffer-substring (match-beginning 1) (match-end 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 (defun lm-section-mark (header &optional after)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 "Return the buffer location of a given section start marker.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 The HEADER is the section mark string to search for.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 If AFTER is non-nil, return the location of the next line."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 (let ((case-fold-search t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 (if (re-search-forward (lm-get-header-re header 'section) nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 (beginning-of-line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 (if after (forward-line 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 nil))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 (defsubst lm-code-mark ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 "Return the buffer location of the `Code' start marker."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 (lm-section-mark "Code"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 (defsubst lm-commentary-mark ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 "Return the buffer location of the `Commentary' start marker."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 (lm-section-mark lm-commentary-header))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 (defsubst lm-history-mark ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 "Return the buffer location of the `History' start marker."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 (lm-section-mark lm-history-header))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 (defun lm-header (header)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 "Return the contents of the header named HEADER."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 (let ((case-fold-search t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 (if (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 ;; RCS ident likes format "$identifier: data$"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 (looking-at "\\([^$\n]+\\)")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 (match-end 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 (buffer-substring (match-beginning 1) (match-end 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 nil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 (defun lm-header-multiline (header)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 "Return the contents of the header named HEADER, with continuation lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 The returned value is a list of strings, one per line."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 (let ((res (lm-header header)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 (res
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 (setq res (list res))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 (forward-line 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 (while (and (looking-at (concat lm-header-prefix "[\t ]+"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 (goto-char (match-end 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 (looking-at "\\(.*\\)"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 (match-end 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 (setq res (cons (buffer-substring
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 (match-beginning 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 (match-end 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 res))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 (forward-line 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 res
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 ;; These give us smart access to the header fields and commentary
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 (defun lm-summary (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 "Return the one-line summary of file FILE, or current buffer if FILE is nil."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 (if (and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 (looking-at lm-header-prefix)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 (progn (goto-char (match-end 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 (looking-at "[^ ]+[ \t]+--+[ \t]+\\(.*\\)")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 (buffer-substring (match-beginning 1) (match-end 1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
249 ;; #### This should be replaced by a call into mail-lib.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 (defun lm-crack-address (x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 "Split up an email address into full name and real email address.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 The value is a cons of the form (FULLNAME . ADDRESS)."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 (cond ((string-match "\\(.+\\) [(<]\\(\\S-+@\\S-+\\)[>)]" x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 (cons (substring x (match-beginning 1) (match-end 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 (substring x (match-beginning 2) (match-end 2))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 ((string-match "\\(\\S-+@\\S-+\\) [(<]\\(.*\\)[>)]" x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 (cons (substring x (match-beginning 2) (match-end 2))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (substring x (match-beginning 1) (match-end 1))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 ((string-match "\\S-+@\\S-+" x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 (cons nil x))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 (cons x nil))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 (defun lm-authors (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 "Return the author list of file FILE, or current buffer if FILE is nil.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 Each element of the list is a cons; the car is the full name,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 the cdr is an email address."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 ;; XEmacs change (Is E-MAIL an infodock header? -sb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 (let* ((authorlist (lm-header-multiline "author"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 (email-list (lm-header-multiline "E-MAIL"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 (authors authorlist))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 (if (null email-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 (mapcar 'lm-crack-address authorlist)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 (while (and email-list authors)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 (setcar authors (cons (car authors) (car email-list)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 (setq email-list (cdr email-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 authors (cdr authors)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 authorlist)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 (kill-buffer (current-buffer))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 (defun lm-maintainer (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 "Return the maintainer of file FILE, or current buffer if FILE is nil.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 The return value has the form (NAME . ADDRESS)."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 (let ((maint (lm-header "maintainer")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 (if maint
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 (lm-crack-address maint)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 (car (lm-authors))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 (kill-buffer (current-buffer))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 (defun lm-creation-date (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 "Return the created date given in file FILE, or current buffer if FILE is nil."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 ;; XEmacs change (Is ORIG-DATE an Infodock header? -sb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 (or (lm-header "created")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 (let ((date-and-time (lm-header "ORIG-DATE")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 (if date-and-time
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 (substring date-and-time 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 (string-match " " date-and-time)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 (defun lm-last-modified-date (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 "Return the modify-date given in file FILE, or current buffer if FILE is nil."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 (if (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 (re-search-forward
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 "\\$[I]d: [^ ]+ [^ ]+ \\([^/]+\\)/\\([^/]+\\)/\\([^ ]+\\) "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 (lm-code-mark) t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 (format "%s %s %s"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 (buffer-substring (match-beginning 3) (match-end 3))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 (nth (string-to-int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 (buffer-substring (match-beginning 2) (match-end 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 '("" "Jan" "Feb" "Mar" "Apr" "May" "Jun"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 (buffer-substring (match-beginning 1) (match-end 1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 ;; XEmacs change (Infodock change? -sb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 (let ((date-and-time (lm-header "LAST-MOD")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 (if date-and-time
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 (substring date-and-time 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 (string-match " " date-and-time)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 (defun lm-version (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 "Return the version listed in file FILE, or current buffer if FILE is nil.
448
3078fd1074e8 Import from CVS: tag r21-2-39
cvs
parents: 428
diff changeset
346 This can be found in an RCS or SCCS header to crack it out of."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 (or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 (lm-header "version")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 (let ((header-max (lm-code-mark)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 (goto-char (point-min))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 ;; Look for an RCS header
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 ((re-search-forward "\\$[I]d: [^ ]+ \\([^ ]+\\) " header-max t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 (buffer-substring (match-beginning 1) (match-end 1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 ;; Look for an SCCS header
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 ((re-search-forward
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 (concat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 (regexp-quote "@(#)")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 (regexp-quote (file-name-nondirectory (buffer-file-name)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 "\t\\([012345679.]*\\)")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 header-max t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 (buffer-substring (match-beginning 1) (match-end 1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 (t nil))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 (defun lm-keywords (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 "Return the keywords given in file FILE, or current buffer if FILE is nil."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 (let ((keywords (lm-header "keywords")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 (and keywords (downcase keywords)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 (defun lm-adapted-by (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 "Return the adapted-by names in file FILE, or current buffer if FILE is nil.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 This is the name of the person who cleaned up this package for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 distribution."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 (lm-header "adapted-by")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 (defun lm-commentary (&optional file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 "Return the commentary in file FILE, or current buffer if FILE is nil.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 The value is returned as a string. In the text, the commentary starts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 with tag `Commentary' and ends with tag `Change Log' or `History'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 (let ((commentary (lm-commentary-mark))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 (change-log (lm-history-mark))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 (code (lm-code-mark))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 end)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 ((and commentary change-log)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 (buffer-substring commentary change-log))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 ((and commentary code)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 (buffer-substring commentary code))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 ;; XEmacs change (Infodock headers? -sb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 (setq commentary (lm-section-mark "DESCRIPTION" t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 (setq end (lm-section-mark "DESCRIP-END"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 (and commentary end (buffer-substring commentary end)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
425 ;;; Utilities
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 (defun lm-insert-at-column (col &rest strings)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 "Insert list of STRINGS, at column COL."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 (if (> (current-column) col) (insert "\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 (move-to-column-force col)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 (apply 'insert strings))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
433 ;;; Entry points: verification, synopses, and bug reporting
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
434
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 (defun lm-verify (&optional file showok &optional verb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 "Check that the current buffer (or FILE if given) is in proper format.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 If FILE is a directory, recurse on its files and generate a report in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 a temporary buffer."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 (let* ((verb (or verb (interactive-p)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 ret
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 (if verb
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 (setq ret "Ok.")) ;init value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 (if (and file (file-directory-p file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 (setq
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 ret
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 (switch-to-buffer (get-buffer-create "*lm-verify*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 (mapcar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 #'(lambda (f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 (if (string-match ".*\\.el$" f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 (let ((status (lm-verify f)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 (if status
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 (insert f ":")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 (lm-insert-at-column lm-comment-column status "\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 (and showok
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 (insert f ":")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 (lm-insert-at-column lm-comment-column "OK\n")))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 (directory-files file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 (setq name (lm-get-package-name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 (setq
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 ret
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 (cond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 ((null name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 "Can't find a package NAME")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 ((not (lm-authors))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 "Author: tag missing.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 ((not (lm-maintainer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 "Maintainer: tag missing.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 ((not (lm-summary))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 "Can't find a one-line 'Summary' description")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 ((not (lm-keywords))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 "Keywords: tag missing.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 ((not (lm-commentary-mark))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 "Can't find a 'Commentary' section marker.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 ((not (lm-history-mark))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 "Can't find a 'History' section marker.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 ((not (lm-code-mark))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 "Can't find a 'Code' section marker")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 ((progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 (goto-char (point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 (not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 (re-search-backward
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 (concat "^;;;[ \t]+" name "[ \t]+ends here[ \t]*$"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 "\\|^;;;[ \t]+ End of file[ \t]+" name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 nil t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 (format "Can't find a footer line for [%s]" name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 ret))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 ))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 (if verb
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 (message ret))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 ret
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 (defun lm-synopsis (&optional file showall)
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
520 "Generate a synopsis listing for FILE, defaulting to the visited file.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 If FILE is a directory, recurse on its files and generate a report in
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
522 a temporary buffer. If optional SHOWALL is non-nil, also generate a line
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
523 for files which do not include a recognizable synopsis. Interactively,
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
524 to specify the current directory, remove the trailing slash from the default
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
525 string. Interactively, SHOWALL is taken from the prefix argument."
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
526 (interactive "FSynopsis for (file or dir): \nP")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 (if (and file (file-directory-p file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 (switch-to-buffer (get-buffer-create "*lm-verify*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 (mapcar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 (lambda (f) ; XEmacs - dequote
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 (if (string-match ".*\\.el$" f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 (let ((syn (lm-synopsis f)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 (if syn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 (insert f ":")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 (lm-insert-at-column lm-comment-column syn "\n"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 (and showall
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 (insert f ":")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 (lm-insert-at-column lm-comment-column "NA\n")))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 (directory-files file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 (find-file file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 (lm-summary)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 (if file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 (kill-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 ))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554
4631
866681a74bd9 Improve lisp-mnt documentation.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4630
diff changeset
555 ;; #### This should call out to `report-xemacs-bug'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 (defun lm-report-bug (topic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 "Report a bug in the package currently being visited to its maintainer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 Prompts for bug subject. Leaves you in a mail buffer."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 (interactive "sBug Subject: ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 (let ((package (lm-get-package-name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 (addr (lm-maintainer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 (version (lm-version)))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
563 (if-fboundp 'mail
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
564 (mail nil
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
565 (if addr
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
566 (concat (car addr) " <" (cdr addr) ">")
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
567 (or (and-boundp 'report-xemacs-bug-beta-address
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
568 report-xemacs-bug-beta-address)
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
569 "<xemacs-beta@xemacs.org>"))
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
570 topic)
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 644
diff changeset
571 (error 'unimplemented "No mail package available"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 (goto-char (point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 (insert "\nIn "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 package
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 (if version (concat " version " version) "")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 "\n\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 (message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 (substitute-command-keys "Type \\[mail-send] to send bug report."))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579
4633
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
580 ;;; Entry point: insert boilerplate
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
581
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
582 (defconst lm-standard-permission
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
583 "\n;; This file is part of XEmacs.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
584
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
585 ;; XEmacs is free software; you can redistribute it and/or modify it
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
586 ;; under the terms of the GNU General Public License as published by
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
587 ;; the Free Software Foundation; either version 2, or (at your option)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
588 ;; any later version.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
589
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
590 ;; XEmacs is distributed in the hope that it will be useful, but
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
591 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
592 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
593 ;; General Public License for more details.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
594
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
595 ;; You should have received a copy of the GNU General Public License
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
596 ;; along with XEmacs; see the file COPYING. If not, write to the Free
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
597 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
598 ;; Boston, MA 02110-1301, USA.\n"
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
599 "Standard permissions notice for Lisp files that are part of XEmacs.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
600 License version and FSF address are current as of 2009-04-01.")
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
601
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
602 (defconst lm-change-log
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
603 "\n;;; Change Log:
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
604
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
605 ;; %s %s <%s>
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
606 ;;
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
607 ;; * Created.\n"
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
608 "GNU standard change-log template.")
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
609
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
610 (defconst lm-boilerplate
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
611 ";;; %s --- %s
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
612
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
613 ;; Copyright (C) %s %s
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
614
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
615 ;; Author: %s <%s>
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
616 ;; Created: %s
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
617 ;; Keywords: %s
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
618 %s
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
619 ;;; Synched up with: Not in GNU.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
620
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
621 ;;; Commentary:
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
622
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
623 ;; PLACE YOUR COMMENTARY (DESCRIPTION OF THE LIBRARY'S CONTENTS AND FUNCTION)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
624 ;; IN THIS SECTION.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
625 %s
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
626 ;;; Code:\n\n"
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
627 "lisp-mnt standard boilerplate.")
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
628
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
629 ;; #### Need to improve the interactive declaration.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
630 ;; #### Need to check for existing boilerplate.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
631 (defun lm-insert-boilerplate (file synopsis permission author email keys log)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
632 "Insert lisp-mnt standard header and footer.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
633 FILE is the file name of the library.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
634 SYNOPSIS is a one line description of the file.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
635 Total length of FILE and SYNOPSIS should be less than 70 characters.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
636 PERMISSION, if non-nil, means to use a simple \"All Rights Reserved.\"
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
637 Otherwise, the standard boilerplate for XEmacs sources is inserted.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
638 AUTHOR is the name of the author, defaulting to `user-full-name'.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
639 EMAIL is the contact email address, defaulting to `user-mail-address'.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
640 KEYS is a comma-separated list of finder keywords.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
641 LOG, if non-nil, means to insert a Change Log section.
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
642 Otherwise, it will be omitted."
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
643
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
644 (interactive "FName of file: \nsSynopsis: \nP\nsAuthor: \nsEmail:
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
645 sKeywords: \ncInsert a Change Log section? (y/n)")
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
646
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
647 (save-restriction
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
648 (widen)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
649 (let ((file (file-name-nondirectory file))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
650 (year (format-time-string "%Y"))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
651 (date (format-time-string "%Y-%m-%d"))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
652 (author (if (> (length author) 0)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
653 author
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
654 user-full-name))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
655 (email (if (> (length email) 0)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
656 email
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
657 user-mail-address))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
658 (log (eql (upcase log) ?Y)))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
659 (goto-char (point-min))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
660 (insert (format lm-boilerplate
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
661 file synopsis
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
662 year author
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
663 author email
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
664 date
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
665 keys
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
666 (if permission
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
667 "\n;; All Rights Reserved.\n"
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
668 lm-standard-permission)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
669 (if log
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
670 (format lm-change-log date author email)
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
671 "")))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
672 (goto-char (point-max))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
673 (insert (format "\n;;; %s ends here\n" file)))))
199ecf2503c8 Add standard section headers in preparation for 21.5.29.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 4631
diff changeset
674
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 (provide 'lisp-mnt)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 ;;; lisp-mnt.el ends here