annotate lisp/package-ui.el @ 5716:1003acd5a4b8

Fix cygwin build on new win32api.
author Vin Shelton <acs@xemacs.org>
date Mon, 04 Feb 2013 20:03:04 -0500
parents ac37a5f7e5be
children
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 ;;; package-ui.el ---
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) 1998 by Darryl Okahata
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: Darryl Okahata <darrylo@sr.hp.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Keywords: internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
10 ;; XEmacs is free software: you can redistribute it and/or modify it
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
11 ;; under the terms of the GNU General Public License as published by the
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
12 ;; Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
13 ;; option) any later version.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
18 ;; for more details.
428
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 ;; You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5267
diff changeset
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;;; Synched up with: Not in FSF
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 (require 'package-get) ;; which, in turn, requires 'package-admin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 ;; User-changeable variables:
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 (defgroup pui nil
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
32 "Convenient interface to the package system."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 :group 'package-tools
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 :tag "Package User interface"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 :prefix "pui-")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 (defcustom pui-package-install-dest-dir nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 "*If non-nil (Automatic) path to package tree to install packages in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 Otherwise, use old path for installed packages and make a guess for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 new ones."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 :tag "Install Location"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 :type '(choice (const :tag "Automatic" nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 (directory)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 (defcustom pui-list-verbose t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 "*If non-nil, display verbose info in the package list buffer."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 :tag "Verbose Listing"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 :type 'boolean)
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 (defcustom pui-up-to-date-package-face nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 "*The face to use for packages that are up-to-date."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 :type 'face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 (defcustom pui-selected-package-face 'bold
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 "*The face to use for selected packages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 Set this to `nil' to use the `default' face."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 :type 'face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (defcustom pui-deleted-package-face 'blue
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 "*The face to use for packages marked for removal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 Set this to `nil' to use the `default' face."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 :type 'face)
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 (defcustom pui-outdated-package-face 'red
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 "*The face to use for outdated packages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 Set this to `nil' to use the `default' face."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 :type 'face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 (defcustom pui-uninstalled-package-face 'italic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 "*The face to use for uninstalled packages.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 Set this to `nil' to use the `default' face."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 :group 'pui
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 :type 'face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
81 (defcustom pui-info-buffer "*Packages*"
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
82 "*Buffer to use for displaying package information."
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
83 :group 'pui
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
84 :type 'string)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 ;; End of user-changeable variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 (defvar pui-selected-packages nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 "The list of user-selected packages to install.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (defvar pui-deleted-packages nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 "The list of user-selected packages to remove.")
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 (defvar pui-actual-package "")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 (defvar pui-display-keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (let ((m (make-keymap)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (suppress-keymap m)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 (set-keymap-name m 'pui-display-keymap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (define-key m "q" 'pui-quit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 (define-key m "g" 'pui-list-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 (define-key m "i" 'pui-display-info)
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
105 (define-key m "m" 'pui-display-maintainer)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 (define-key m "?" 'describe-mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 (define-key m "v" 'pui-toggle-verbosity-redisplay)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 (define-key m "d" 'pui-toggle-package-delete-key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 (define-key m "D" 'pui-toggle-package-delete-key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 (define-key m [return] 'pui-toggle-package-key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 (define-key m "x" 'pui-install-selected-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (define-key m "I" 'pui-install-selected-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 (define-key m "r" 'pui-add-required-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (define-key m "n" 'next-line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 (define-key m "+" 'pui-toggle-package-key)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (define-key m "p" 'previous-line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 (define-key m " " 'scroll-up-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 (define-key m [delete] 'scroll-down-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 m)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 "Keymap to use in the `pui-info-buffer' buffer")
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 (defvar pui-package-keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 (let ((m (make-sparse-keymap)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 (set-keymap-name m 'pui-package-keymap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 (define-key m 'button2 'pui-toggle-package-event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 ;; We use a popup menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 (define-key m 'button3 'pui-popup-context-sensitive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 m)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 "Keymap to use over package names/descriptions.")
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 ;; End of variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134
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 ;; Configuration routines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (defun package-ui-add-site (site)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 "Add site to package-get-remote and possibly offer to update package list."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 (let ((had-none (null package-get-remote)))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
142 (setq package-get-remote site)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 (when (and had-none package-get-was-current
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 (y-or-n-p "Update Package list?"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 (setq package-get-was-current nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (package-get-require-base t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 (if (get-buffer pui-info-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 (save-window-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 (pui-list-packages))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (set-menubar-dirty-flag)))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
151
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
152 ;;;###autoload
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
153 (defun package-ui-download-menu ()
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
154 "Build the `Add Download Site' menu."
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
155 (mapcar (lambda (site)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
156 (vector (car site)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
157 `(if (equal package-get-remote (quote ,(cdr site)))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
158 (setq package-get-remote nil)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
159 (package-ui-add-site (quote ,(cdr site))))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
160 ;; I've used radio buttons so that only a single
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
161 ;; site can be selected, but they are in fact
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
162 ;; toggles. SY.
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
163 :style 'radio
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
164 :selected `(equal package-get-remote (quote ,(cdr site)))))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
165 package-get-download-sites))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 ;;;###autoload
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
168 (defun package-ui-pre-release-download-menu ()
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
169 "Build the 'Pre-Release Download Sites' menu."
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
170 (mapcar (lambda (site)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
171 (vector (car site)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
172 `(if (equal package-get-remote (quote ,(cdr site)))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
173 (setq package-get-remote nil)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
174 (package-ui-add-site (quote ,(cdr site))))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
175 ;; I've used radio buttons so that only a single
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
176 ;; site can be selected, but they are in fact
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
177 ;; toggles. SY.
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
178 :style 'radio
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
179 :selected `(equal package-get-remote (quote ,(cdr site)))))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
180 package-get-pre-release-download-sites))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
181
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
182 ;;;###autoload
1374
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
183 (defun package-ui-site-release-download-menu ()
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
184 "Build the 'Site Release Download Sites' menu."
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
185 (mapcar (lambda (site)
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
186 (vector (car site)
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
187 `(if (equal package-get-remote (quote ,(cdr site)))
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
188 (setq package-get-remote nil)
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
189 (package-ui-add-site (quote ,(cdr site))))
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
190 ;; I've used radio buttons so that only a single
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
191 ;; site can be selected, but they are in fact
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
192 ;; toggles. SY.
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
193 :style 'radio
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
194 :selected `(equal package-get-remote (quote ,(cdr site)))))
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
195 package-get-site-release-download-sites))
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
196
d638fc15d68b [xemacs-hg @ 2003-03-24 11:10:54 by adrian]
adrian
parents: 1365
diff changeset
197 ;;;###autoload
1647
d90ba01b5346 [xemacs-hg @ 2003-08-27 17:18:20 by youngs]
youngs
parents: 1410
diff changeset
198 (defun pui-set-local-package-get-directory ()
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
199 "Set a new package binary directory in `package-get-remote'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 Note that no provision is made for saving any changes made by this function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 It exists mainly as a convenience for one-time package installations from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 disk."
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
203 (interactive)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
204 (let ((dir (read-directory-name
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
205 "New package binary directory to add? "
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
206 nil nil t)))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
207 (setq package-get-remote (list nil dir))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
208 (message "Package directory \"%s\" added." dir)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 ;; Package list/installer routines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 (defun pui-quit ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 (kill-buffer nil))
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 (defun pui-package-symbol-char (pkg-sym version)
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 (if (package-get-info-find-package packages-package-list pkg-sym)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 (let ((installed (package-get-key pkg-sym :version)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 (if (>= (if (stringp installed)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 (string-to-number installed)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 installed)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 (if (stringp version)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 (string-to-number version)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 version))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 (list " " pui-up-to-date-package-face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 (list "*" pui-outdated-package-face)))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
229 (list "-" pui-uninstalled-package-face))))
428
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 (defun pui-update-package-display (extent &optional pkg-sym version)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 "Update the package status for EXTENT.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 If PKG-SYM or VERSION are not given, they are read from the extent.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 These are used to determine whether or not the package is installed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 and whether or not it is up-to-date."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 (let (buffer-read-only disp sym-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 (if (not pkg-sym)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 (setq pkg-sym (extent-property extent 'pui-package)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 (if (not version)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 (setq version (package-get-info-prop (extent-property extent 'pui-info)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 'version)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 (cond ((member pkg-sym pui-selected-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 (if pui-selected-package-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 (set-extent-face extent (get-face pui-selected-package-face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 (set-extent-face extent (get-face 'default)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (setq sym-char "+"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 ((member pkg-sym pui-deleted-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 (if pui-deleted-package-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 (set-extent-face extent (get-face pui-deleted-package-face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 (set-extent-face extent (get-face 'default)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 (setq sym-char "D"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 (t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 (setq disp (pui-package-symbol-char pkg-sym version))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 (setq sym-char (car disp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 (if (car (cdr disp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 (set-extent-face extent (get-face (car (cdr disp))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 (set-extent-face extent (get-face 'default)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 (goto-char (extent-start-position extent))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 (delete-char 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 (insert sym-char)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
262 (set-buffer-modified-p nil))))
428
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 pui-toggle-package (extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 (let (pkg-sym)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 (setq pkg-sym (extent-property extent 'pui-package))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 (if (member pkg-sym pui-selected-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 (setq pui-selected-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 (delete pkg-sym pui-selected-packages))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 (setq pui-selected-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 (cons pkg-sym pui-selected-packages))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 (setq pui-deleted-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 (delete pkg-sym pui-deleted-packages)))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
274 (pui-update-package-display extent pkg-sym)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 (defun pui-toggle-package-key ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 "Select/unselect package for installation, using the keyboard."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 (let (extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 (if (setq extent (extent-at (point) (current-buffer) 'pui))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 (pui-toggle-package extent)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
283 (forward-line 1))
1410
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
284 (error 'invalid-operation
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
285 "No package under cursor!"))))
428
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 pui-toggle-package-delete (extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 (let (pkg-sym)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 (setq pkg-sym (extent-property extent 'pui-package))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 (if (member pkg-sym pui-deleted-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 (setq pui-deleted-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 (delete pkg-sym pui-deleted-packages))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 (setq pui-deleted-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 (cons pkg-sym pui-deleted-packages))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
295 (setq pui-selected-packages
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 (delete pkg-sym pui-selected-packages)))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
297 (pui-update-package-display extent pkg-sym)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 (defun pui-toggle-package-delete-key ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 "Select/unselect package for removal, using the keyboard."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 (let (extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 (if (setq extent (extent-at (point) (current-buffer) 'pui))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 (pui-toggle-package-delete extent)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
307 (forward-line 1))
1410
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
308 (error 'invalid-operation
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
309 "No package under cursor!"))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 (defun pui-current-package ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 (let ((extent (extent-at (point) (current-buffer) 'pui)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 (if extent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 (extent-property extent 'pui-package))))
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 (defun pui-toggle-package-event (event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 "Select/unselect package for installation, using the mouse."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 (interactive "e")
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
319 (let* ((ep (event-point event))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
320 (buffer (window-buffer (event-window event)))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
321 (extent (extent-at ep buffer 'pui-package)))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
322 (pui-toggle-package extent)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 (defun pui-toggle-verbosity-redisplay ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 "Toggle verbose package info."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 (setq pui-list-verbose (not pui-list-verbose))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
329 (pui-list-packages)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 (defun pui-install-selected-packages ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 "Install selected packages."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 (interactive)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
334 (let ((tmpbuf "*Packages-To-Remove*")
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
335 do-delete)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 (when pui-deleted-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 (save-window-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 (with-output-to-temp-buffer tmpbuf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 (display-completion-list (sort
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
340 (mapcar #'symbol-name pui-deleted-packages)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
341 #'string<)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 :activate-callback nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 :help-string "Packages selected for removal:\n"
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
344 :completion-string t))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 (setq tmpbuf (get-buffer-create tmpbuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 (display-buffer tmpbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 (setq do-delete (yes-or-no-p "Remove these packages? "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 (kill-buffer tmpbuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 (when do-delete
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 (message "Deleting selected packages ...") (sit-for 0)
4783
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
351 (mapc (lambda (pkg)
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
352 (package-admin-delete-binary-package
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
353 pkg (package-admin-get-install-dir pkg)))
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
354 (nreverse pui-deleted-packages))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 (message "Packages deleted"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
357 (let ((tmpbuf "*Packages-To-Install*")
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
358 do-install)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 (if pui-selected-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 ;; Don't change window config when asking the user if he really
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 ;; wants to install the packages. We do this to avoid messing up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 ;; the window configuration if errors occur (we don't want to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 ;; display random buffers in addition to the error buffer, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 ;; errors occur, which would normally be caused by display-buffer).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 (save-window-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 (with-output-to-temp-buffer tmpbuf
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
368 (display-completion-list
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
369 (sort (mapcar #'symbol-name pui-selected-packages) #'string<)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
370 :activate-callback nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
371 :help-string "Packages selected for installation:\n"
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
372 :completion-string t))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 (setq tmpbuf (get-buffer-create tmpbuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 (display-buffer tmpbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 (setq do-install (y-or-n-p "Install these packages? "))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
376 (kill-buffer tmpbuf))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 (if do-install
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 ;; Clear old temp buffer history
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 (set-buffer (get-buffer-create package-admin-temp-buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 (buffer-disable-undo package-admin-temp-buffer)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
383 (erase-buffer package-admin-temp-buffer))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 (message "Installing selected packages ...") (sit-for 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 (if (catch 'done
4783
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
386 (mapc (lambda (pkg)
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
387 (if (not (package-get pkg nil nil
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
388 pui-package-install-dest-dir))
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
389 (throw 'done nil)))
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
390 (nreverse pui-selected-packages))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 (pui-list-packages)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
394 (message "Packages installed"))))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
395 (clear-message)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 (if pui-deleted-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 (pui-list-packages)
1410
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
398 (error 'invalid-operation
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
399 "No packages have been selected!")))
454
d7a9135ec789 Import from CVS: tag r21-2-42
cvs
parents: 442
diff changeset
400 ;; sync with windows type systems
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
401 (package-net-update-installed-db)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 (defun pui-add-required-packages ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 "Select packages required by those already selected for installation."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 (let ((tmpbuf "*Required-Packages*") do-select)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 (if pui-selected-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 (let ((dependencies
5267
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
409 (mapcan
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
410 (lambda (pkg)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
411 (let ((installed
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
412 (package-get-key pkg :version))
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
413 (current
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
414 (package-get-info-prop
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
415 (package-get-info-version
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
416 (package-get-info-find-package
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
417 package-get-base pkg) nil)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
418 'version)))
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
419 (if (or (null installed)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
420 (< (if (stringp installed)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
421 (string-to-number installed)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
422 installed)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
423 (if (stringp current)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
424 (string-to-number current)
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
425 current)))
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
426 (list pkg))))
668c73e222fd Change forms like (delq nil (mapcar ...)) to (mapcan ...).
Aidan Kehoe <kehoea@parhasard.net>
parents: 5182
diff changeset
427 (package-get-dependencies pui-selected-packages))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 ;; Don't change window config when asking the user if he really
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 ;; wants to add the packages. We do this to avoid messing up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 ;; the window configuration if errors occur (we don't want to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 ;; display random buffers in addition to the error buffer, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 ;; errors occur, which would normally be caused by display-buffer).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 (save-window-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 (with-output-to-temp-buffer tmpbuf
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 (display-completion-list (sort
5363
311f6817efc2 Remove various redundant wrapper lambdas, core lisp.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5267
diff changeset
436 (mapcar #'symbol-name dependencies)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 'string<)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 :activate-callback nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 :help-string "Required packages:\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 :completion-string t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 (setq tmpbuf (get-buffer-create tmpbuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 (display-buffer tmpbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 (setq do-select (y-or-n-p "Select these packages? "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 (kill-buffer tmpbuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 (if do-select
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 (setq pui-selected-packages
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 (union pui-selected-packages dependencies))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 (map-extents #'(lambda (extent maparg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 (pui-update-package-display extent))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 nil nil nil nil nil 'pui)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 (message "added dependencies"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 (clear-message)))
1410
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
454 (error 'invalid-operation
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
455 "No packages have been selected!"))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 (defun pui-help-echo (extent &optional force-update)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 "Display additional package info in the modeline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 EXTENT determines the package to display (the package information is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 attached to the extent as properties)."
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
461 (let (pkg-sym info inst-ver inst-auth-ver auth-ver date maintainer balloon req)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 (if (or force-update (not (current-message))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
463 (string-match ".*: .*: " (current-message)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 (setq pkg-sym (extent-property extent 'pui-package)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 info (extent-property extent 'pui-info)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 inst-ver (package-get-key pkg-sym :version)
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
468 inst-auth-ver (package-get-key pkg-sym :author-version)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 auth-ver (package-get-info-prop info 'author-version)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 date (package-get-info-prop info 'date)
852
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
471 maintainer (package-get-info-prop info 'maintainer)
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
472 req (package-get-info-prop info 'requires))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 (if (not inst-ver)
852
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
474 (setq inst-ver 0))
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
475 (if (featurep 'balloon-help)
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
476 (progn
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
477 (setq balloon (format "
2146
e4307a6b9ebb [xemacs-hg @ 2004-06-21 18:26:18 by adrian]
adrian
parents: 1742
diff changeset
478 Package Information: [For package: \"%s\"]\n================
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
479 Installed Upstream Ver: %s Available Upstream Ver: %s
852
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
480 Maintainer : %s
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
481 Released : %s
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
482 Required Packages : %s\n\n"
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
483 pkg-sym inst-auth-ver auth-ver maintainer
852
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
484 date req))
d83885ef293b [xemacs-hg @ 2002-05-25 01:55:29 by youngs]
youngs
parents: 624
diff changeset
485 (set-extent-property extent 'balloon-help balloon)))
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
486 (format
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
487 "Installed upstream ver: %s Available upstream ver: %s"
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
488 inst-auth-ver auth-ver)))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 (defun pui-display-info (&optional no-error event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 "Display additional package info in the modeline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 Designed to be called interactively (from a keypress)."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 (let (extent)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 (beginning-of-line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 (if (setq extent (extent-at (point) (current-buffer) 'pui))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 (message (pui-help-echo extent t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 (if no-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 (clear-message nil)
1410
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
501 (error 'invalid-operation
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
502 "No package under cursor!"))))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
504 (defun pui-display-maintainer (&optional no-error event)
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
505 "Display a package's maintainer in the minibuffer."
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
506 (interactive)
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2146
diff changeset
507 (let (extent ;pkg-sym
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2146
diff changeset
508 info maintainer)
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
509 (save-excursion
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
510 (beginning-of-line)
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
511 (if (setq extent (extent-at (point) (current-buffer) 'pui))
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
512 (progn
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2146
diff changeset
513 (setq ;pkg-sym (extent-property extent 'pui-package)
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2146
diff changeset
514 info (extent-property extent 'pui-info)
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2146
diff changeset
515 maintainer (package-get-info-prop info 'maintainer))
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
516 (message (format "Maintainer: %s" maintainer)))
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
517 (if no-error
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
518 (clear-message nil)
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
519 (error 'invalid-operation
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
520 "No package under cursor!"))))))
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
521
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 (defvar pui-menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 '("Packages"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 ["Toggle install " pui-toggle-package-key :active (pui-current-package) :suffix (format "`%s'" (or (pui-current-package) "..."))]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 ["Toggle delete " pui-toggle-package-delete-key :active (pui-current-package) :suffix (format "`%s'" (or (pui-current-package) "..."))]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 ["Info on" pui-display-info :active (pui-current-package) :suffix (format "`%s'" (or (pui-current-package) "..."))]
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 ["Add Required" pui-add-required-packages t]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 ["Install/Remove Selected" pui-install-selected-packages t]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 "---"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 ["Verbose" pui-toggle-verbosity-redisplay
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 :active t :style toggle :selected pui-list-verbose]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 ["Refresh" pui-list-packages t]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 ["Help" pui-help t]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 ["Quit" pui-quit t]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
537 ;;; "Why is there no standard function to do this?"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
538 (defun pui-popup-context-sensitive (event)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
539 (interactive "e")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
540 (save-excursion
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
541 (set-buffer (event-buffer event))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
542 (goto-char (event-point event))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
543 (popup-menu pui-menu event)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
544 ;; I agree with dired.el - this is seriously bogus.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
545 (while (popup-up-p)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
546 (dispatch-event (next-event)))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 (defun list-packages-mode ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 "Symbols in the leftmost column:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 + The package is marked for installation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 - The package has not been installed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 D The package has been marked for deletion.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 * The currently installed package is old, and a newer version is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 available.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 Useful keys:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 `\\[pui-toggle-package-key]' to select/unselect the current package for installation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 `\\[pui-toggle-package-delete-key]' to select/unselect the current package for removal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 `\\[pui-add-required-packages]' to add any packages required by those selected.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 `\\[pui-install-selected-packages]' to install/delete selected packages.
1742
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
563 `\\[pui-display-info]' to display additional information about the package in the minibuffer.
7f92ee59c996 [xemacs-hg @ 2003-10-13 18:53:23 by viteno]
viteno
parents: 1647
diff changeset
564 `\\[pui-display-maintainer]' to display the package's maintainer in the minibuffer
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 `\\[pui-list-packages]' to refresh the package list.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 `\\[pui-toggle-verbosity-redisplay]' to toggle between a verbose and non-verbose display.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 `\\[pui-quit]' to kill this buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 "
1410
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
569 (error 'invalid-operation
44de306310b8 [xemacs-hg @ 2003-04-14 03:40:26 by youngs]
youngs
parents: 1378
diff changeset
570 "You cannot enter this mode directly. Use `pui-list-packages'"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 (put 'list-packages-mode 'mode-class 'special)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 (defun pui-list-packages ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 "List all packages and package information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 The package name, version, and description are displayed. From the displayed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 buffer, the user can see which packages are installed, which are not, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 which are out-of-date (a newer version is available). The user can then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 select packages for installation via the keyboard or mouse."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 (interactive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 (package-get-require-base t)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
583 (let ((outbuf (get-buffer-create pui-info-buffer))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
584 (sep-string "===============================================================================\n")
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
585 start)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 (message "Creating package list ...") (sit-for 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 (set-buffer outbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 (setq buffer-read-only nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 (buffer-disable-undo outbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 (erase-buffer outbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 (kill-all-local-variables)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 (use-local-map pui-display-keymap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 (setq major-mode 'list-packages-mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 (setq mode-name "Packages")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 (setq truncate-lines t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 (unless package-get-remote
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 (insert "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 Warning: No download sites specified. Package index may be out of date.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 If you intend to install packages, specify download sites first.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 (if pui-list-verbose
2598
2f5d53e62972 [xemacs-hg @ 2005-02-19 22:25:12 by viteno]
viteno
parents: 2367
diff changeset
605 (insert " Latest Installed
2f5d53e62972 [xemacs-hg @ 2005-02-19 22:25:12 by viteno]
viteno
parents: 2367
diff changeset
606 Package name Vers. Vers. Description
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 ")
2598
2f5d53e62972 [xemacs-hg @ 2005-02-19 22:25:12 by viteno]
viteno
parents: 2367
diff changeset
608 (insert " Latest
2f5d53e62972 [xemacs-hg @ 2005-02-19 22:25:12 by viteno]
viteno
parents: 2367
diff changeset
609 Package name Vers. Description
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 "))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 (insert sep-string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 (setq start (point))
4783
e29fcfd8df5f Eliminate most core code byte-compile warnings.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2598
diff changeset
613 (mapc
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
614 #'(lambda (pkg)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
615 (let (pkg-sym info version desc
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
616 b e extent current-vers disp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
617 (setq pkg-sym (car pkg)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
618 info (package-get-info-version (cdr pkg) nil))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
619 (setq version (package-get-info-prop info 'version)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
620 desc (package-get-info-prop info 'description))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
622 (setq disp (pui-package-symbol-char pkg-sym
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
623 version))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
624 (setq b (point))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
625 (if pui-list-verbose
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
626 (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
627 (setq current-vers (package-get-key pkg-sym :version))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
628 (cond
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
629 ((not current-vers)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
630 (setq current-vers "-----"))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
631 ((stringp current-vers)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
632 (setq current-vers
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
633 (format "%.2f"
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
634 (string-to-number current-vers))))
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
635 ((numberp current-vers)
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
636 (setq current-vers (format "%.2f" current-vers))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
637 (insert
2598
2f5d53e62972 [xemacs-hg @ 2005-02-19 22:25:12 by viteno]
viteno
parents: 2367
diff changeset
638 (format "%s %-20s %-5.2f %-5s %s\n"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
639 (car disp) pkg-sym
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
640 (if (stringp version)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
641 (string-to-number version)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
642 version)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
643 current-vers desc)))
2598
2f5d53e62972 [xemacs-hg @ 2005-02-19 22:25:12 by viteno]
viteno
parents: 2367
diff changeset
644 (insert (format "%s %-20s %-5s %s\n"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
645 (car disp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
646 pkg-sym version desc)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
647 (save-excursion
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
648 (setq e (progn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
649 (forward-line -1)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
650 (end-of-line)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
651 (point))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
652 (setq extent (make-extent b e))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
653 (if (car (cdr disp))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
654 (set-extent-face extent (get-face (car (cdr disp))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
655 (set-extent-face extent (get-face 'default)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
656 (set-extent-property extent 'highlight t)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
657 (set-extent-property extent 'pui t)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
658 (set-extent-property extent 'pui-package pkg-sym)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
659 (set-extent-property extent 'pui-info info)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
660 (set-extent-property extent 'help-echo 'pui-help-echo)
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
661 (set-extent-property extent 'keymap pui-package-keymap)))
5182
2e528066e2fc Move #'sort*, #'fill, #'merge to C from cl-seq.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4783
diff changeset
662 (sort* (copy-sequence package-get-base) #'string< :key #'car))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 (insert sep-string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 (insert (documentation 'list-packages-mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665 (set-buffer-modified-p nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 (setq buffer-read-only t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 (pop-to-buffer outbuf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 (delete-other-windows)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 (goto-char start)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 (setq pui-selected-packages nil) ; Reset list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 (setq pui-deleted-packages nil) ; Reset list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 (when (featurep 'menubar)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 (set-buffer-menubar current-menubar)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 (add-submenu '() pui-menu)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 (setq mode-popup-menu pui-menu))
1365
02909207294a [xemacs-hg @ 2003-03-20 13:19:56 by youngs]
youngs
parents: 852
diff changeset
676 (clear-message)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 (defalias 'list-packages 'pui-list-packages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 (provide 'package-ui)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 ;;; package-ui.el ends here