diff options
| author | Richard M. Stallman | 1994-05-12 18:54:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-12 18:54:57 +0000 |
| commit | 1eb0a345cee16ea78c2e20ce70955a529b3e7ef6 (patch) | |
| tree | c76b0f8988a8f284a73ccff49615696746d49058 | |
| parent | ddb5032903aa5552aa121bcc67f792ec7b081ff0 (diff) | |
| download | emacs-1eb0a345cee16ea78c2e20ce70955a529b3e7ef6.tar.gz emacs-1eb0a345cee16ea78c2e20ce70955a529b3e7ef6.zip | |
(autoload-trim-file-name): Make it relative
to the directory that loaddefs.el is in.
| -rw-r--r-- | lisp/emacs-lisp/autoload.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 551bba03923..08884c5bb03 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -96,12 +96,14 @@ the section of autoloads for a file.") | |||
| 96 | (put 'defmacro 'doc-string-elt 3) | 96 | (put 'defmacro 'doc-string-elt 3) |
| 97 | 97 | ||
| 98 | (defun autoload-trim-file-name (file) | 98 | (defun autoload-trim-file-name (file) |
| 99 | ;; Returns a relative pathname of FILE including the last directory. | 99 | ;; Returns a relative pathname of FILE |
| 100 | ;; starting from the directory that loaddefs.el is in. | ||
| 101 | ;; That is normally a directory in load-path, | ||
| 102 | ;; which means Emacs will be able to find FILE when it looks. | ||
| 103 | ;; Any extra directory names here would prevent finding the file. | ||
| 100 | (setq file (expand-file-name file)) | 104 | (setq file (expand-file-name file)) |
| 101 | (file-relative-name file | 105 | (file-relative-name file |
| 102 | (file-name-directory | 106 | (file-name-directory generated-autoload-file))) |
| 103 | (directory-file-name | ||
| 104 | (file-name-directory file))))) | ||
| 105 | 107 | ||
| 106 | (defun generate-file-autoloads (file) | 108 | (defun generate-file-autoloads (file) |
| 107 | "Insert at point a loaddefs autoload section for FILE. | 109 | "Insert at point a loaddefs autoload section for FILE. |
| @@ -333,14 +335,11 @@ Update sections of the current buffer generated by \\[update-file-autoloads]." | |||
| 333 | (or (get-file-buffer file) | 335 | (or (get-file-buffer file) |
| 334 | (file-exists-p file))) | 336 | (file-exists-p file))) |
| 335 | () | 337 | () |
| 336 | (message "Can't find library \"%s\" (load file \"%s\")" | 338 | (setq file (if (y-or-n-p (format "Can't find library `%s'; remove its autoloads? " |
| 337 | (nth 2 form) file) | 339 | (nth 2 form) file)) |
| 338 | (sit-for 2) | ||
| 339 | (setq file (if (y-or-n-p (format "Remove autoloads for \"%s\"? " | ||
| 340 | (nth 2 form))) | ||
| 341 | t | 340 | t |
| 342 | (condition-case () | 341 | (condition-case () |
| 343 | (read-file-name (format "Find \"%s\" load file: " | 342 | (read-file-name (format "Find `%s' load file: " |
| 344 | (nth 2 form)) | 343 | (nth 2 form)) |
| 345 | nil nil t) | 344 | nil nil t) |
| 346 | (quit nil))))) | 345 | (quit nil))))) |
| @@ -369,7 +368,7 @@ Update sections of the current buffer generated by \\[update-file-autoloads]." | |||
| 369 | Runs \\[update-file-autoloads] on files and \\[update-directory-autoloads] | 368 | Runs \\[update-file-autoloads] on files and \\[update-directory-autoloads] |
| 370 | on directories. Must be used only with -batch, and kills Emacs on completion. | 369 | on directories. Must be used only with -batch, and kills Emacs on completion. |
| 371 | Each file will be processed even if an error occurred previously. | 370 | Each file will be processed even if an error occurred previously. |
| 372 | For example, invoke \"emacs -batch -f batch-update-autoloads *.el\"" | 371 | For example, invoke `emacs -batch -f batch-update-autoloads *.el'." |
| 373 | (if (not noninteractive) | 372 | (if (not noninteractive) |
| 374 | (error "batch-update-autoloads is to be used only with -batch")) | 373 | (error "batch-update-autoloads is to be used only with -batch")) |
| 375 | (let ((lost nil) | 374 | (let ((lost nil) |