comparison lisp/emacs-lisp/autoload.el @ 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 7b72e141f1ad
children 410395998370
comparison
equal deleted inserted replaced
4067:379b03502e48 4068:5126824061ef
120 ;; `update-autoloads-here' won't be able to find the files to be 120 ;; `update-autoloads-here' won't be able to find the files to be
121 ;; autoloaded. So, if FILE is in the same directory or a 121 ;; autoloaded. So, if FILE is in the same directory or a
122 ;; subdirectory of the current buffer's directory, we'll make it 122 ;; subdirectory of the current buffer's directory, we'll make it
123 ;; relative to the current buffer's directory. 123 ;; relative to the current buffer's directory.
124 (setq file (expand-file-name file)) 124 (setq file (expand-file-name file))
125 (if (and (< (length default-directory) (length file)) 125 (let ((source-truename (file-truename file))
126 (string= default-directory 126 (dir-truename (file-name-as-directory
127 (substring file 0 (length default-directory)))) 127 (file-truename default-directory))))
128 (progn 128 (if (and (< (length dir-truename) (length source-truename))
129 (setq file (substring file (length default-directory))))) 129 (string= dir-truename
130 (substring source-truename 0 (length dir-truename))))
131 (setq file (substring file (length dir-truename)))))
130 132
131 (message "Generating autoloads for %s..." file) 133 (message "Generating autoloads for %s..." file)
132 (save-excursion 134 (save-excursion
133 (unwind-protect 135 (unwind-protect
134 (progn 136 (progn