Steve Y, this patch may be better than using directory-sep-char.
On windows people mix / and \\ a lot and they both work.
We should also handle the case more gracefully (easy to understand
error message) where the package path does not contain mule-packages
or xemacs-packages at all (think Debian).
Just my 0.02~
Adrian
>>>> "Fabrice" == Fabrice Popineau
<Fabrice.Popineau(a)supelec.fr> writes:
Fabrice> In package-admin-find-top-directory:
Fabrice> (while path-list
Fabrice> (if (equal (substring (car path-list) -16)
"xemacs-packages/")
Fabrice> (setq top-dir (car path-list)))
Fabrice> (setq path-list (cdr path-list))))
Fabrice> ((eq type 'mule)
Fabrice> (while path-list
Fabrice> (if (equal (substring (car path-list) -14)
"mule-packages/")
Fabrice> (setq top-dir (car path-list)))
Fabrice> (setq path-list (cdr path-list)))))))
Fabrice> But on win32, the path-list returned has '\\' as path separator.
So that
Fabrice> just can't match. Possible fix attached.
Fabrice> Other related questions:
Fabrice> - what is the status of 'mule' packages wrt to 21.5+Mule? I guess
Fabrice> mule-ucs and mule-base packages are not needed anymore (integrated). But
Fabrice> what about the others (locale, latin-unity ...) and what about their
Fabrice> location? Shouldn't they move into xemacs-packages/ in 21.5 since
Mule
Fabrice> is considered to be the default?
Fabrice> --
Fabrice> Fabrice
Fabrice> C:\>diff -u xemacs\xemacs-21.5\lisp\package-admin.el
xemacs\xemacs-21.5\lisp\package-admin.el
Fabrice> --- xemacs\xemacs-21.5\lisp\package-admin.el Mon Mar 24 17:43:55 2003
Fabrice> +++ xemacs\xemacs-21.5\lisp\package-admin.el Wed Apr 09 10:29:54 2003
Fabrice> @@ -170,21 +170,21 @@
Fabrice> ;; First, check the environment var.
Fabrice> (if env-value
Fabrice> (let ((path-list (paths-decode-directory-path env-value
'drop-empties)))
Fabrice> (cond ((eq type 'std)
Fabrice> (while path-list
Fabrice> - (if (equal (substring (car path-list) -16)
"xemacs-packages/")
Fabrice> + (if (string-match "xemacs-packages[/\\]$"
(car path-list))
Fabrice> (setq top-dir (car path-list)))
Fabrice> (setq path-list (cdr path-list))))
Fabrice> ((eq type 'mule)
Fabrice> (while path-list
Fabrice> - (if (equal (substring (car path-list) -14)
"mule-packages/")
Fabrice> + (if (string-match "mule-packages[/\\]$" (car
path-list))
Fabrice> (setq top-dir (car path-list)))
Fabrice> (setq path-list (cdr path-list)))))))
Fabrice> ;; Wasn't in the environment, try `user-init-directory' if
Fabrice> ;; USER-DIR is non-nil.
Fabrice> (if (and user-dir
Fabrice> (not top-dir))
Fabrice> (cond ((eq type 'std)
Fabrice> (setq top-dir (file-name-as-directory
Fabrice> (expand-file-name
"xemacs-packages" user-init-directory))))
Fabrice> ((eq type 'mule)
Fabrice> @@ -195,14 +195,14 @@
Fabrice> (let ((path-list (nth 1 (packages-find-packages
Fabrice> emacs-data-roots
Fabrice> (packages-compute-package-locations
user-init-d
Fabrice> irectory)))))
Fabrice> (cond ((eq type 'std)
Fabrice> (while path-list
Fabrice> - (if (equal (substring (car path-list) -16)
"xemacs-packages/")
Fabrice> + (if (string-match "xemacs-packages[/\\]$"
(car path-list))
Fabrice> (setq top-dir (car path-list)))
Fabrice> (setq path-list (cdr path-list))))
Fabrice> ((eq type 'mule)
Fabrice> (while path-list
Fabrice> - (if (equal (substring (car path-list) -14)
"mule-packages/")
Fabrice> + (if (string-match "mule-packages[/\\]$" (car
path-list))
Fabrice> (setq top-dir (car path-list)))
Fabrice> (setq path-list (cdr path-list)))))))
Fabrice> ;; Now return either the directory or nil.
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/