[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5fc064f14c 2/5: Handle ; ; ; ###theme-autoload comments in etc/th
From: |
Philip Kaludercic |
Subject: |
master 5fc064f14c 2/5: Handle ; ; ; ###theme-autoload comments in etc/themes |
Date: |
Sat, 15 Oct 2022 11:23:26 -0400 (EDT) |
branch: master
commit 5fc064f14c0e76bf15b7528ef6ef3771ad169aba
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Handle ;;;###theme-autoload comments in etc/themes
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch):
Extract the autoloads and have them loaded along with loaddefs.el.
* etc/NEWS: Mention the new feature. (Bug#57639)
---
etc/NEWS | 5 +++++
lisp/emacs-lisp/loaddefs-gen.el | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/etc/NEWS b/etc/NEWS
index 62004c10a6..041fe0bdbd 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2846,6 +2846,11 @@ Previously, ';;;###' specs inside a top-level form
(i.e., something
like '(when ... ;;;### ...)' would be ignored. They are now parsed as
normal.
+---
+** Themes have special autoload cookies.
+All build-in themes are scraped for ;;;###theme-autoload cookies that
+are loaded along with the regular auto-loaded code.
+
+++
** 'buffer-modified-p' has been extended.
This function was previously documented to return only nil or t. This
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index d2654fb206..a1c4f91579 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -736,7 +736,14 @@ rules for built-in packages and excluded files."
;; updated.
(file-newer-than-file-p
(expand-file-name "emacs-lisp/loaddefs-gen.el" lisp-directory)
- output-file))))
+ output-file)))
+ (let ((lisp-mode-autoload-regexp
+ "^;;;###\\(\\(noexist\\)-\\)?\\(theme-autoload\\)"))
+ (loaddefs-generate
+ (expand-file-name "../etc/themes/" lisp-directory)
+ (expand-file-name "theme-loaddefs.el" lisp-directory))))
+
+;;;###autoload (load "theme-loaddefs.el")
(provide 'loaddefs-gen)