diff options
author | Glenn Morris <rgm@gnu.org> | 2017-05-09 13:03:04 -0400 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2017-05-09 13:03:04 -0400 |
commit | d6d5020c2593a1e8ac2fe7ef4f217cfbcacfd32d (patch) | |
tree | b789728cd6a11281d5f5735c4490b28a94bbc3df /lisp/emacs-lisp/package.el | |
parent | 4c08509b3a250781039b9f957a9615ea9afe6aa9 (diff) | |
download | emacs-d6d5020c2593a1e8ac2fe7ef4f217cfbcacfd32d.tar.gz |
Don't duplicate autoload code in package.el
* lisp/emacs-lisp/autoload.el (autoload-rubric): Add a package option.
* lisp/emacs-lisp/package.el (autoload-rubric): Declare.
(package-autoload-ensure-default-file): Use autoload-rubric.
Diffstat (limited to 'lisp/emacs-lisp/package.el')
-rw-r--r-- | lisp/emacs-lisp/package.el | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7ae7ffff1a7..c0ecb0447f3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -905,25 +905,13 @@ untar into a directory named DIR; otherwise, signal an error." nil pkg-file nil 'silent)))) ;;;; Autoload -;; From Emacs 22, but changed so it adds to load-path. +(declare-function autoload-rubric "autoload" (file &optional type feature)) + (defun package-autoload-ensure-default-file (file) "Make sure that the autoload file FILE exists and if not create it." (unless (file-exists-p file) - (write-region - (concat ";;; " (file-name-nondirectory file) - " --- automatically extracted autoloads\n" - ";;\n" - ";;; Code:\n" - ;; `load-path' should contain only directory names - "(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))\n" - "\n;; Local Variables:\n" - ";; version-control: never\n" - ";; no-byte-compile: t\n" - ";; no-update-autoloads: t\n" - ";; End:\n" - ";;; " (file-name-nondirectory file) - " ends here\n") - nil file nil 'silent)) + (require 'autoload) + (write-region (autoload-rubric file "package" nil) nil file nil 'silent)) file) (defvar generated-autoload-file) |