[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: locate-library doesn't find new compressed el.gz files
From: |
Stefan Monnier |
Subject: |
Re: locate-library doesn't find new compressed el.gz files |
Date: |
Wed, 02 Nov 2005 11:34:25 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> (locate-library "cc-mode.el") erroneously returns nil, not noticing that
> the cc-mode.el.gz exists.
Good point.
The patch below should fix that, but I'm not sure if it's the right thing.
Calling (locate-library "foo" nil) when auto-compression-mode is OFF tries
"foo.elc", "foo.el" and "foo" while (locate-library "foo" t) only tries
"foo".
Now when auto-compression-mode is ON what should they try?
(locate-library "foo" nil) should probably try "foo.elc", "foo.elc.gz",
"foo.el", "foo.el.gz", "foo.gz", and "foo", as the patch below does.
But what about (locate-library "foo" t)? Should it try only "foo" (as the
batch below does) or should it also try "foo.gz"?
Stefan
--- orig/lisp/jka-cmpr-hook.el
+++ mod/lisp/jka-cmpr-hook.el
@@ -229,11 +229,12 @@
;; Make sure that (load "foo") will find /bla/foo.el.gz.
(setq load-suffixes
(apply 'append
- (mapcar (lambda (suffix)
- (cons suffix
- (mapcar (lambda (ext) (concat suffix ext))
- jka-compr-load-suffixes)))
- load-suffixes))))
+ (append (mapcar (lambda (suffix)
+ (cons suffix
+ (mapcar (lambda (ext) (concat suffix ext))
+ jka-compr-load-suffixes)))
+ load-suffixes)
+ (list jka-compr-load-suffixes)))))
(defun jka-compr-installed-p ()