summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-07-13 03:21:39 +0000
committerJim Blandy <jimb@redhat.com>1993-07-13 03:21:39 +0000
commitae553cad8eb06bcc13193680e00c3683a4656b3e (patch)
tree278bbf8d93cc62d48976630f269a8a84627e89fd /lisp/emacs-lisp
parent8537f1cb3a43db01d230c71be6a5ee482810919d (diff)
downloademacs-ae553cad8eb06bcc13193680e00c3683a4656b3e.tar.gz
emacs-ae553cad8eb06bcc13193680e00c3683a4656b3e.tar.bz2
emacs-ae553cad8eb06bcc13193680e00c3683a4656b3e.zip
* 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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/autoload.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 940bc118e46..10f614f48c1 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -122,11 +122,13 @@ are used."
;; 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