changeset 4068:5126824061ef

* autoload.el (generate-file-autoloads): Correctly detect when the buffer receiving the autoload forms is in a parent of or the same directory as FILE, even in the presence of symlinks.
author Jim Blandy <jimb@redhat.com>
date Tue, 13 Jul 1993 03:21:39 +0000
parents 379b03502e48
children 643048c8e307
files lisp/emacs-lisp/autoload.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/autoload.el	Tue Jul 13 02:20:40 1993 +0000
+++ b/lisp/emacs-lisp/autoload.el	Tue Jul 13 03:21:39 1993 +0000
@@ -122,11 +122,13 @@
     ;; subdirectory of the current buffer's directory, we'll make it
     ;; relative to the current buffer's directory.
     (setq file (expand-file-name file))
-    (if (and (< (length default-directory) (length file))
-	     (string= default-directory
-		      (substring file 0 (length default-directory))))
-	(progn
-	  (setq file (substring file (length default-directory)))))
+    (let ((source-truename (file-truename file))
+	  (dir-truename (file-name-as-directory
+			 (file-truename default-directory))))
+      (if (and (< (length dir-truename) (length source-truename))
+	       (string= dir-truename
+			(substring source-truename 0 (length dir-truename))))
+	  (setq file (substring file (length dir-truename)))))
 
     (message "Generating autoloads for %s..." file)
     (save-excursion