Commit graph

8711 commits

Author SHA1 Message Date
Andrea Corallo
56c63ca21b * Fix async native compilation (bug#58637)
* lisp/emacs-lisp/comp.el (comp--native-compile): Fix gate condition.
(comp-run-async-workers): Add assetion.
2022-10-19 22:21:03 +02:00
Stefan Monnier
c5e2566774 (byte-compile--first-symbol-with-pos): Fix bug#58601
* lisp/emacs-lisp/bytecomp.el: Require `subr-x`.
(byte-compile--first-symbol-with-pos): Avoid inf-loops on circular data.
2022-10-18 10:49:43 -04:00
Lars Ingebrigtsen
6cabef8799 Fix previous loaddefs-gen fix 2022-10-18 13:17:52 +02:00
Lars Ingebrigtsen
86581698ac Fix faulty loaddefs detection
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--emacs-batch): Fix faulty loaddefs detection.
2022-10-18 13:14:08 +02:00
Andrea Corallo
1a8015b837 * Prevent potential native compilation infinite recursions
* lisp/emacs-lisp/comp.el (comp-no-spawn): New var.
(comp-subr-trampoline-install, comp-final, comp-run-async-workers)
(comp--native-compile): Update.
2022-10-18 10:42:13 +02:00
Stefan Kangas
eff4a4f49a Improve native-compile-prune-cache messages
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Quote name of
pruned directory.
2022-10-17 15:28:25 +02:00
Stefan Kangas
40b734c500 Don't prune *.eln files in parent of eln-load-path
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't
prune *.eln files in parent directory of `native-comp-eln-load-path'.
* test/lisp/emacs-lisp/comp-tests.el
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
New test.
2022-10-17 15:26:34 +02:00
Lars Ingebrigtsen
b9aff5fdb8 Fix spurious "Compilation finished" native-comp messages
* lisp/emacs-lisp/comp.el (native--compile-async): Don't start the
async compilation if we didn't add anything.  This avoids spurious
"Compilation finished" messages in the *Async* buffer when it
turned out that all the files we considered nativecomping were
skipped.
2022-10-17 14:30:54 +02:00
Lars Ingebrigtsen
5176d00611 Avoid having the async compile log saying it's compiling loaddefs
* lisp/loadup.el (featurep): Define the hash table in nativecomp
builds (but not otherwise).  A more natural place to define this
would be in comp.el, but comp.el isn't loaded yet when we load the
.elc file that updates comp--no-native-compile.  We could change
the load order and move the definition to comp.el, though.

* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Allow
inhibiting nativecomp earlier (bug#57627).

* lisp/emacs-lisp/comp.el (native-compile-async-skip-p): Use the data.
2022-10-17 10:48:20 +02:00
Stefan Monnier
13d6e8fa54 cl-generic: Fix advertised-calling-convention declarations
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method):
Preserve the `advertised-calling-convention`, if any (bug#58563).

* lisp/subr.el (declare): Warn when we hit this.

* lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun.
* lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string):
* lisp/help-fns.el (help-fns--signature):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun.
(cl-generic-tests--advertised-calling-convention-bug58563): New test.
2022-10-16 12:01:47 -04:00
Philip Kaludercic
5fc064f14c
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)
2022-10-15 17:22:48 +02:00
Philip Kaludercic
da2e6da722
Tag themes with properties
* 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)
2022-10-15 17:22:48 +02:00
Stefan Kangas
8300899953 Use file-size-human-readable in memory-report--format
* lisp/emacs-lisp/memory-report.el (memory-report--format): Use
file-size-human-readable.
2022-10-15 03:02:17 +02:00
Andrea Corallo
3744720904 Add trampoline AOT compilation target (bug#58318)
* Makefile.in (trampolines): New target.
* lisp/Makefile.in (trampolines): Likewise.
* lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New
function.
2022-10-11 21:19:21 +02:00
Stefan Monnier
8de7995ae6 package.el: Understand a few more variations in tarball formats
* lisp/emacs-lisp/package.el (package-untar-buffer): Fix thinko.
(package-tar-file-info): Handle the case where the first file is in
a subdirectory.

* test/lisp/emacs-lisp/package-tests.el (package-test-bug58367): New test.
* test/lisp/emacs-lisp/package-resources/ustar-withsub-0.1.tar:
* test/lisp/emacs-lisp/package-resources/v7-withsub-0.1.tar: New files.
2022-10-08 12:19:40 -04:00
Lars Ingebrigtsen
5017f2573f Fix vtable-insert-object line insertion
* lisp/emacs-lisp/vtable.el (vtable-insert-object): Pass in the
correct ellipsis values (bug#58370).
(vtable--insert-line): Don't bug out on missing optional arguments.
2022-10-08 15:26:01 +02:00
Lars Ingebrigtsen
6b56099268 Mention seq-keep in shortdoc
* lisp/emacs-lisp/shortdoc.el (sequence): Mention seq-keep.
2022-10-08 13:20:17 +02:00
Stefan Kangas
89ccf78db2 ; Silence byte-compiler in benchmark.el
* lisp/emacs-lisp/benchmark.el (cl-lib): Require.
2022-10-07 23:15:13 +02:00
Mattias Engdegård
6b4c17dec0 Clearer byte-compiler arity warnings (bug#58319)
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-signature-string):
Replace '3+' and '3-4' with '3 or more' and '3 or 4', respectively.
2022-10-07 13:57:54 +02:00
Stefan Kangas
6c956de80a Improve package-check-signature docstring
* lisp/emacs-lisp/package.el (package-check-signature): Improve
docstring.
2022-10-07 11:27:26 +02:00
Matt Armstrong
e24f276f8a Fix calling `package-reinstall' just after quick initialization.
* lisp/emacs-lisp/package.el (package-reinstall): call
`package--archives-initialize', just like `package-install' does.
This populates `package-alist', and so fixes calling
`package-reinstall' as the first thing done after package "quick
init" (Bug#53527).
2022-10-06 14:08:20 +02:00
Lars Ingebrigtsen
92df7cd923 Add 'seq-keep'
* doc/lispref/sequences.texi (Sequence Functions): Document it.
* lisp/emacs-lisp/seq.el (seq-keep): New function (bug#58278).
2022-10-04 21:44:52 +02:00
Lars Ingebrigtsen
79d9f3b845 Make `eq' obsolete as a generalized variable
* lisp/emacs-lisp/gv.el (eq): Make obsolete as a generalized
variable.
2022-10-04 14:11:13 +02:00
Lars Ingebrigtsen
9fb0aaa1ce Make loaddefs-generate more resilient
* 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).
2022-10-04 13:04:16 +02:00
Lars Ingebrigtsen
535eec3bca Don't bug out in advice--make-docstring when there's not doc string
* lisp/emacs-lisp/nadvice.el (advice--make-docstring): Don't bug
out on functions with no documentation (bug#58284).
2022-10-04 12:50:17 +02:00
Jim Porter
43eaa05ff2 ; Fix logic of $HOME adjustment for 'ert-remote-temporary-file-directory'
* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory): Only
adjust $HOME when it doesn't exist (bug#58265).
2022-10-03 17:42:37 -07:00
Lars Ingebrigtsen
f97993ee66 Rename to inhibit-automatic-native-compilation
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Lars Ingebrigtsen
5fec9182db Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.

* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.

* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.

* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.

* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.

* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Stefan Kangas
655c92ce4a Fix more overly long docstrings in eieio
* lisp/emacs-lisp/eieio.el (defclass): Fix more overly long
docstrings.  (Bug#58252)
2022-10-03 00:04:23 +02:00
Stefan Kangas
0a40120b40 Fix overly wide docstrings generated by eieio
* lisp/emacs-lisp/eieio-core.el (eieio-make-class-predicate)
(eieio-make-child-predicate, eieio-defclass-internal): Don't generate
overly wide docstrings.  (Bug#58252)
2022-10-02 17:28:04 +02:00
Stefan Kangas
423bdd5f7f ; Fix typos (prefer American spelling) 2022-09-29 15:20:07 +02:00
Lin Sun
ec121e035b package-update would always re-install package
* lisp/emacs-lisp/package.el (package--updateable-packages): fix
version comparison between available packages and archived
packages (bug#58129).
2022-09-28 13:05:26 +02:00
Richard Hansen
29b7d74000 ert-x: Improve realism of `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): Set
`inhibit-read-only' and `buffer-read-only' to nil when executing the
body to provide a more realistic test environment.
2022-09-27 13:43:53 +02:00
Lars Ingebrigtsen
e2f2f6b9e8 Fix percentage width computation in vtable
* lisp/emacs-lisp/vtable.el (vtable--compute-width): Fix
percentage computation (bug#58067).
2022-09-26 13:28:30 +02:00
Eli Zaretskii
76b7a59367 ; Clarify wording of some doc strings in shortdoc.el
* lisp/emacs-lisp/shortdoc.el (shortdoc-next, shortdoc-previous)
(shortdoc-next-section, shortdoc-previous-section): Clarify
wording.
2022-09-25 22:49:32 +03:00
Mattias Engdegård
b55b2f1c31 Boolean constant detection additions
* lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form):
`set` is boolean identity in its second argument.
(byte-compile-trueconstp): `set-marker` is always true.
2022-09-25 18:05:13 +02:00
Stefan Kangas
f761869a56 Add :buffer argument to ert-with-temp-file
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Add new keyword
argument :buffer SYMBOL to visit the file with `find-file-literally'
before running the body, and cleaning up after.
2022-09-25 16:16:30 +02:00
Stefan Kangas
489bca19b7 Improve shortdoc documentation
* doc/emacs/help.texi (Name Help):
* doc/lispref/help.texi (Documentation Groups): Refer to
'shortdoc' convenience alias instead of 'shortdoc-display-group'.
* lisp/emacs-lisp/shortdoc.el: Add Commentary.
(shortdoc-next, shortdoc-previous)
(shortdoc-next-section, shortdoc-previous-section): Doc fixes.
2022-09-25 14:35:10 +02:00
Stefan Kangas
971566e88a Fix shortdoc movement commands
* lisp/emacs-lisp/shortdoc.el (shortdoc--goto-section): Don't skip
over current function or section when searching.
2022-09-25 14:27:44 +02:00
Stefan Kangas
e589690781 Add new command 'shortdoc-copy-function-as-kill'
* lisp/emacs-lisp/shortdoc.el
(shortdoc-copy-function-as-kill): New command.
(shortdoc-mode-map): Bind above new command to "w".
2022-09-25 13:48:52 +02:00
Stefan Kangas
3af2f9cce3 Bind "N"/"P" to next/prev section in shortdoc
* lisp/emacs-lisp/shortdoc.el (shortdoc-mode-map): Bind "N" and
"P" to 'shortdoc-next-section' and 'shortdoc-previous-section'.
2022-09-25 13:38:22 +02:00
Juri Linkov
8574ae625e * lisp/emacs-lisp/icons.el (icons--create): Use default rotation 0 (bug#57813) 2022-09-24 20:17:28 +03:00
Lars Ingebrigtsen
b7fb82bc41 Remove "manual" package--builtin-versions updates
* lisp/emacs-lisp/nadvice.el:
* lisp/emacs-lisp/cl-generic.el: Don't push to
package--builtin-versions "manually", because loaddefs-gen does
this correctly now.
2022-09-24 16:51:53 +02:00
Lars Ingebrigtsen
06de788529 Tweak how :override advice is formatted in *Help*
* lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Format
:overrides specially (bug#57974).
(advice--make-docstring): Put overrides at the front.
2022-09-24 14:06:26 +02:00
Lars Ingebrigtsen
bbd7059da4 Rename file-name-directory
* lisp/emacs-lisp/shortdoc.el (file-name):
* doc/lispref/files.texi (Directory Names): Adjust.
* lisp/files.el (file-name-parent-directory): Rename from
`file-name-directory' (bug#58039).
2022-09-24 12:44:44 +02:00
Stefan Kangas
8a224e5124 * lisp/emacs-lisp/shortdoc.el (file-name): Improve examples. 2022-09-24 11:26:06 +02:00
Stefan Monnier
40bc027bf4 * lisp/emacs-lisp/eieio.el (defclass): Fix bug#51068
Accept (defclass <class> <superclasses> (.. <slotname> ..)) without
having to wrap the slot name within parentheses.
2022-09-23 17:42:55 -04:00
Stefan Monnier
c244d4af57 cconv.el: Fix interactive closure bug#51695
Make cconv.el detect when a closure's interactive form needs to
capture variables from the context and tweak the code accordingly
if so.

* lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var.
(cconv-convert): Handle the case where the interactive form captures
vars from the surrounding context.  Remove left over handling of
`declare` which was already removed from the cconv-analyze` phase.
(cconv-analyze-form): Adjust analysis of interactive forms accordingly.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and
function.
* lisp/simple.el (function-documentation, oclosure-interactive-form):
Add methods for it.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): New test.
2022-09-23 16:36:16 -04:00
Lars Ingebrigtsen
212e94c3f4 Make loaddefs-gen register parent :groups from defcustom
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Also register parent :groups from
`defgroup' entries (bug#58015).
2022-09-23 17:58:41 +02:00
Mattias Engdegård
e4964de952 Don't rewrite set to setq of lexical variables
Only perform the rewrite

   (set 'VAR X) -> (setq VAR X)

for dynamic variables, as `set` isn't supposed to affect
lexical vars (and never does so when interpreted).

* lisp/emacs-lisp/byte-opt.el (byte-optimize-set):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New.
(bytecomp-tests--test-cases): Add test cases.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el:
Remove obsolete test.
2022-09-22 14:54:15 +02:00