Commit graph

8972 commits

Author SHA1 Message Date
Andrea Corallo
95692f6754 Rename native-comp-deferred-compilation-deny-list
* lisp/emacs-lisp/comp.el (native-comp-jit-compilation-deny-list)
	(native-compile-async-skip-p): Rename
	native-comp-deferred-compilation-deny-list into
	native-comp-jit-compilation-deny-list.
	(native-comp-deferred-compilation-deny-list): Mark it obsolete.
2023-02-13 17:06:13 +01:00
Andrea Corallo
8d8464bd5a Rename native-comp-deferred-compilation into native-comp-jit-compilation
* src/comp.c (maybe_defer_native_compilation, syms_of_comp):
	Rename native-comp-deferred-compilation into
	native-comp-jit-compilation.

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

	* lisp/startup.el (native-comp-deferred-compilation)
	(normal-top-level): Rename native-comp-deferred-compilation into
	native-comp-jit-compilation.

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

	* lisp/emacs-lisp/generate-lisp-file.el
	(generate-lisp-file-trailer): Likewise.
2023-02-13 17:04:22 +01:00
Andrea Corallo
5d0912f144 Rename comp-enable-subr-trampolines into native-comp-enable-subr-trampolines
* src/data.c (Ffset): Rename comp-enable-subr-trampolines into
	native-comp-enable-subr-trampolines.

	* src/comp.c (syms_of_comp): Likewise.

	* lisp/subr.el (comp-enable-subr-trampolines): Make
	comp-enable-subr-trampolines obsolete.

	* lisp/startup.el (native-comp-enable-subr-trampolines)
	(normal-top-level): Rename comp-enable-subr-trampolines into
	native-comp-enable-subr-trampolines.

	* lisp/loadup.el (dump-mode): Likewise.

	* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install)
	(comp--trampoline-abs-filename): Likewise.
2023-02-13 17:02:38 +01:00
Andrea Corallo
abfd00e5c0 * lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions): Improve doc 2023-02-13 12:49:05 +01:00
Andrea Corallo
1795839bab Support `comp-enable-subr-trampolines' as string value
* src/comp.c (syms_of_comp): Update `comp-enable-subr-trampolines'.

* lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions)
(comp--trampoline-abs-filename): Support
`comp-enable-subr-trampolines' string value.

* src/data.c (Ffset): Use Vcomp_enable_subr_trampolines now.
2023-02-13 12:48:09 +01:00
Andrea Corallo
b6e2799aa1 * Some more `inhibit-native-compile' clean-up
* lisp/emacs-lisp/generate-lisp-file.el (generate-lisp-file-trailer):
Use `native-comp-deferred-compilation'.
2023-02-13 11:44:28 +01:00
Andrea Corallo
c0681cd347 Revert "Add new variable 'inhibit-native-compilation'"
This reverts commit 5fec9182db.
2023-02-13 10:19:31 +01:00
Andrea Corallo
3969a34fa1 Revert "Rename to inhibit-automatic-native-compilation"
This reverts commit f97993ee66.
2023-02-13 10:15:33 +01:00
Philip Kaludercic
2da05876ed ; Use the right name when specifying VC packages
* lisp/emacs-lisp/package-vc.el
(package-vc-install-selected-packages): Generate dummy package
descriptors in here, if necessary.
(package-vc--unpack): Remove dummy-descriptor generation.
2023-02-12 14:30:14 +01:00
Philip Kaludercic
d4fc701297 Tolerate missing elpa-packages.eld files
* lisp/emacs-lisp/package-vc.el
(package-vc--download-and-read-archives): Replace
'condition-case-unless-debug' with a regular 'condition-case'.

It appears a few people using third-party archives that don't serve
package specifications have been having issues with package-vc, when
toggle-on-error is enabled.  In their case, package-vc would raise an
error in its first invocation, but it would go on working normally
afterwards.  As this behaviour is confusing and the user can't do much
about a missing elpa-packages.eld to begin with, we satisfy ourselves
with printing out a message and continuing on.
2023-02-12 13:26:52 +01:00
Philip Kaludercic
3d17aee13d ; Fix installation of dependencies for VC packages
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies):
Maintain a list of package-desc objects instead of package names to
install.
2023-02-12 13:11:03 +01:00
Nicolas Martyanoff
67c6ec2559 lisp-mode: add docstring recognition for more common lisp symbols
* lisp/emacs-lisp/lisp-mode.el (define-compiler-macro)
(define-setf-expander, deftype): Add the 'doc-string-elt'
property for proper docstring highlighting in Common Lisp.
2023-02-09 16:09:28 +02:00
Eli Zaretskii
4d3428e95a Fix docstring fontification of CL's 'defstruct'
* lisp/emacs-lisp/lisp-mode.el (defstruct): Set 'doc-string'
property.  Patch by Nicolas Martyanoff <nicolas@n16f.net>.

Copyright-paperwork-exempt: yes
2023-02-02 20:12:02 +02:00
Eli Zaretskii
56e8607dc9 Fix spurious errors on Windows when deleting temporary *.eln files
* lisp/emacs-lisp/comp.el (comp--native-compile): On MS-Windows,
ignore errors when deleting a temporary .eln file.  (Bug#60996)
2023-01-29 09:44:53 +02:00
Philip Kaludercic
161706ec33 ; Actually use dummy package descriptor
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Set pkg-desc if
nil.

This revises the changes from 70947da708.
2023-01-21 19:27:38 +01:00
Michael Heerdegen
4fb7b0b0b8 Fix an oversight in advice.el
This fixes an oversight from 77c3c464a1: "* lisp/emacs-lisp/advice.el
(ad-advised-functions): Make it a plain list" that caused an issue as
reported in Bug#60893.
* lisp/emacs-lisp/advice.el (ad-read-advised-function): Adjust to
handle the new type of elements of `ad-advised-functions'.
2023-01-19 22:13:25 +02:00
Ikumi Keita
1798ff5a66 ; Fix minor mistakes in documentation
* lisp/emacs-lisp/cl-macs.el (cl-letf): Correct Info reference.

