Commit graph

8069 commits

Author SHA1 Message Date
Stefan Monnier
73b15f45f9 Merge remote-tracking branch 'origin/emacs-28' into trunk 2022-01-10 22:34:55 -05:00
Eli Zaretskii
99a9b545f0 Revert "Remove the filename argument from the command line after an ELC+ELN build"
This reverts commit ffc047c896.

Please don't install anything non-trivial on the release branch
without asking first.
2022-01-10 20:02:39 +02:00
Alan Mackenzie
ffc047c896 Remove the filename argument from the command line after an ELC+ELN build
This fixes bug #53164.  Without this fix, bootstrap-emacs loads the source
file uselessly into a buffer after completing the compilation.
2022-01-10 17:05:41 +00:00
Ivan Sokolov
4509095d79 Add doc-string indices to easy-mmode-{defmap,defsyntax}
* lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap)
(easy-mmode-defsyntax): Declare third argument as doc-string.
(Bug#52978)
2022-01-09 16:37:02 +01:00
Eli Zaretskii
e28849eb02 Revert "Fix alignment on font size change in tabulated-list-mode"
This reverts commit 2767c89db7.

That change caused a regression in a much more important use
case, see bug#53133.
2022-01-09 12:38:26 +02:00
Eli Zaretskii
4c724af1e3 ; * lisp/emacs-lisp/package.el (package-native-compile): Fix doc wording. 2022-01-09 10:25:36 +02:00
Stefan Kangas
3984ea8553 Merge from origin/emacs-28
30f1bdb41f Clarify docstring of package-native-compile
c54fda643d Fix Subject "simplification" in Rmail
2022-01-09 06:30:18 +01:00
Stefan Kangas
30f1bdb41f Clarify docstring of package-native-compile
* lisp/emacs-lisp/package.el (package-native-compile): Clarify
docstring.
2022-01-09 03:18:38 +01:00
Stefan Monnier
61f8f7f68f cl-generic.el: Fix bug#46722
Fix longstanding bug due to unexpected interference via side-effect.

* lisp/emacs-lisp/cl-generic.el (cl--generic-get-dispatcher):
Copy the `dispatch` arg before storing it into the hash-table.
2022-01-05 14:28:37 -05:00
Stefan Kangas
d763c12796 Merge from origin/emacs-28
e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el
c0cfbca311 * lisp/emacs-lisp/checkdoc.el (bytecomp): Add missing require

# Conflicts:
#	etc/NEWS
2022-01-05 06:30:39 +01:00
Philipp Stephani
c0cfbca311 * lisp/emacs-lisp/checkdoc.el (bytecomp): Add missing require 2022-01-05 01:41:46 +01:00
Lars Ingebrigtsen
0d315102fe Improve pp-emacs-lisp-code for #'
* lisp/emacs-lisp/pp.el (pp--insert-lisp): Format (function ...)
as #'.
2022-01-04 15:51:04 +01:00
Eli Zaretskii
823b6b8d26 ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Monnier
87f7412418 * lisp/emacs-lisp/package.el (package-get-version): Add fallback 2021-12-31 00:03:35 -05:00
Stefan Monnier
59732a83c8 Don't store docstrings of preloaded .el files in etc/DOC
Since the location of those files changes between build time and
installation time, this requires to tweak the file name used in those
(#$ . NNN) references during the dump so they don't hardcode the build
directory.  We do it in the same way as was already done for those
same file names in `load-history`, except we convert them back to
absolute file names more lazily (i.e. when fetching the actual
docstring rather than at startup), which requires remembering the
`lisp-dir` computed at startup in the new `lisp-directory` variable.

* src/Makefile.in ($(etc)/DOC): Don't scan Lisp files any more.

* src/lread.c (Fload): Use relative file names for `load-file-name`
when preloading for the dump, like we already did for `current-load-list`.
(read_list): Don't zero-out dynamic docstring references during the
preload since they won't be filled later by Snarf-documentation any more.
(read1): Remove the hash-hack for doc references that were zeroed.

* lisp/startup.el (lisp-directory): New variable.
(command-line): Set it.

* src/doc.c (get_doc_string): Use `lisp-directory` for dynamic
docstring references using relative file names.
(syms_of_doc): Add `Qlisp_directory`.

* lib-src/make-docfile.c (scan_file): Don't handle `.el` or `.elc`
files any more.
(IS_SLASH): Remove macro, not used any more.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol)
(scan_lisp_file): Remove functions, not used any more.

* doc/lispref/loading.texi (Library Search): Mention `lisp-directory`.
2021-12-30 23:17:45 -05:00
Philipp Stephani
d0974e294d * lisp/emacs-lisp/ert.el (ert-select-tests): Document new error. 2021-12-30 17:59:07 +01:00
Philipp Stephani
097452efbc * lisp/emacs-lisp/ert.el (ert-select-tests): Simplify nested switch 2021-12-30 17:19:31 +01:00
Philipp Stephani
f6da1eed74 Properly report errors about unbound ERT test symbols.
Assertions should only be used to check internal consistency within a
package, not to check arguments passed by callers.  Instead, define
and use a new error symbol.

* lisp/emacs-lisp/ert.el (ert-test-unbound): New error symbol.
(ert-select-tests): Use it.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-select-undefined): New
unit test.

