diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/autoload.el | 42 | ||||
-rw-r--r-- | lisp/emacs-lisp/trace.el | 1 |
2 files changed, 34 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 38956df66de..c3aaa905afd 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -812,14 +812,40 @@ write its autoloads into the specified file instead." (setq files (delete file files))))) ;; Elements remaining in FILES have no existing autoload sections yet. (dolist (file files) - (cond - ((member (expand-file-name file) autoload-excludes) nil) - ;; Passing nil as second argument forces - ;; autoload-generate-file-autoloads to look for the right - ;; spot where to insert each autoloads section. - ((autoload-generate-file-autoloads file nil buffer-file-name) - (push file no-autoloads)))) - + (unless (member (expand-file-name file) autoload-excludes) + ;; Passing nil as second argument forces + ;; autoload-generate-file-autoloads to look for the right + ;; spot where to insert each autoloads section. + (let ((obuf + (autoload-generate-file-autoloads file nil buffer-file-name)) + ofile ofound oform opoint) + (when obuf + (push file no-autoloads) + ;; Did processing file update some other ofile? + (when (bufferp obuf) + (with-current-buffer obuf + (setq ofile (file-relative-name buffer-file-name))) + ;; Did we already scan ofile? + (and (member ofile done) + (not (member ofile no-autoloads)) + (save-excursion + (goto-char (point-min)) + (while + (and + (not ofound) + (search-forward + generate-autoload-section-header nil t)) + (setq opoint (point) + oform (autoload-read-section-header)) + (when (setq ofound + (string= ofile (nth 3 oform))) + (delete-region opoint (point)) + (autoload-insert-section-header + (current-buffer) + (nth 1 oform) + (nth 2 oform) + (nth 3 oform) + (nth 5 (file-attributes ofile)))))))))))) (when no-autoloads ;; Sort them for better readability. (setq no-autoloads (sort no-autoloads 'string<)) diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index 872bf86e545..1c0f6e7dc54 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el @@ -139,7 +139,6 @@ :prefix "trace-" :group 'lisp) -;;;###autoload (defcustom trace-buffer "*trace-output*" "Trace output will by default go to that buffer." :type 'string) |