changeset 4385:7a8c613ee283

Don't call substitute-in-file-name haphazardly. 2008-01-04 Michael Sperber <mike@xemacs.org> * code-files.el (insert-file-contents): (load): Don't call `substitute-in-file-name' on the file name.
author Mike Sperber <sperber@deinprogramm.de>
date Sat, 05 Jan 2008 16:19:37 +0100
parents c7e65155cb35
children 4363b75330ca
files lisp/ChangeLog lisp/code-files.el
diffstat 2 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jan 05 16:13:04 2008 +0100
+++ b/lisp/ChangeLog	Sat Jan 05 16:19:37 2008 +0100
@@ -1,3 +1,8 @@
+2008-01-04  Michael Sperber  <mike@xemacs.org>
+
+        * code-files.el (insert-file-contents):
+        (load): Don't call `substitute-in-file-name' on the file name.
+
 2008-01-03  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* cus-edit.el (custom-save-all): 
--- a/lisp/code-files.el	Sat Jan 05 16:13:04 2008 +0100
+++ b/lisp/code-files.el	Sat Jan 05 16:19:37 2008 +0100
@@ -235,10 +235,10 @@
 
 ;(defun convert-mbox-coding-system (filename visit start end) ...)
 
-(defun load (file &optional noerror nomessage nosuffix)
-  "Execute a file of Lisp code named FILE, or load a binary module.
-First tries to find a Lisp FILE with .elc appended, then with .el, then with
- FILE unmodified.  If unsuccessful, tries to find a binary module FILE with
+(defun load (filename &optional noerror nomessage nosuffix)
+  "Execute a file of Lisp code named FILENAME, or load a binary module.
+First tries to find a Lisp file FILENAME with .elc appended, then with .el, then with
+ FILENAME unmodified.  If unsuccessful, tries to find a binary module FILE with
  the elements of `module-extensions' appended, one at a time.
 Searches directories in load-path for Lisp files, and in `module-load-path'
  for binary modules.
@@ -250,9 +250,8 @@
  .elc, .el, or elements of `module-extensions' to the specified name FILE.
 Return t if file exists."
   (declare (special load-modules-quietly))
-  (let* ((filename (substitute-in-file-name file))
-	 (handler (find-file-name-handler filename 'load))
-	 (path nil))
+  (let ((handler (find-file-name-handler filename 'load))
+	(path nil))
     (if handler
 	(funcall handler 'load filename noerror nomessage nosuffix)
       ;; First try to load a Lisp file
@@ -262,10 +261,10 @@
 					    '(".elc" ".el" "")))))
 	  ;; now use the internal load to actually load the file.
 	  (load-internal
-	   file noerror nomessage nosuffix
+	   filename noerror nomessage nosuffix
 	   (let ((elc ; use string= instead of string-match to keep match-data.
-		(equalp ".elc" (substring path -4))))
-	     (or (and (not elc) coding-system-for-read) ;prefer for source file
+		  (equalp ".elc" (substring path -4))))
+	     (or (and (not elc) coding-system-for-read)	;prefer for source file
 		 ;; find magic-cookie
 		 (let ((codesys
 			(find-coding-system-magic-cookie-in-file path)))
@@ -401,8 +400,7 @@
 See also `insert-file-contents-access-hook',
 `insert-file-contents-pre-hook', `insert-file-contents-error-hook',
 and `insert-file-contents-post-hook'."
-  (let* ((expanded (substitute-in-file-name filename))
-	 (handler (find-file-name-handler expanded 'insert-file-contents)))
+  (let ((handler (find-file-name-handler filename 'insert-file-contents)))
     (if handler
 	(funcall handler 'insert-file-contents filename visit start end replace)
       (let (return-val coding-system used-codesys)