* doc/lispref/strings.texi (String Conversion): Fix typo.

(Bug#60926)
2023-01-18 14:28:59 +02:00
Eli Zaretskii
09e9d7c749 Fix display of warnings on w32 console
* lisp/emacs-lisp/warnings.el (warnings-suppress): Use alternative
symbol for TTY frames on MS-Windows.
2023-01-17 15:44:51 +02:00
Eli Zaretskii
2a2b1d09ac Fix minor issues with 'pp' and related commands
* etc/NEWS:
* lisp/emacs-lisp/pp.el (pp-use-max-width, pp-emacs-lisp-code):
Mention in doc string that formatting via 'pp-emacs-lisp-code'
could be slow.
(pp-eval-expression, pp-macroexpand-expression): Honor
'pp-use-max-width'.  (Bug#58687)
2023-01-13 10:39:58 +02:00
Stefan Kangas
f27a330b99 ; Fix typo in ert-with-temp-file
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Fix typo.
Reported by F. Jason Park <jp@neverwas.me>.  (Bug#60730)
2023-01-13 02:50:39 +01:00
Philip Kaludercic
384504edf3 Ensure VC package names are not empty
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Raise an error
if the package name is empty.
(package-vc-install): Avoid generating an empty file name, if a URL
ends with a slash, and raise an error if the package name is empty.
2023-01-11 09:28:40 +01:00
Philip Kaludercic
70947da708 Handle missing package description when unpacking vc packages
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Create a dummy
descriptor if PKG-DESC is nil.
2023-01-11 09:28:40 +01:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Stefan Kangas
9292f595a7 ; Fix typos 2022-12-31 12:43:32 +01:00
Stefan Kangas
43c7e05a2a Fix misspelled functions in shortdoc groups
* lisp/emacs-lisp/shortdoc.el (file, list): Fix misspelled function
names: 'file-writable-p' and 'seq-reduce'.
* test/lisp/emacs-lisp/shortdoc-tests.el (subr-x): Require.
(shortdoc-all-functions-fboundp): New test.
2022-12-31 12:40:01 +01:00
Philip Kaludercic
637f5b164f ; Add "src" to the heuristic sub-directory heuristic
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check for "src"
directories, next to "lisp".
2022-12-27 21:23:38 +01:00
Kyle Meyer
6c86faec29 loaddefs-gen: Group results by absolute file name
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.
2022-12-26 14:55:08 +02:00
Gregory Heytings
6c00d126e7 Remove remaining mentions of 'eval-current-buffer'
* lisp/emacs-lisp/edebug.el (edebug-all-defs):
* doc/lispref/eval.texi (Eval):
* doc/lispref/edebug.texi (Instrumenting, Edebug Options):
Remove remaining mentions of 'eval-current-buffer', obsoleted in
Emacs 22 and removed in Emacs 26.
2022-12-26 02:26:47 +01:00
Eli Zaretskii
dad73e4de1 ; Review and fix NEWS and related documentation
* etc/NEWS: Fix wording, punctuation, and markup.

* lisp/emacs-lisp/subr-x.el (string-glyph-split): Doc fix.

* doc/lispref/display.texi (Displaying Messages): Document
'set-message-functions'.
2022-12-25 14:54:33 +02:00
Philip Kaludercic
940ab2423c ; Always consider :lisp-dir when locating main file of VC packages
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Check the
:lisp-dir entry in the "extras" of a package description to find the
directory with a main file.
2022-12-25 11:21:01 +01:00
Philip Kaludercic
9ab98cd42a Add heuristic to locate lisp code in source packages
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check if a
"lisp" directory exists and use that instead of PKG-DIR.

(Bug#60155)
2022-12-25 11:21:01 +01:00
Philip Kaludercic
e8b34109ee Reorder optional arguments to 'package-vc-install'
* lisp/emacs-lisp/package-vc.el (package-vc-install-selected-packages):
Update 'package-vc-install' invocation.
(package-vc-install): Reorder and update documentation.
2022-12-25 09:53:07 +01:00
Philip Kaludercic
b38e56d8a9 Handle missing dependencies for source packages
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies): Add
new function.
(package-vc--unpack-1): Call 'package-vc-install-dependencies' instead
of 'package-compute-transaction' and 'package-download-transaction'.

It is unreasonable to abort the installation, since we cannot expect
all dependencies to be available in the regular archives.  Instead we
note which packages couldn't be found, and warn the user that these
will be missing.
2022-12-25 09:36:01 +01:00
Philip Kaludercic
7bc7b6b4dd ; Partial revert of f3e7820b
* lisp/emacs-lisp/package.el (package-install-from-archive): Check if
a package is a directory package, not a VC package
2022-12-25 09:36:01 +01:00
Xi Lu
84888080ee Add more functions to "string" shortdoc
* lisp/emacs-lisp/shortdoc.el: Add 'string-or-null-p',
'char-or-string-p', 'char-uppercase-p'.  (Bug#60279)
2022-12-24 09:55:22 +02:00
Richard Hansen
286c48137f ert-x: Move window selection logic to its own macro
* lisp/emacs-lisp/ert-x.el (ert-with-buffer-selected): New macro to
temporarily display a buffer in a selected window and evaluate a body.
(ert-with-test-buffer-selected): Use the new macro.
* test/lisp/whitespace-tests.el
(ert-test-with-buffer-selected/current)
(ert-test-with-buffer-selected/selected)
(ert-test-with-buffer-selected/nil-buffer)
(ert-test-with-buffer-selected/modification-hooks)
(ert-test-with-buffer-selected/read-only)
(ert-test-with-buffer-selected/return-value): Add tests.
(Bug#60189)
2022-12-24 09:14:23 +02:00
Richard Hansen
823c49cea8 ; ert-x: Simplify `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected):
Simplify using 'ert-with-test-buffer'.  (Bug#60189)
2022-12-24 09:12:12 +02:00
Andrea Corallo
e59216d3be * Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)
* lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'.
(comp-run-async-workers): Likewise.
2022-12-21 23:29:33 +01:00
Eli Zaretskii
5a245bc786 Prevent Abort dialogs from async-compiling jobs on Windows
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Disable Abort
dialog popping in the sub-processes that perform async
compilation, by passing w32-disable-abort-dialog=t on their
command line.
2022-12-17 20:35:11 +02:00
Eli Zaretskii
de2239a584 Revert "alist-get testfn argument evaluation correction"
This reverts commit 17d65c99cd.

Please don't install unnecessary improvements on the release
branch.
2022-12-16 19:29:30 +02:00
Eli Zaretskii
856d889f3a Revert "Elide broken but unnecessary if optimisations"
This reverts commit 13aa376e93.

Please don't install anything on the release branch that is
not a clear bugfix for a known bug.
2022-12-16 19:27:33 +02:00
Mattias Engdegård
13aa376e93 Elide broken but unnecessary if optimisations
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
Remove explicit clauses purposing to simplify

    (if X nil t) -> (not X)
    (if X t nil) -> (not (not X))

but never did so because of a coding mistake (eq instead of equal),
found by a recently added warning.  They weren't actually needed
thanks to the optimiser's fixpoint iteration: we eventually get the
same results through

    (if X nil t) -> (if (not X) t nil) -> (if (not X) t) -> (not X)
    (if X t nil) -> (if X t) -> (not (not X))
2022-12-16 17:17:23 +01:00
Mattias Engdegård
17d65c99cd alist-get testfn argument evaluation correction
* lisp/emacs-lisp/gv.el (alist-get):
Evaluate TESTFN exactly once (previously up to 3 times).
Reduce the macro-expansion to include a call to either assoc or assq,
not both; this reduces the generated code size in some cases.
2022-12-16 17:17:23 +01:00
Philip Kaludercic
367022f316 Ensure package directories for source packages from checkouts
* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Set the :dir entry, since `package-vc--unpack-1' assumes the field is
set, as is the case when invoking `package-vc--unpack'.
2022-12-15 18:31:13 +01:00
Stefan Kangas
a15cd55044 ; Don't quote nil in comments 2022-12-15 02:35:00 +01:00
Mattias Engdegård
2d96a18cd0 ; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commit 2022-12-14 14:06:46 +01:00
Mattias Engdegård
0cc199f1a6 Better shortdoc examples
* lisp/emacs-lisp/shortdoc.el
(symbol, comparison): New.
(string, list, number): Remove or change examples that do not have
well-defined results, such as `eq` on strings or floats.
Edit other examples for better illustrating each respective operation.
2022-12-14 12:20:46 +01:00
Mattias Engdegård
931d97bf56 Shortdoc: read and evaluate strings after :eval
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function):
If the parameter of :eval is a string then read, evaluate and print
the result.  This was always the intention and is documented behaviour.
2022-12-14 12:16:28 +01:00
Stefan Kangas
def51dd645 ; Fix typos 2022-12-13 18:44:41 +01:00
Stefan Kangas
3e349ee119 Fix error message when installing non-existent package
* lisp/emacs-lisp/package.el (package-compute-transaction): Don't add
trailing dash to package name in non-existent package
error.  (Bug#59923)
2022-12-11 19:02:44 +01:00