comparison lisp/packages.el @ 5264:0d43872986b6

Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form. lisp/ChangeLog addition: 2010-09-16 Aidan Kehoe <kehoea@parhasard.net> * byte-optimize.el (byte-optimize-apply): Transform (apply 'nconc (mapcar ...)) to (mapcan ...); warn about use of the first idiom. * update-elc.el (do-autoload-commands): * packages.el (packages-find-package-library-path): * frame.el (frame-list): * extents.el (extent-descendants): * etags.el (buffer-tag-table-files): * dumped-lisp.el (preloaded-file-list): * device.el (device-list): * bytecomp-runtime.el (proclaim-inline, proclaim-notinline) Use #'mapcan, not (apply #'nconc (mapcar ...) in all these files. * bytecomp-runtime.el (eval-when-compile, eval-and-compile): In passing, mention that these macros also evaluate the body when interpreted.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 16 Sep 2010 13:51:49 +0100
parents 5efbd1253905
children d27c1ee1943b 308d34e9f07d
comparison
equal deleted inserted replaced
5263:0d436a78c514 5264:0d43872986b6
465 (defun packages-find-package-library-path (package-hierarchies suffixes) 465 (defun packages-find-package-library-path (package-hierarchies suffixes)
466 "Construct a path into a component of the packages hierarchy. 466 "Construct a path into a component of the packages hierarchy.
467 PACKAGE-HIERARCHIES is a list of package hierarchies. 467 PACKAGE-HIERARCHIES is a list of package hierarchies.
468 SUFFIXES is a list of names of hierarchy subdirectories to look for." 468 SUFFIXES is a list of names of hierarchy subdirectories to look for."
469 (let ((directories 469 (let ((directories
470 (apply 470 (mapcan #'(lambda (hierarchy)
471 #'nconc 471 (mapcar #'(lambda (suffix)
472 (mapcar #'(lambda (hierarchy) 472 (file-name-as-directory (concat hierarchy suffix)))
473 (mapcar #'(lambda (suffix) 473 suffixes))
474 (file-name-as-directory (concat hierarchy suffix))) 474 package-hierarchies)))
475 suffixes))
476 package-hierarchies))))
477 (paths-directories-which-exist directories))) 475 (paths-directories-which-exist directories)))
478 476
479 (defun packages-find-package-load-path (package-hierarchies) 477 (defun packages-find-package-load-path (package-hierarchies)
480 "Construct the load-path component for packages. 478 "Construct the load-path component for packages.
481 PACKAGE-HIERARCHIES is a list of package hierarchies." 479 PACKAGE-HIERARCHIES is a list of package hierarchies."