* etc/NEWS: Document new behavior.
2021-12-30 17:06:09 +01:00
Philipp Stephani
94891dd225 ; * lisp/emacs-lisp/ert.el: Update reference to 'cl-assert' 2021-12-30 16:23:48 +01:00
Andrea Corallo
e7699bf290 * Fix native comp for non trivial function names (bug#52833)
* lisp/emacs-lisp/comp.el (comp-c-func-name): Fix native compilation
for functions with function names containing non trivial
characters (bug#52833).
2021-12-28 15:59:32 +01:00
Stefan Kangas
fb9b7b70f5 Fix read-multiple-choice tests
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Fix typo.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display): Fix tests.
2021-12-28 00:09:08 +01:00
Stefan Kangas
e2a7e5f409 read-multiple-choice: Improve key formatting
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve
formatting of key missing in the description.  Use face help-key-name
on terminals that can't display underline.
2021-12-27 20:35:00 +01:00
Stefan Monnier
d65534d254 * lisp/emacs-list/eieio-compat.el: Really move to obsolete 2021-12-27 01:57:42 -05:00
Stefan Kangas
40dcf9c2ab read-multiple-choice: Display "SPC" instead of " "
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve display
of the keys TAB, RET, SPC, DEL, and ESC.  This fixes a bug where " "
was highlighted in the description in a confusing way.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes): Update tests for the
above change.
2021-12-26 17:05:39 +01:00
Stefan Kangas
1e7786437d read-multiple-choice: Add optional argument show-help
* lisp/emacs-lisp/rmc.el (rmc--show-help): Factor out new function
from read-multiple-choice.
(read-multiple-choice): Add new optional argument show-help.
* doc/lispref/commands.texi (Reading One Event): Document above new
optional argument.
2021-12-26 17:03:53 +01:00
Stefan Kangas
787030b021 read-multiple-choice: Add face when key not in name string
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Add face
property also when key is not in the name string.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display): Update tests.
2021-12-26 17:03:36 +01:00
Stefan Kangas
68f15e815e Factor out new function rmc--add-key-description
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Factor out
new function from...
(read-multiple-choice): ...here.

* test/lisp/emacs-lisp/rmc-tests.el (test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display): New tests.
2021-12-26 15:47:16 +01:00
Eli Zaretskii
97218c311b ; Fix last change: use 'utf-8-emacs-unix' encoding. 2021-12-26 10:20:05 +02:00
Eli Zaretskii
9e45929d7c Minor improvements in multisession.el
* lisp/emacs-lisp/multisession.el (multisession--read-file-value):
Handle 'file-missing' error when reading values from files.
(multisession--backend-values, multisession--backend-set-value)
(multisession--read-file-value): Use 'utf-8-emacs' encoding.
2021-12-26 10:16:40 +02:00
Lars Ingebrigtsen
6def36f216 Use the new `permission-denied' error to catch multisession errors
* lisp/emacs-lisp/multisession.el (multisession--read-file-value):
Use the new `permission-denied' error to catch file errors on Windows.
2021-12-21 05:23:11 +01:00
Stefan Monnier
0c4fc7032a Fix bug#28557
* test/lisp/emacs-lisp/cconv-tests.el: Remove `:expected-result :failed`
from the bug#28557 tests.
(cconv-tests-cl-function-:documentation): Account for the presence of
the arglist (aka "usage") in the docstring.

* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric):
Handle non-constant `:documentation`.

* lisp/emacs-lisp/generator.el (iter-lambda):
* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody):
Use `macroexp-parse-body`.
2021-12-20 22:00:57 -05:00
Mattias Engdegård
de797bb853 ; * lisp/emacs-lisp/cl-macs.el (cl--self-tco): fix bootstrapping 2021-12-20 17:29:51 +01:00
Mattias Engdegård
92ffe44834 Body of dynamic let-bindings is not in tail position
This fixes a known bug in `named-let`.

* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Prevent TCO from inside
dynamic variable bindings.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add test.
2021-12-20 16:26:02 +01:00
Mattias Engdegård
8706f6fde1 Add macroexp--dynamic-variable-p
This predicate can be used for discriminating between lexically and
dynamically bound variables during macro-expansion (only).
It is restricted to internal use for the time being.

* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
Use macroexpand--all-toplevel.
* lisp/emacs-lisp/macroexp.el (macroexp-dynamic-variable-p): New.
(macroexp--expand-all): Maintain macroexp--dynvars.
(macroexpand-all): Rebind macroexp--dynvars.
(macroexpand--all-toplevel): New.
(internal-macroexpand-for-load): Use macroexpand--all-toplevel.
* src/eval.c (eval_sub): Transfer defvar declarations from
Vinternal_interpreter_environment into macroexp--dynvars during
lazy macro-expansion.
* src/lread.c (readevalloop): Rebind macroexp--dynvars around
read-and-evaluate operations.
(syms_of_lread): Define macroexp--dynvars.
* test/lisp/emacs-lisp/macroexp-resources/vk.el: New file.
* test/lisp/emacs-lisp/macroexp-tests.el (macroexp-tests--run-emacs)
(macroexp-tests--eval-in-subprocess)
(macroexp-tests--byte-compile-in-subprocess)
(macroexp--tests-dynamic-variable-p): Add tests.
2021-12-20 16:26:02 +01:00
Mattias Engdegård
3259f399d4 Treat base64 string encode/decode as pure functions
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns):
Mark base64-decode-string, base64-encode-string and
base64url-encode-string as pure and side-effect-free.
2021-12-20 16:26:02 +01:00
Daniel Mendler
d9d38059d1 Add a new elp-restore-package command
* lisp/emacs-lisp/elp.el (elp-restore-package): New command
(bug#52457).
2021-12-19 14:22:27 +01:00
Lars Ingebrigtsen
25d8045608 Fix elp-*-list interactive specs
* lisp/emacs-lisp/elp.el (elp-reset-list):
(elp-restore-list): Fix the interactive specs (bug#52457).
2021-12-19 14:22:27 +01:00
Mattias Engdegård
941d15558f Remove incorrect byte-hunk-handler for eval
This optimisation is of very limited utility and miscompiles top-level
code having the form (eval 'CODE t) by replacing it with CODE which
will then, as things currently stand, be evaluated with dynamic binding.

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-eval): Remove.
2021-12-18 20:09:48 +01:00
Michael Albinus
55f652c856 Make generation of JUnit test reports more robust.
* lisp/emacs-lisp/ert.el (ert-load-file-name): New defvar.
(ert-write-junit-test-report): Use it.  Make detection of selector
more robust.  Protect calls of `xml-escape-string' with 'noerror.

* test/infra/Makefile.in (subdir_template): Use "make -k ...".

* test/infra/gitlab-ci.yml (test-filenotify-gio):
Adapt make_params in order to get a JUnit test report.
(test-native-comp-speed0): Use "make -k ...".

* test/infra/test-jobs.yml: Regenerate.

* test/lisp/progmodes/perl-mode-tests.el (top):
Set `ert-load-file-name'.
2021-12-18 18:43:18 +01:00
Lars Ingebrigtsen
e5a74c20c3 Make multisession file reading more resilient on Windows
* lisp/emacs-lisp/multisession.el (multisession--read-file-value):
Rename and try harder on file errors on Windows.
2021-12-18 09:24:17 +01:00
Michael Albinus
041fff3d3d Handle missing JUnit test reports
* lisp/emacs-lisp/ert.el (ert-write-junit-test-report)
(ert-write-junit-test-summary-report): Handle missing JUnit test reports.
2021-12-17 20:02:21 +01:00
Stefan Monnier
cf33ece310 multisession.el: Avoid old specializer syntax
Avoid the use of the old (eql VAL) specializer, preferring the new
(eql EXP) form.

* lisp/emacs-lisp/multisession.el (multisession-backend-value)
multisession--backend-set-value, multisession--backend-values)
multisession--backend-delete, multisession-backend-value)
multisession--backend-set-value, multisession--backend-values)
multisession--backend-delete): Quote the symbol passed to `eql` specializer.
2021-12-17 11:39:04 -05:00
Eli Zaretskii
ccb6028364 Improve multisession test results on MS-Windows
* lisp/emacs-lisp/multisession.el
(multisession--backend-set-value): Force 'fsync'ing the temporary
file.
2021-12-17 14:41:16 +02:00
Lars Ingebrigtsen
78a86a4b32 Fix parallel build with multisession.el
* lisp/emacs-lisp/multisession.el: Don't require url -- this pulls
in gnus-util, which requires rmail, which depends on
rmail-loaddefs being generated, which our Makefiles doesn't guarantee.
2021-12-17 09:01:04 +01:00
Lars Ingebrigtsen
81b589518c Update files times in multisesssion properly
* lisp/emacs-lisp/multisession.el
(multisession--backend-set-value): Make cached/external files
times match up.
2021-12-16 08:05:37 +01:00
Lars Ingebrigtsen
ed77d1a8c0 Make the multisession files value read more resilient
* lisp/emacs-lisp/multisession.el
(multisession--update-file-value): Make more resilient towards errors.
2021-12-16 08:00:01 +01:00
Lars Ingebrigtsen
3fd9d48f9b Declare a couple more functions in multisession.el
* lisp/emacs-lisp/multisession.el: New file.
2021-12-16 07:22:00 +01:00
Lars Ingebrigtsen
bfc38ff058 Add support for multisession variables
* doc/lispref/elisp.texi (Top): Add to menu.
(Top):
* doc/lispref/variables.texi (Variables): Ditto.
(Multisession Variables): Document multisession variables.

* lisp/emacs-lisp/multisession.el: New file.
2021-12-16 07:20:04 +01:00