Commit graph

21 commits

Author SHA1 Message Date
Lars Ingebrigtsen
49e41991b2 Allow ;;;###autoloading transient-define-prefix
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Allow ;;;###autoloading
transient-define-prefix (bug#48694).

* lisp/transient.el (transient-define-prefix): Autoload.
2022-07-16 12:40:12 +02:00
Stefan Kangas
41e612cfd6 ; Fix typos 2022-07-14 12:52:32 +02:00
Lars Ingebrigtsen
2736e61274 Fix define-obsolete-function-alias formatting in loaddefs-gen.el
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form):
Fix formatting of define-obsolete-function-alias statements
(bug#56292).
2022-06-30 21:33:46 +02:00
Michael Heerdegen
406fd97921 Fix autoload generation of iter-defun forms
This fixes Bug#54648.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Add `iter-defun' and `cl-iter-defun' to the list of "complex cases"
that are macro-expanded and recursed on.
2022-06-21 19:50:10 +02:00
Lars Ingebrigtsen
a53c34d76a Don't quote the `when' form in obsoletions
* lisp/emacs-lisp/byte-run.el (byte-run--set-obsolete): The `when'
is a string (or nil), so don't quote it (bug#48145).
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form):
Adjust folding.
2022-06-17 18:12:38 +02:00
Lars Ingebrigtsen
0d383b592c Fix ;;;###autoload scanning from (some) packages
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Fix autoloads scanning from packages.
2022-06-15 14:05:17 +02:00
Lars Ingebrigtsen
ad432c1644 Fix loaddefs installation of packages with no autoloads
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Always
generate an output file if we have EXTRA-DATA.  This fixes package
installation of packages with no ;;;###autoload forms.
2022-06-11 18:13:27 +02:00
Lars Ingebrigtsen
7815ebd25f Fix loaddefs-generate--rubric recorded name
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Fix
the name that's recorded in the file -- this is only used by
loaddefs-gen now, I think.
2022-06-07 18:51:15 +02:00
Lars Ingebrigtsen
8c00e21df2 Move two more variables from autoload.el to loaddefs-gen.el
* lisp/emacs-lisp/loaddefs-gen.el (generated-autoload-file)
(generated-autoload-load-name): Move the remaining two autoload.el
variables used by loaddefs-gen.el from autoload.el.
2022-06-05 20:32:01 +02:00
Lars Ingebrigtsen
98d454627c Rename generate-file to generate-lisp-file
* lisp/url/url-cookie.el (url-cookie-write-file):
* lisp/international/titdic-cnv.el (tit-process-header)
(miscdic-convert):
* lisp/international/ja-dic-cnv.el (skkdic-convert):
* lisp/international/emoji.el (emoji--generate-file):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Adjust callers.

* lisp/emacs-lisp/generate-lisp-file.el: Renamed from
generate-file.el.  Also rename some keyword parameters and require
a generator function.
2022-06-05 17:48:39 +02:00
Lars Ingebrigtsen
9d2f4a8d5a Add convenience functions for generating Emacs Lisp files
* lisp/url/url-cookie.el (url-cookie-write-file):
* lisp/international/titdic-cnv.el (tit-process-header):
* lisp/international/ja-dic-cnv.el (skkdic-convert):
* lisp/international/emoji.el (emoji--generate-file):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric)

* admin/unidata/unidata-gen.el (unidata-gen-file)
(unidata-gen-charprop): Use the new functions.

* lisp/emacs-lisp/generate-file.el: New file to provide
convenience functions for generated files.  It's not always
trivial to know which parts of the trailer that has to be
obfuscated to avoid not getting byte-compiled etc, and some parts
of the headers/trailers are usually forgotten when hand-coding
these.
2022-06-05 16:36:34 +02:00
Lars Ingebrigtsen
e74652386d Make loaddefs-generate--parse-file more robust
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Ensure that we don't have an autoload cookie on the first column
inside a string.
2022-06-04 18:41:10 +02:00
Lars Ingebrigtsen
43b0210f83 Fix out-of-tree build problems with loaddefs.el
* lisp/Makefile.in ($(lisp)/loaddefs.el): Use the new function.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Pass in
whether to inhibit a partial build (to make the code more general).
(loaddefs-generate--emacs-batch): Add a new function specially for
the Emacs build that has the special rules needed.  (This also
fixes out-of-tree builds.)
loaddefs-generate-batch can be used in general for packages etc.
(loaddefs-generate-batch): Remove the special code for Emacs builds.
2022-06-02 13:52:58 +02:00
Lars Ingebrigtsen
afc0bfd380 Speed up loaddefs-generate on slow disks
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Make file
update comparisons faster.
2022-06-02 11:13:20 +02:00
Lars Ingebrigtsen
c791a3e9f3 Fix up the loaddefs-gen updating logic
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Only do the
updating logic if we're really updating.
2022-06-01 14:50:16 +02:00
Lars Ingebrigtsen
45e65c7d92 Revert "Fix loaddefs generation"
This reverts commit 28358db930.

This has been fixed in a different way.
2022-06-01 14:14:02 +02:00
Lars Ingebrigtsen
a6322e7f13 Tweak how loaddefs-gen decides whether to do a full update
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Do a
complete build more often to avoid problems with going from old
loaddefs.el files to new ones.
2022-06-01 12:55:16 +02:00
Po Lu
28358db930 Fix loaddefs generation
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Prevent
one kind of string match error.
2022-06-01 18:21:41 +08:00
Lars Ingebrigtsen
7d1c44c2b3 Fix the loaddefs updating logic
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Fix the
logic of updating -- we update per loaddefs file.
2022-05-31 22:49:12 +02:00
Lars Ingebrigtsen
89404b4f69 Make partial loaddefs updates work again
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Only update
the loaddefs section for the files that have changed.  This makes
"git pull" (when few/no Lisp files have changed much faster).
2022-05-31 20:08:27 +02:00
Lars Ingebrigtsen
1d4e903417 Speed up generation of loaddefs files
* doc/lispref/loading.texi (Autoload, Autoload by Prefix): Refer
to loaddefs-generate instead of update-file-autoloads.

* lisp/Makefile.in (LOADDEFS): Remove, because all the loaddefs
files are created in one go now.
(COMPILE_FIRST): Add loaddefs-gen/radix-tree, and drop autoload.
($(lisp)/loaddefs.el): Use loaddefs-gen.
(MH_E_DIR, $(TRAMP_DIR)/tramp-loaddefs.el)
($(MH_E_DIR)/mh-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el)
($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): Remove.

* lisp/generic-x.el: Inhibit computing prefixes, because the
namespace here is all wonky.

* lisp/w32-fns.el (w32-batch-update-autoloads): Removed -- unused
function.

* lisp/calendar/holidays.el ("holiday-loaddefs"): Renamed from
hol-loaddefs to have a more regular name.

* lisp/cedet/ede/proj-elisp.el (ede-emacs-cedet-autogen-compiler):
Refer to loaddefs-gen instead of autoload.

* lisp/emacs-lisp/autoload.el (make-autoload, autoload-rubric)
(autoload-insert-section-header): Made into aliases of
loaddefs-gen functions.
(autoload--make-defs-autoload): Ditto.
(autoload-ignored-definitions, autoload-compute-prefixes): Moved
to loaddefs-gen.

* lisp/emacs-lisp/lisp-mode.el (lisp-mode-autoload-regexp): New
constant.
(lisp-fdefs, lisp-mode-variables, lisp-outline-level): Use it to
recognize all ;;;###autoload forms.

* lisp/emacs-lisp/loaddefs-gen.el: New file.

* lisp/emacs-lisp/package.el: Use loaddefs-generate instead of
make-directory-autoloads.

* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-faulty-bzr-autoloads):
Use loaddefs instead of autoloads.
2022-05-31 18:08:33 +02:00