mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-05 03:39:38 +00:00
(autoload-trim-file-name): Make it relative
to the directory that loaddefs.el is in.
This commit is contained in:
parent
ddb5032903
commit
1eb0a345ce
1 changed files with 10 additions and 11 deletions
|
@ -96,12 +96,14 @@ the section of autoloads for a file.")
|
|||
(put 'defmacro 'doc-string-elt 3)
|
||||
|
||||
(defun autoload-trim-file-name (file)
|
||||
;; Returns a relative pathname of FILE including the last directory.
|
||||
;; Returns a relative pathname of FILE
|
||||
;; starting from the directory that loaddefs.el is in.
|
||||
;; That is normally a directory in load-path,
|
||||
;; which means Emacs will be able to find FILE when it looks.
|
||||
;; Any extra directory names here would prevent finding the file.
|
||||
(setq file (expand-file-name file))
|
||||
(file-relative-name file
|
||||
(file-name-directory
|
||||
(directory-file-name
|
||||
(file-name-directory file)))))
|
||||
(file-name-directory generated-autoload-file)))
|
||||
|
||||
(defun generate-file-autoloads (file)
|
||||
"Insert at point a loaddefs autoload section for FILE.
|
||||
|
@ -333,14 +335,11 @@ Update sections of the current buffer generated by \\[update-file-autoloads]."
|
|||
(or (get-file-buffer file)
|
||||
(file-exists-p file)))
|
||||
()
|
||||
(message "Can't find library \"%s\" (load file \"%s\")"
|
||||
(nth 2 form) file)
|
||||
(sit-for 2)
|
||||
(setq file (if (y-or-n-p (format "Remove autoloads for \"%s\"? "
|
||||
(nth 2 form)))
|
||||
(setq file (if (y-or-n-p (format "Can't find library `%s'; remove its autoloads? "
|
||||
(nth 2 form) file))
|
||||
t
|
||||
(condition-case ()
|
||||
(read-file-name (format "Find \"%s\" load file: "
|
||||
(read-file-name (format "Find `%s' load file: "
|
||||
(nth 2 form))
|
||||
nil nil t)
|
||||
(quit nil)))))
|
||||
|
@ -369,7 +368,7 @@ Update sections of the current buffer generated by \\[update-file-autoloads]."
|
|||
Runs \\[update-file-autoloads] on files and \\[update-directory-autoloads]
|
||||
on directories. Must be used only with -batch, and kills Emacs on completion.
|
||||
Each file will be processed even if an error occurred previously.
|
||||
For example, invoke \"emacs -batch -f batch-update-autoloads *.el\""
|
||||
For example, invoke `emacs -batch -f batch-update-autoloads *.el'."
|
||||
(if (not noninteractive)
|
||||
(error "batch-update-autoloads is to be used only with -batch"))
|
||||
(let ((lost nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue