Initial Commit
[packages] / xemacs-packages / vm / lisp / vm-license.el
1 ;;; vm-license.el --- Code to show VM's warranty and copying restrictions
2 ;;
3 ;; Copyright (C) 1989, 1994 Kyle E. Jones
4 ;; Copyright (C) 2003-2006 Robert Widhopf-Fenk
5 ;;
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 2 of the License, or
9 ;; (at your option) any later version.
10 ;;
11 ;; This program is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ;; GNU General Public License for more details.
15 ;;
16 ;; You should have received a copy of the GNU General Public License along
17 ;; with this program; if not, write to the Free Software Foundation, Inc.,
18 ;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20 ;;; Code:
21
22 ;;;###autoload
23 (defun vm-show-copying-restrictions (&optional warranty)
24   "Show VM's license, i.e. the GPL."
25   (interactive)
26   (require 'info)
27   (let ((pop-up-windows (eq vm-mutable-windows t))
28         (pop-up-frames (and vm-mutable-frames vm-frame-per-help)))
29     (or 
30      (condition-case ()
31          (progn (Info-goto-node "(vm)License") t)
32        (error nil))
33      (condition-case ()
34          (progn (Info-goto-node "(vm.info)License") t)
35        (error nil))
36      (error "VM Info documentation appears not to be installed"))
37     (vm-display (current-buffer) t nil nil)
38     (vm-display nil nil '(vm-show-copying-restrictions vm-show-no-warranty)
39                 (list this-command))
40     (if warranty
41         (let ((case-fold-search nil))
42           (search-forward "NO WARRANTY\n" nil t)
43           (forward-line -1)
44           (set-window-start (selected-window) (point))))))
45
46 ;;;###autoload
47 (defun vm-show-no-warranty ()
48   "Display \"NO WARRANTY\" section of the GNU General Public License."
49   (interactive)
50   (vm-show-copying-restrictions t))
51
52 (provide 'vm-license)
53
54 ;;; vm-license.el ends here