comparison lisp/setup-paths.el @ 5003:6b6b0f8ab749

#'union doesn't preserve relative order; use #'delete-duplicates instead. 2010-02-07 Aidan Kehoe <kehoea@parhasard.net> * setup-paths.el (paths-find-emacs-roots) (paths-construct-info-path): * packages.el (packages-find-installation-package-directories): #'union doesn't guarantee that it will preserve the relative order of elements in its arguments; use #'delete-duplicates instead. Thank you for the bug reports, Robert Pluim, Stephen Turnbull.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 07 Feb 2010 14:37:35 +0000
parents 9c6ea1581159
children 54700d784be9
comparison
equal deleted inserted replaced
5002:0cd784a6ec44 5003:6b6b0f8ab749
140 (let* ((invocation-roots 140 (let* ((invocation-roots
141 (paths-find-invocation-roots invocation-directory 141 (paths-find-invocation-roots invocation-directory
142 invocation-name 142 invocation-name
143 root-p)) 143 root-p))
144 (potential-installation-roots 144 (potential-installation-roots
145 (union 145 (delete-duplicates
146 (and configure-exec-prefix-directory 146 (append
147 (list (file-name-as-directory 147 (and configure-exec-prefix-directory
148 configure-exec-prefix-directory))) 148 (list (file-name-as-directory
149 (and configure-prefix-directory 149 configure-exec-prefix-directory)))
150 (list (file-name-as-directory 150 (and configure-prefix-directory
151 configure-prefix-directory))) 151 (list (file-name-as-directory
152 configure-prefix-directory))))
152 :test #'equal)) 153 :test #'equal))
153 (installation-roots 154 (installation-roots
154 (remove-if-not root-p potential-installation-roots))) 155 (remove-if-not root-p potential-installation-roots)))
155 (union invocation-roots installation-roots :test #'equal))) 156 (delete-duplicates (nconc invocation-roots installation-roots)
157 :test #'equal)))
156 158
157 (defun paths-find-site-lisp-directory (roots) 159 (defun paths-find-site-lisp-directory (roots)
158 "Find the site Lisp directory of the XEmacs hierarchy. 160 "Find the site Lisp directory of the XEmacs hierarchy.
159 ROOTS is a list of installation roots." 161 ROOTS is a list of installation roots."
160 (paths-find-site-directory roots (list "site-lisp") 162 (paths-find-site-directory roots (list "site-lisp")
258 ROOTS is the list of installation roots. 260 ROOTS is the list of installation roots.
259 EARLY-PACKAGE-HIERARCHIES, LATE-PACKAGE-HIERARCHIES, and 261 EARLY-PACKAGE-HIERARCHIES, LATE-PACKAGE-HIERARCHIES, and
260 LAST-PACKAGE-HIERARCHIES are lists of package hierarchy roots, 262 LAST-PACKAGE-HIERARCHIES are lists of package hierarchy roots,
261 respectively." 263 respectively."
262 (let ((info-path-envval (getenv "INFOPATH"))) 264 (let ((info-path-envval (getenv "INFOPATH")))
263 (union 265 (delete-duplicates
264 (append 266 (nconc
265 (let ((info-directory 267 (append
266 (paths-find-version-directory roots (list "info") 268 (let ((info-directory
267 nil nil 269 (paths-find-version-directory roots (list "info")
268 configure-info-directory))) 270 nil nil
269 (and info-directory 271 configure-info-directory)))
270 (list info-directory))) 272 (and info-directory
271 (packages-find-package-info-path early-package-hierarchies) 273 (list info-directory)))
272 (packages-find-package-info-path late-package-hierarchies) 274 (packages-find-package-info-path early-package-hierarchies)
273 (packages-find-package-info-path last-package-hierarchies) 275 (packages-find-package-info-path late-package-hierarchies)
274 (and info-path-envval 276 (packages-find-package-info-path last-package-hierarchies)
275 (paths-decode-directory-path info-path-envval 'drop-empties))) 277 (and info-path-envval
276 (and (null info-path-envval) 278 (paths-decode-directory-path info-path-envval 'drop-empties)))
277 (union 279 (and (null info-path-envval)
278 (paths-directories-which-exist configure-info-path) 280 (delete-duplicates
279 (paths-directories-which-exist paths-default-info-directories) 281 (nconc
280 :test #'equal)) 282 (paths-directories-which-exist configure-info-path)
283 (paths-directories-which-exist paths-default-info-directories))
284 :test #'equal)))
281 :test #'equal))) 285 :test #'equal)))
282 286
283 (defun paths-find-doc-directory (roots) 287 (defun paths-find-doc-directory (roots)
284 "Find the documentation directory. 288 "Find the documentation directory.
285 ROOTS is the list of installation roots." 289 ROOTS is the list of installation roots."