53 lines
2.1 KiB
EmacsLisp
53 lines
2.1 KiB
EmacsLisp
|
||
|
||
;; autoloads for single .el file in this directory
|
||
;; https://stackoverflow.com/a/4189794
|
||
;; (load-file (concat config-dir "lisp/update-autoloads.el"))
|
||
;; `update-autoloads-in-package-area' will generate -autoloads.el
|
||
;; files and create a loaddefs.el
|
||
;; (load-file (concat config-dir "lisp/loaddefs.el"))
|
||
|
||
;; put this path into the load-path automatically
|
||
;;;###autoload
|
||
(progn
|
||
(setq load-path (cons (file-name-directory load-file-name) load-path)))
|
||
|
||
;;;###autoload
|
||
(defun update-autoloads-in-package-area (&optional file)
|
||
"Update autoloads for files in the diretory containing this file."
|
||
(interactive)
|
||
(let ((base (file-truename
|
||
(file-name-directory
|
||
(symbol-file 'update-autoloads-in-package-area 'defun)))))
|
||
(require 'autoload) ;ironic, i know
|
||
(let ((generated-autoload-file (concat base "loaddefs.el")))
|
||
(when (not (file-exists-p generated-autoload-file))
|
||
(with-current-buffer (find-file-noselect generated-autoload-file)
|
||
(insert ";;") ;; create the file with non-zero size to appease autoload
|
||
(save-buffer)))
|
||
(cd base)
|
||
(if file
|
||
(update-file-autoloads file)
|
||
;; (update-autoloads-from-directories base) ;; renamed to update-directory-autoloads
|
||
(update-directory-autoloads base)))))
|
||
|
||
;;;###autoload
|
||
(defun update-autoloads-for-file-in-package-area (file)
|
||
(interactive "f")
|
||
(update-autoloads-in-package-area file))
|
||
|
||
|
||
;; autoloads for all sub-directories
|
||
|
||
;;;###autoload
|
||
(defun update-autoloads-sub-packages (&optional file)
|
||
(package-generate-autoloads "all-the-icons" (concat config-dir "lisp/all-the-icons"))
|
||
(package-generate-autoloads "dashboard" (concat config-dir "lisp/dashboard"))
|
||
(package-generate-autoloads "ivy" (concat config-dir "lisp/ivy"))
|
||
(package-generate-autoloads "ivy-rich" (concat config-dir "lisp/ivy-rich"))
|
||
(package-generate-autoloads "my" (concat config-dir "lisp/my"))
|
||
;; (package-generate-autoloads "org" (concat config-dir "lisp/org")) ;; already org-loaddefs.el
|
||
(package-generate-autoloads "org-contrib" (concat config-dir "lisp/org-contrib"))
|
||
(package-generate-autoloads "swiper" (concat config-dir "lisp/swiper"))
|
||
)
|