home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / packages / vm / vm-license.el < prev    next >
Encoding:
Text File  |  1989-09-11  |  11.8 KB  |  248 lines

  1. ;;; Code to show VM's warranty and copying restrictions
  2. ;;; Copyright (C) 1989 Kyle E. Jones
  3. ;;;
  4. ;;; This program is free software; you can redistribute it and/or modify
  5. ;;; it under the terms of the GNU General Public License as published by
  6. ;;; the Free Software Foundation; either version 1, or (at your option)
  7. ;;; any later version.
  8. ;;;
  9. ;;; This program is distributed in the hope that it will be useful,
  10. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ;;; GNU General Public License for more details.
  13. ;;;
  14. ;;; You should have received a copy of the GNU General Public License
  15. ;;; along with this program; if not, write to the Free Software
  16. ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. (require 'vm)
  19.  
  20. (defconst vm-license-buffer-name "*GNU General Public License*")
  21.  
  22. (defconst vm-license-string
  23. "            GNU GENERAL PUBLIC LICENSE
  24.              Version 1, February 1989
  25.  
  26.  Copyright (C) 1989 Free Software Foundation, Inc.
  27.                     675 Mass Ave, Cambridge, MA 02139, USA
  28.  Everyone is permitted to copy and distribute verbatim copies
  29.  of this license document, but changing it is not allowed.
  30.  
  31.                 Preamble
  32.  
  33.   The license agreements of most software companies try to keep users
  34. at the mercy of those companies.  By contrast, our General Public
  35. License is intended to guarantee your freedom to share and change free
  36. software--to make sure the software is free for all its users.  The
  37. General Public License applies to the Free Software Foundation's
  38. software and to any other program whose authors commit to using it.
  39. You can use it for your programs, too.
  40.  
  41.   When we speak of free software, we are referring to freedom, not
  42. price.  Specifically, the General Public License is designed to make
  43. sure that you have the freedom to give away or sell copies of free
  44. software, that you receive source code or can get it if you want it,
  45. that you can change the software or use pieces of it in new free
  46. programs; and that you know you can do these things.
  47.  
  48.   To protect your rights, we need to make restrictions that forbid
  49. anyone to deny you these rights or to ask you to surrender the rights.
  50. These restrictions translate to certain responsibilities for you if you
  51. distribute copies of the software, or if you modify it.
  52.  
  53.   For example, if you distribute copies of a such a program, whether
  54. gratis or for a fee, you must give the recipients all the rights that
  55. you have.  You must make sure that they, too, receive or can get the
  56. source code.  And you must tell them their rights.
  57.  
  58.   We protect your rights with two steps: (1) copyright the software, and
  59. (2) offer you this license which gives you legal permission to copy,
  60. distribute and/or modify the software.
  61.  
  62.   Also, for each author's protection and ours, we want to make certain
  63. that everyone understands that there is no warranty for this free
  64. software.  If the software is modified by someone else and passed on, we
  65. want its recipients to know that what they have is not the original, so
  66. that any problems introduced by others will not reflect on the original
  67. authors' reputations.
  68.  
  69.   The precise terms and conditions for copying, distribution and
  70. modification follow.
  71.  
  72.             GNU GENERAL PUBLIC LICENSE
  73.    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  74.  
  75.   0. This License Agreement applies to any program or other work which
  76. contains a notice placed by the copyright holder saying it may be
  77. distributed under the terms of this General Public License.  The
  78. \"Program\", below, refers to any such program or work, and a \"work based
  79. on the Program\" means either the Program or any work containing the
  80. Program or a portion of it, either verbatim or with modifications.  Each
  81. licensee is addressed as \"you\".
  82.  
  83.   1. You may copy and distribute verbatim copies of the Program's source
  84. code as you receive it, in any medium, provided that you conspicuously and
  85. appropriately publish on each copy an appropriate copyright notice and
  86. disclaimer of warranty; keep intact all the notices that refer to this
  87. General Public License and to the absence of any warranty; and give any
  88. other recipients of the Program a copy of this General Public License
  89. along with the Program.  You may charge a fee for the physical act of
  90. transferring a copy.
  91.  
  92.   2. You may modify your copy or copies of the Program or any portion of
  93. it, and copy and distribute such modifications under the terms of Paragraph
  94. 1 above, provided that you also do the following:
  95.  
  96.     a) cause the modified files to carry prominent notices stating that
  97.     you changed the files and the date of any change; and
  98.  
  99.     b) cause the whole of any work that you distribute or publish, that
  100.     in whole or in part contains the Program or any part thereof, either
  101.     with or without modifications, to be licensed at no charge to all
  102.     third parties under the terms of this General Public License (except
  103.     that you may choose to grant warranty protection to some or all
  104.     third parties, at your option).
  105.  
  106.     c) If the modified program normally reads commands interactively when
  107.     run, you must cause it, when started running for such interactive use
  108.     in the simplest and most usual way, to print or display an
  109.     announcement including an appropriate copyright notice and a notice
  110.     that there is no warranty (or else, saying that you provide a
  111.     warranty) and that users may redistribute the program under these
  112.     conditions, and telling the user how to view a copy of this General
  113.     Public License.
  114.  
  115.     d) You may charge a fee for the physical act of transferring a
  116.     copy, and you may at your option offer warranty protection in
  117.     exchange for a fee.
  118.  
  119. Mere aggregation of another independent work with the Program (or its
  120. derivative) on a volume of a storage or distribution medium does not bring
  121. the other work under the scope of these terms.
  122.  
  123.   3. You may copy and distribute the Program (or a portion or derivative of
  124. it, under Paragraph 2) in object code or executable form under the terms of
  125. Paragraphs 1 and 2 above provided that you also do one of the following:
  126.  
  127.     a) accompany it with the complete corresponding machine-readable
  128.     source code, which must be distributed under the terms of
  129.     Paragraphs 1 and 2 above; or,
  130.  
  131.     b) accompany it with a written offer, valid for at least three
  132.     years, to give any third party free (except for a nominal charge
  133.     for the cost of distribution) a complete machine-readable copy of the
  134.     corresponding source code, to be distributed under the terms of
  135.     Paragraphs 1 and 2 above; or,
  136.  
  137.     c) accompany it with the information you received as to where the
  138.     corresponding source code may be obtained.  (This alternative is
  139.     allowed only for noncommercial distribution and only if you
  140.     received the program in object code or executable form alone.)
  141.  
  142. Source code for a work means the preferred form of the work for making
  143. modifications to it.  For an executable file, complete source code means
  144. all the source code for all modules it contains; but, as a special
  145. exception, it need not include source code for modules which are standard
  146. libraries that accompany the operating system on which the executable
  147. file runs, or for standard header files or definitions files that
  148. accompany that operating system.
  149.  
  150.   4. You may not copy, modify, sublicense, distribute or transfer the
  151. Program except as expressly provided under this General Public License.
  152. Any attempt otherwise to copy, modify, sublicense, distribute or transfer
  153. the Program is void, and will automatically terminate your rights to use
  154. the Program under this License.  However, parties who have received
  155. copies, or rights to use copies, from you under this General Public
  156. License will not have their licenses terminated so long as such parties
  157. remain in full compliance.
  158.  
  159.   5. By copying, distributing or modifying the Program (or any work based
  160. on the Program) you indicate your acceptance of this license to do so,
  161. and all its terms and conditions.
  162.  
  163.   6. Each time you redistribute the Program (or any work based on the
  164. Program), the recipient automatically receives a license from the original
  165. licensor to copy, distribute or modify the Program subject to these
  166. terms and conditions.  You may not impose any further restrictions on the
  167. recipients' exercise of the rights granted herein.
  168.  
  169.   7. The Free Software Foundation may publish revised and/or new versions
  170. of the General Public License from time to time.  Such new versions will
  171. be similar in spirit to the present version, but may differ in detail to
  172. address new problems or concerns.
  173.  
  174. Each version is given a distinguishing version number.  If the Program
  175. specifies a version number of the license which applies to it and \"any
  176. later version\", you have the option of following the terms and conditions
  177. either of that version or of any later version published by the Free
  178. Software Foundation.  If the Program does not specify a version number of
  179. the license, you may choose any version ever published by the Free Software
  180. Foundation.
  181.  
  182.   8. If you wish to incorporate parts of the Program into other free
  183. programs whose distribution conditions are different, write to the author
  184. to ask for permission.  For software which is copyrighted by the Free
  185. Software Foundation, write to the Free Software Foundation; we sometimes
  186. make exceptions for this.  Our decision will be guided by the two goals
  187. of preserving the free status of all derivatives of our free software and
  188. of promoting the sharing and reuse of software generally.
  189.  
  190.                 NO WARRANTY
  191.  
  192.   9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  193. FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  194. OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  195. PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  196. OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  197. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  198. TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  199. PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  200. REPAIR OR CORRECTION.
  201.  
  202.   10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  203. WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  204. REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  205. INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  206. OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  207. TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  208. YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  209. PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  210. POSSIBILITY OF SUCH DAMAGES.
  211.  
  212.              END OF TERMS AND CONDITIONS
  213. ")
  214.  
  215. (defun vm-show-copying-restrictions (&optional warranty)
  216.   "Display the GNU General Public License."
  217.   (interactive)
  218.   (if (get-buffer vm-license-buffer-name)
  219.       (progn
  220.     (if (get-buffer-window (get-buffer vm-license-buffer-name))
  221.         (select-window (get-buffer-window
  222.                 (get-buffer vm-license-buffer-name)))
  223.       (switch-to-buffer vm-license-buffer-name t))
  224.     (goto-char (point-min))
  225.     (if warranty
  226.         (progn
  227.           (search-forward "NO WARRANTY\n" nil t)
  228.           (forward-line -1)
  229.           (set-window-start (selected-window) (point)))))
  230.     (save-excursion
  231.       (switch-to-buffer (get-buffer-create vm-license-buffer-name) t)
  232.       (insert vm-license-string)
  233.       (goto-char (point-min))
  234.       (if warranty
  235.       (progn
  236.         (search-forward "NO WARRANTY\n" nil t)
  237.         (forward-line -1)
  238.         (set-window-start (selected-window) (point))))
  239.       (set-buffer-modified-p nil))
  240.     ;; This goes into a recursive edit!
  241.     (view-buffer vm-license-buffer-name)
  242.     (condition-case () (kill-buffer vm-license-buffer-name) (error nil))))
  243.  
  244. (defun vm-show-no-warranty ()
  245.   "Display \"NO WARRANTY\" section of the GNU General Public License."
  246.   (interactive)
  247.   (vm-show-copying-restrictions t))
  248.