summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/loaddefs-gen.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix loaddef generation with ";;;foo-autoload" cookies in external packagesJim Porter2023-08-041-1/+2
| | | | | | | | | | This caused an issue where package-specific autoload cookies weren't being correctly recognized, so they got dumped into the package's main "<pkg>-autoloads.el" file, instead of "<pkg>-loaddefs.el" as they should (bug#65023). * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file): Save match data when checking syntax.
* Ensure that EXTRA-DATA are always written when generating autoloadsPhilip Kaludercic2023-05-121-1/+14
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Handle edge-case where no autoloads are found. (Bug#63260)
* Make loaddefs-generate slightly more tolerantRobert Pluim2023-05-041-2/+5
| | | | | | | | | There are packages in the wild, such as vlf-20191126.2250, which have entries that are not terminated by three ';', but by two. Tolerate such entries. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Search for two ';' as a delimiter, not three. (Bug#63236)
* Prevent generating empty autoload filesPhilip Kaludercic2023-04-301-66/+56
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Remove optimisation that would mistakenly discard old loaddefs in case a file was not modified by EXTRA-DATA is non-nil. (Bug#62734)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* loaddefs-gen: Group results by absolute file nameKyle Meyer2022-12-261-1/+2
| | | | | | | | | | | | | | | loaddefs-generate produced an incomplete output file if 1) it was called with a relative file name and 2) that same file was specified via a generated-autoload-file cookie in a subset of the input files. In that case, autoload entries were lost because loaddefs-generate writes the same output file twice: once for the relative name specified by the caller and once for the absolute name that loaddefs-generate--parse-file returns for the generated-autoload-file value. This has been fixed. (Bug#60318) * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Expand file names when grouping loaddef files.
* Fix generation of autoloads on MS-WindowsEli Zaretskii2022-11-261-15/+20
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--file-load-name): Handle the case when FILE and OUTFILE don't share any common ancestor directory. (Bug#59507)
* Fix previous loaddefs-gen fixLars Ingebrigtsen2022-10-181-3/+2
|
* Fix faulty loaddefs detectionLars Ingebrigtsen2022-10-181-1/+2
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch): Fix faulty loaddefs detection.
* Handle ;;;###theme-autoload comments in etc/themesPhilip Kaludercic2022-10-151-1/+8
| | | | | | * 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)
* Tag themes with propertiesPhilip Kaludercic2022-10-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'. * doc/lispref/customize.texi (Custom Themes): Document the new optional argument to 'deftheme'. (Autoload): Mention that 'deftheme' is not copied verbatim. * etc/themes/adwaita-theme.el (adwaita): Add properties. * etc/themes/deeper-blue-theme.el (deeper-blue): Add properties. * etc/themes/dichromacy-theme.el (dichromacy): Add properties. * etc/themes/light-blue-theme.el (light-blue): Add properties. * etc/themes/manoj-dark-theme.el (manoj-dark): Add properties. * etc/themes/misterioso-theme.el (misterioso): Add properties. * etc/themes/tango-dark-theme.el (tango-dark): Add properties. * etc/themes/tango-theme.el (tango): Add properties. * etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties. * etc/themes/tsdh-light-theme.el (tsdh-light): Add properties. * etc/themes/wheatgrass-theme.el (wheatgrass): Add properties. * etc/themes/whiteboard-theme.el (whiteboard): Add properties. * etc/themes/wombat-theme.el (wombat): Add properties. * etc/themes/modus-operandi-theme.el: Add properties. * etc/themes/modus-vivendi-theme.el: Add properties. * etc/themes/leuven-dark-theme.el (leuven-dark): Add properties. * etc/themes/leuven-theme.el (leuven): Add properties. * lisp/custom.el (deftheme): Allow for optional arguments to set the property list. (custom-declare-theme): Accept the same optional arguments as 'deftheme'. (theme-list-variants): Add new function. (theme-choose-variant): Add new command for switching between members of a theme family. (toggle-theme): Add an alias for 'theme-choose-variant'. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Handle 'defcustom's by extracting the properties. (Bug#57639)
* Make loaddefs-generate more resilientLars Ingebrigtsen2022-10-041-1/+1
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't bug out when there's an existing loaddefs file that's not formatted properly (bug#58280).
* Make loaddefs-gen register parent :groups from defcustomLars Ingebrigtsen2022-09-231-2/+6
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Also register parent :groups from `defgroup' entries (bug#58015).
* ; Fix doc string of 'loaddefs-generate'Eli Zaretskii2022-09-151-2/+2
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix. (Bug#57815)
* Revert "; Fix doc string of 'loaddefs-generate'"Eli Zaretskii2022-09-151-2/+2
| | | | | This reverts commit 5fe9a1a85ae6d54196031157a735352f6ab655ff. It included unrelated changes.
* ; Fix doc string of 'loaddefs-generate'Eli Zaretskii2022-09-151-2/+2
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix. (Bug#57815)
* Inhibit nativecomp of loaddefs filesLars Ingebrigtsen2022-09-031-0/+1
| | | | | | | | * lisp/emacs-lisp/generate-lisp-file.el (generate-lisp-file-trailer): Allow inhibiting nativecomp. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Inhibit native-comp, because it's not very useful for loaddefs files.
* Make GEN message from loaddefs-generate nicerLars Ingebrigtsen2022-08-181-1/+2
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Shorten the informational GEN file relative to the stated directory (bug#57265). This makes the message nicer for ELPA packages.
* Fix up the exclusion logic in loaddefs-generateLars Ingebrigtsen2022-08-151-10/+9
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Allow excluding files completely (bug#57144).
* Tweak autoloads of defsubsts containing spaces/control charsLars Ingebrigtsen2022-08-151-1/+3
| | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form): Escape control chars in bodies so that we don't end up with trailing spaces if we're autoloading a defsubst containing "\\`[ \t\n\r]*\\'".
* Allow EXCLUDED-FILES in loaddefs-generate to be relativeLars Ingebrigtsen2022-08-131-0/+5
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Allow the excluded files to be relative (bug#57144).
* Don't update loaddefs.el timestamps uselessly in loaddefs-generateLars Ingebrigtsen2022-08-121-4/+8
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't re-write the loaddefs.el file when there's no reason to.
* ; Fix documentation of 'loaddefs-generate' (bug#57144)Eli Zaretskii2022-08-121-6/+12
| | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix.
* Make the loaddefs.el file slightly shorterLars Ingebrigtsen2022-08-091-18/+28
| | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--shorten-autoload): New function. (loaddefs-generate--make-autoload): Use it to drop optional nil values from the `autoloads' forms. This makes the loaddefs.el file about 12K shorter.
* Allow newline after def*-form for definition-prefixStefan Kangas2022-08-051-1/+2
| | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add another semantic function. (loaddefs-generate--compute-prefixes): Allow newline after the "(def*" form. (Bug#57000)
* Be more lax when picking up prefixes for loaddefsStefan Kangas2022-08-041-1/+1
| | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--compute-prefixes): Allow tabs and spaces before symbol name, so that "(defvar\tfoo-bar nil)" is properly picked up. Before this change, such a definition would be wrongly picked up as the symbol "nil".
* Minor cleanups in autoload.el/loaddefs-gen.elLars Ingebrigtsen2022-08-041-21/+3
| | | | | | | | | | | | | * lisp/subr.el (package--builtin-versions): Adjust comments. * lisp/emacs-lisp/loaddefs-gen.el (no-update-autoloads): Moved here from autoload.el. * lisp/emacs-lisp/loaddefs-gen.el: Removed now that it's no longer used. * lisp/emacs-lisp/package.el (package-autoload-ensure-default-file): Don't warn about soon-to-be obsolete functon.
* Add define-keymap to autoload-ignored-definitionsLars Ingebrigtsen2022-08-041-1/+1
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Ignore `define-keymap', too (bug#56973).
* Add define-key-after to autoload-ignored-definitionsStefan Kangas2022-08-041-2/+4
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add define-key-after and define-ibuffer-sorter.
* Add more autoload-ignored-definitionsStefan Kangas2022-08-041-1/+2
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add define-ibuffer-column.
* Add more autoload-ignored-definitions defsLars Ingebrigtsen2022-08-041-1/+4
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (autoload-ignored-definitions): Add more definition forms that shouldn't trigger prefix registration (bug#56970).
* Adjust loaddefs-generate--print-form commentsLars Ingebrigtsen2022-08-041-6/+7
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form): Adjust doc string and comments now that make-docfile doesn't scan this.
* Byte-compile the in-tree loaddefs.el filesLars Ingebrigtsen2022-08-031-1/+2
| | | | | | | | | | | | | | | | | * lisp/Makefile.in (all): Add "autoloads", which now otherwise won't be done. ($(lisp)/loaddefs.el): Remove this target, since it's always done, and would then trigger a re-compilation of loaddefs.elc. * lisp/loadup.el: Load loaddefs.elc (if it exists). * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't include no-byte-compile cookies in the Emacs build. * src/Makefile.in ($(pdmp)): Depend on loaddefs.elc to ensure that it's built by this point. ($(etc)/DOC): Don't scan loaddefs.el for doc strings, since they are now picked up from the .elc file (bug#53024).
* Allow specifying that loaddefs files shouldn't not be compiledLars Ingebrigtsen2022-07-311-2/+5
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Allow specifying that we shouldn't include a no-compile cookie (bug#53024).
* Remove loaddefs debug codeLars Ingebrigtsen2022-07-311-1/+0
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Remove code inadvertantly checked in.
* Fix cl byte-compile warning in cl-loaddefs.elLars Ingebrigtsen2022-07-311-0/+1
| | | | | | * lisp/emacs-lisp/cl-macs.el (cl--optimize) (cl-struct-sequence-type, cl-struct-slot-offset): Autoload since they are referred to by code in cl-loaddefs.el.
* Allow ;;;###autoloading transient-define-prefixLars Ingebrigtsen2022-07-161-1/+2
| | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Allow ;;;###autoloading transient-define-prefix (bug#48694). * lisp/transient.el (transient-define-prefix): Autoload.
* ; Fix typosStefan Kangas2022-07-141-2/+2
|
* Fix define-obsolete-function-alias formatting in loaddefs-gen.elLars Ingebrigtsen2022-06-301-1/+2
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form): Fix formatting of define-obsolete-function-alias statements (bug#56292).
* Fix autoload generation of iter-defun formsMichael Heerdegen2022-06-211-1/+1
| | | | | | | | 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.
* Don't quote the `when' form in obsoletionsLars Ingebrigtsen2022-06-171-0/+1
| | | | | | | * 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.
* Fix ;;;###autoload scanning from (some) packagesLars Ingebrigtsen2022-06-151-1/+5
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file): Fix autoloads scanning from packages.
* Fix loaddefs installation of packages with no autoloadsLars Ingebrigtsen2022-06-111-50/+62
| | | | | | * 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.
* Fix loaddefs-generate--rubric recorded nameLars Ingebrigtsen2022-06-071-1/+1
| | | | | | * 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.
* Move two more variables from autoload.el to loaddefs-gen.elLars Ingebrigtsen2022-06-051-0/+25
| | | | | | * 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.
* Rename generate-file to generate-lisp-fileLars Ingebrigtsen2022-06-051-8/+9
| | | | | | | | | | | | | | | * 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.
* Add convenience functions for generating Emacs Lisp filesLars Ingebrigtsen2022-06-051-26/+15
| | | | | | | | | | | | | | | | | | * 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.
* Make loaddefs-generate--parse-file more robustLars Ingebrigtsen2022-06-041-36/+43
| | | | | | * 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.
* Fix out-of-tree build problems with loaddefs.elLars Ingebrigtsen2022-06-021-16/+23
| | | | | | | | | | | | * 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.
* Speed up loaddefs-generate on slow disksLars Ingebrigtsen2022-06-021-1/+5
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Make file update comparisons faster.