Commit graph

9567 commits

Author SHA1 Message Date
Stefan Kangas
2d0de86361 Merge from origin/emacs-29
8b6a0de964 Improve docstring of treesit-parent-while (bug#62301)
35648a8673 ; Delete accidental leftover '()' Eglot function
47d8e4b0d3 Eglot: report window/workDoneProgress capability to langu...
4a7a0c9a9f * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Impr...
4a6eefb93a Expand defvar-keymap documentation
7a1272168a * lisp/treesit.el (treesit-end-of-defun): Guard arg again...
263d6c3853 Comp fix calls to redefined primtives with op-bytecode (b...
6bf441ff11 Warn package authors away from keymap-unset with REMOVE
786de66ec3 Comment out jobs on EMBA
eed240bc02 Improve defvar-keymap docstring.
2023-03-22 06:30:12 +01:00
Andrea Corallo
4a7a0c9a9f * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Improve 263d6c3853 2023-03-21 12:10:31 +01:00
Andrea Corallo
263d6c3853 Comp fix calls to redefined primtives with op-bytecode (bug#61917)
* lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Fix compilation
of calls to redefined primtives with dedicated op-bytecode.
* test/src/comp-tests.el (61917-1): New test.
2023-03-20 19:01:26 +01:00
Stefan Kangas
c194a31fc4 Merge from origin/emacs-29
028f110273 Fix quoting of font-family in 'hfy-family'
4cb8a850b0 ; Tweak doc/misc/eglot.texi
d5d4959ed7 Document how to construct JSONRPC arrays in Eglot manual
078cf512ee * test/infra/Dockerfile.emba: Use debian:bullseye.
61adb44318 * configure.ac: Fix native comp compatibility check (bug#...
d814c249f4 * test/infra/Dockerfile.emba: Install clangd.
27edd7f88c Remove 'package-vc--query-spec'
39fea11551 Do not store :lisp-dir in package descriptors
168165178f Use 'package-vc-selected-packages' to store package specs
2023-03-20 06:30:30 +01:00
Philip Kaludercic
146389f873 Always display the "Archive" column in the package list
* lisp/emacs-lisp/package.el (package-menu-mode): Always display
column.
(package-menu--print-info-simple): Always provide column information.

Since NonGNU ELPA has been added to the default value of
'package-archives', this condition is practically never satisfied,
meaning the code can be simplified.
2023-03-15 16:49:20 +01:00
Philip Kaludercic
27edd7f88c Remove 'package-vc--query-spec'
* lisp/emacs-lisp/package-vc.el (require): Do not load `inline' during
compilation.
(package-vc--query-spec): Remove function.
(package-vc--clone): Do not call 'package-vc--query-spec'.
2023-03-15 10:28:14 +01:00
Philip Kaludercic
39fea11551 Do not store :lisp-dir in package descriptors
* lisp/emacs-lisp/package-vc.el (package-vc--main-file)
(package-vc--unpack-1): Query 'pkg-spec' instead of
'package-desc-extras'.
(package-vc--unpack): Do not update 'package-desc-extras'.

This simplification is possible due to the change in 2718bbb3bc, since
we now ensure that package specifications are not lost.  They are
either provided by a package archive or stored in
'package-vc-selected-packages'.
2023-03-15 10:28:14 +01:00
Philip Kaludercic
168165178f Use 'package-vc-selected-packages' to store package specs
* doc/emacs/package.texi (Fetching Package Sources): Do not promote
the usage of 'package-vc-selected-packages' to install packages.
* lisp/emacs-lisp/package-vc.el (package-vc-selected-packages): Remove
custom setter and change docstring according to these changes.
(package-vc--desc->spec): Consult 'package-vc-selected-packages' for
package specifications.
(package-vc--unpack): Add unknown package specifications to
'package-vc-selected-packages'
2023-03-15 10:27:58 +01:00
Mattias Engdegård
75f04848a6 Repair and speed up safe-copy-tree and make it internal (bug#61962)
There is no particular requirement for safe-copy-tree so let's make it
internal for now.  The new implementation is faster and more correct.

* doc/lispref/lists.texi (Building Lists):
* etc/NEWS:  Remove doc and announcement.
* lisp/subr.el (safe-copy-tree--seen, safe-copy-tree--1)
(safe-copy-tree): Remove old version.
* lisp/emacs-lisp/bytecomp.el (bytecomp--copy-tree-seen)
(bytecomp--copy-tree-1, bytecomp--copy-tree): Add new version.
(byte-compile-initial-macro-environment): Use it.
* test/lisp/subr-tests.el (subr--safe-copy-tree):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--copy-tree):
Move and improve tests.
2023-03-12 18:12:18 +01:00
Daniel Martín
d19416d15c Fix pluralization in shortdoc-help-fns-examples-function
* lisp/emacs-lisp/shortdoc.el (shortdoc-help-fns-examples-function):
Implement a better logic to pluralize "Example", by counting the
number of arrow characters in the example string. (Bug#61877)
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test): Add a test.
2023-03-12 15:22:38 +02:00
Eli Zaretskii
9191fd50d2 ; Fix last change
* lisp/emacs-lisp/shortdoc.el (shortdoc-help-fns-examples-function)
(shortdoc-function-examples): Fix compilation warning and add an
empty line before the examples.

* lisp/emacs-lisp/shortdoc.el (shortdoc--insert-group-in-buffer)
(shortdoc-function-examples)
(shortdoc-help-fns-examples-function):
* etc/NEWS:
* doc/lispref/help.texi (Documentation Groups):
* doc/emacs/help.texi (Name Help): Improve documentation of
the last change.  (Bug#61877)
2023-03-12 10:25:10 +02:00
Daniel Martín
29227e7c19 Add functions to query Emacs Lisp examples registered in shortdoc
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Add
a new shortdoc-example text property so that ELisp examples can
be searched for later.
(shortdoc--insert-group-in-buffer): New function extracted from
the buffer insertion code in 'shortdoc-display-group'.
(shortdoc-display-group): Implement in terms of
'shortdoc--insert-group-in-buffer'.
(shortdoc-function-examples): New function that returns an alist
of Emacs Lisp examples from shortdoc.
(shortdoc-help-fns-examples-function): New function to insert
Emacs Lisp function examples in *Help* buffers, if added to
'help-fns-describe-function-functions'.
*
test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-function-examples-test):
Test it.
* doc/emacs/help.texi (Name Help): Document in the user manual.
* doc/lispref/help.texi (Documentation Groups): Document it.
* etc/NEWS: Advertise it. (Bug#61877)
2023-03-12 09:54:06 +02:00
Stefan Kangas
5056b8e589 Merge from origin/emacs-29
7e1012765c Fix libwebp check for some webp installations
c2ca009da4 Avoid potential infloop
34c14430e9 Don't misindent 'else:' after 'if re.match:' in Python
8a2a554192 * Make sure `default-directory' exists before spawning pr...
1862e7eb7e Fix sed expression in install-etc make target
c8ec0017cb Avoid using bash in the emacsclient desktop file
a588937094 Fix documentation of the 'line-height' text property
971ded31c4 Add 'declare' specs to with- and without-restriction
2023-03-09 06:30:23 +01:00
Andrea Corallo
8a2a554192 * Make sure `default-directory' exists before spawning processes (bug#62004)
* lisp/emacs-lisp/comp.el (comp-final, comp-run-async-workers): Bind
`default-directory' to `invocation-directory'.
2023-03-08 21:16:12 +01:00
Alan Mackenzie
29f65920fb safe-copy-tree. Correct mistakes from earlier patch.
* lisp/emacs-lisp/bytecomp.el (compile-defun): Remove unintended change.

* lisp/subr.el (safe-copy-tree--seen): Correct grammatical error in doc
string.
(safe-copy-tree): Delete hash table at end of function.

* doc/lispref/lists.texi (Building Lists): Add an "@end defun" line.
2023-03-07 15:26:20 +00:00
Alan Mackenzie
fa83b23611 eval-and-compile: Strip symbol positions for eval but not for compile.
This fixes bug #61962.

* lisp/subr.el (safe-copy-tree): New function.

* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Amend
the entry for eval-and-compile to use safe-copy-tree and
byte-run-strip-symbol-positions for the eval part.

* doc/lispref/lists.texi (Building Lists): Document safe-copy-tree.

* etc/NEWS: Note the new function safe-copy-tree.
2023-03-07 08:00:25 +00:00
Stefan Kangas
8179555730 Merge from origin/emacs-29
bd07cec844 Fix regression in Fido mode (bug#62015)
0e3c7ac13d * Fix `emacs-lisp-native-compile-and-load' for (bug#61917)
4a7e657389 * lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (...
8a8a994cfa Revert "Fix configuration of webp libraries"
de4277af00 Fix configuration of webp libraries
2023-03-07 06:30:10 +01:00
Andrea Corallo
4a7e657389 * lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (bug#61917) 2023-03-06 17:23:15 +01:00
Vibhav Pant
1e5393a57a
Don't modify interactive closures destructively (Bug#60974).
* lisp/emacs-lisp/cconv.el (cconv-convert): When form is an
interactive lambda form, don't destructively modify it, as it might be
a constant literal. Instead, create a new list with the relevant
place(s) changed.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-form-modify-bug60974): New test.
2023-03-06 20:28:20 +05:30
Stefan Kangas
aad617870b Merge from origin/emacs-29
1c67e4f895 Fix c-ts-mode indentation
d724d7d678 Fix c-ts-mode indentation
7292b24c80 Fix c-ts-mode indentation
75cdc1afbe ; Change font-lock-variable-name-face to font-lock-variab...
b1b3af5b90 Update to Org 9.6.1-40-g3d817c
80e1037df4 Add string-interpolation feature to bash-ts-mode
5b8e0b3154 Fix tramp-sh-handle-insert-directory
2258ed01f4 ; Minor fix of last change
9c18af0cfa * Warn when certain primitives are redefined (bug#61880)
5af695c747 ; * lib-src/etags.c (print_help): Fix indentation.
2023-03-06 06:30:13 +01:00
Eli Zaretskii
2258ed01f4 ; Minor fix of last change
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Fix
wording.  (Bug#61880)
2023-03-05 12:24:39 +02:00
Andrea Corallo
9c18af0cfa * Warn when certain primitives are redefined (bug#61880)
* lisp/emacs-lisp/comp.el (comp-warn-primitives): New constant.
	(comp-subr-trampoline-install): Warn when a sensitive primitive is
	being redefined.
2023-03-05 11:06:37 +01:00
Dmitry Gutov
dff9657c6c Redirect eldoc messages to the mode-line when in edebug-mode
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Redirect
eldoc messages to the mode-line when in edebug-mode (bug#56459).
(eldoc-minibuffer--cleanup): New function, used in above.
2023-03-04 02:37:14 +02:00
Dmitry Gutov
a33d3ae98a Revert "Revert "Don't disable eldoc when doing edebug""
This reverts commit 99df815c15.
2023-03-04 02:27:35 +02:00
Mattias Engdegård
828c49ae29 Fix cond miscompilation bug
This fixes a bug that miscompiled

  (cond ... C S1...Sn)

where S1...Sn are switch clauses (that can be compiled into a switch
op) and C a non-switch clause, by tucking on an extra copy of C at the
end.  This was a serious wrong-code bug when the condition of C had
side-effects; otherwise it was only a waste of time and space.

* lisp/emacs-lisp/bytecomp.el (byte-compile-cond): Fix.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
2023-03-02 15:47:26 +01:00
Mattias Engdegård
a1d90e48bb Small unwind-protect optimisation improvement
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Use the current for-effect mode when optimising the body form,
instead of always optimising it for value.
2023-03-02 15:47:26 +01:00
Stefan Kangas
c9b0f1df0d Merge from origin/emacs-29
07f3236133 * src/profiler.c (malloc_probe): Make it safe for GC (bug...
1f1d36fa80 * lisp/emacs-lisp/debug-early.el (debug-early-backtrace):...
99df815c15 Revert "Don't disable eldoc when doing edebug"
0a4b1c0102 ; Eglot: improve bug-reference-url-format/bug-reference-u...
40c9fc8e3b Eglot: work around Tramp instability bug#61350
4a6db125b9 Fix treesit-indent-region
7ef9a8210c Replace C++ comments with C style equivalents
2023-03-02 06:30:15 +01:00
Stefan Monnier
1f1d36fa80 * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Fix bug#61847
The `noerror` arg of `require` doesn't do what Stefan naively thought
when he wrote this code, so use `condition-case` instead.
Also check for `cl-defmethod` since `cl-prin1` can't be loaded before
that anyway.
2023-03-01 12:31:09 -05:00
Eli Zaretskii
99df815c15 Revert "Don't disable eldoc when doing edebug"
This reverts commit 6fd1fb8a68.
It turns out ElDoc does show messages inside Edebug, if you
are (un)lucky enough to have point where ElDoc has something
to show.  Bug#56459 needs to be fixed in some more complex
way.
2023-03-01 17:35:51 +02:00
Mattias Engdegård
42f4691388 Simplify effect-free code elimination
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Simplify overly defensive code.  This does not affect code generation.
2023-03-01 13:37:06 +01:00
Mattias Engdegård
1767d18c91 Adjust some pure and side-effect-free function declarations
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
Add `format-message` and `substring-no-properties`.
* lisp/subr.el (number-sequence, copy-tree, looking-at-p)
(string-match-p, string-trim-right, string-lines):
Declare side-effect-free.
(syntax-class, version-list-<, version-list-=, version-list-<=)
(version-list-not-zero): Declare pure and side-effect-free.
(ensure-list): Declare side-effect-free and error-free.
(string-equal-ignore-case): Remove `pure` declaration.
We may want it to be pure but right now it's not.
2023-02-27 14:34:22 +01:00
Mattias Engdegård
443c249d85 Warn about condition-case without handlers
Omitting handlers from a `condition-case` form makes it useless
since no errors are caught.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): New warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
* etc/NEWS: Announce.
2023-02-27 14:34:22 +01:00
Stefan Monnier
b5edfdbf86 Merge branch 'emacs-29' 2023-02-24 13:13:59 -05:00
Philip Kaludercic
b2ae4e77c7 Avoid reusing :lisp-dir twice in 'package-vc--main-file'
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Just use
:lisp-dir from 'package-desc-extras', not 'pkg-spec'.

This avoid appending the contents of :lisp-dir twice, in case it is
specified both in pkg-spec and pkg-desc.
2023-02-24 17:14:19 +01:00
Philip Kaludercic
068f8fa303 Ensure right package-desc-type before installing package
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Move copying
code from 'package-vc-install'.
(package-vc-install): Remove copying.  (Bug#61669)
2023-02-24 17:14:19 +01:00
Mattias Engdegård
5f38dcd43d More accurate suppression of ignored return value warning
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Be careful to propagate the for-effect mode through a
`with-suppressed-warnings` form when compiling, so that a form
inside isn't erroneously considered to have its value 'used'
by the surrounding warning suppression form itself.
2023-02-24 16:53:32 +01:00
Mattias Engdegård
4849e74273 Fix unsafep for aliases to side-effect-free functions
* lisp/emacs-lisp/unsafep.el (unsafep-function):
Follow aliases when reading the `side-effect-free` property.
2023-02-24 16:53:32 +01:00
Mattias Engdegård
1defa5000b Follow function aliases for side-effect-free and pure properties
This way we don't need to set these properties on aliases at all;
it was always easy to forget doing so.

* lisp/emacs-lisp/byte-opt.el (byte-opt--fget): New function.
(byte-optimize-form-code-walker, byte-optimize-form): Use it.
(side-effect-free-fns, side-effect-and-error-free-fns, pure-fns):
Remove aliases from lists, leaving only built-in functions.
2023-02-24 16:53:32 +01:00
Stefan Kangas
fad3665069 Merge from origin/emacs-29
94e70ed426 ; * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area)...
1841299a11 Eglot: implement inlay hints (bug#61412, bug#61066)
28ed0d1840 Eglot: run eglot-managed-mode-hook after LSP didOpen
7ad5d9babe Eglot: restore eldoc-documentation-functions on shutdown
711a775ba7 Eglot: simplify capability-checking code
ea7251ad6d Eglot: go back to setting eldoc-documentation-strategy again
6016f1982d ; * etc/NEWS: Fix typo again
d411b4d1fd ; * etc/NEWS (C-x v !): Additional text.
a0b6725234 ; * doc/emacs/vc1-xtra.texi (Preparing Patches): Wording ...
43c4dd6f96 ; * doc/emacs/anti.texi (Antinews): Adjust to latest chan...
20c654b6f8 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ...
177d0cf2a9 ; * etc/NEWS: Fix typos.
db7096a532 Yield to erc-move-to-prompt before unhiding prompt
db21c84bc9 ; Improve doc string of 'C-q'
a6be0be1db ; Clarify "kill files" in Gnus manual
d816429e2f * lisp/progmodes/python.el (python--import-sources): Fix ...
1f4886fdb0 Do not error out on non image file (bug#61639)
003759a6dc Explain effect of variable-pitch fonts on fill-column
ba91a76659 Avoid division by zero in get_narrowed_* functions
fb5dbf6de7 ; Fix documentation of 'icon-title-format'.
48c9a50771 * etc/NEWS: Mention new buffer display action alist entries
4dc1f2b9a0 ; * src/xterm.c (x_update_end): Condition on HAVE_XDBE
f1c8389806 Fix build --without-xdbe
ef38774c02 Improve dnd-direct-save-remote-files docstring
cf53e62a79 Add 'process-status' to process shortdoc
68df9e5953 * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename)...
06ba948416 Improve text about deleting windows
1976ca1634 Make 'emacs-news-cycle-tag' work at all levels

# Conflicts:
#	etc/NEWS
2023-02-23 06:30:16 +01:00
Yuan Fu
94e70ed426
; * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Fix typo. 2023-02-22 17:55:30 -08:00
Mattias Engdegård
170b419df0 Declare indirect-function to be side-effect-free and error-free
* lisp/emacs-lisp/byte-opt.el (side-effect-and-error-free-fns):
Add `indirect-function` which is now error-free.
2023-02-22 17:46:03 +01:00
Mattias Engdegård
450be633bb Remove stray quotes
* lisp/emacs-lisp/bytecomp.el (byte-compile-form):
* lisp/help-fns.el (help-fns--interactive-only): Fix obvious mistake.
Since `interactive-only` is not supposed to be anything other than
a symbol at these points it was not a very consequential bug.
2023-02-21 18:32:51 +01:00
Robert Pluim
cf53e62a79 Add 'process-status' to process shortdoc
* lisp/emacs-lisp/shortdoc.el (process): Add 'process-status'.
2023-02-21 16:48:18 +01:00
Andrea Corallo
68df9e5953 * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Improve 5d0b45cd67 2023-02-21 16:39:39 +01:00
Mattias Engdegård
7a59f20a4e Follow aliases for interactive-only declarations
Make `interactive-only` declarations apply to aliases of the same
function as well since this quality isn't in the name but in what
the function does.

* lisp/emacs-lisp/bytecomp.el (byte-compile-form):
* lisp/help-fns.el (help-fns--interactive-only):
Follow aliases when retrieving the `interactive-only` property.
2023-02-21 12:32:48 +01:00
Stefan Kangas
839a86b02b Merge from origin/emacs-29
5a864f23eb regex-emacs.c: Reduce the use of backtracking a bit further
e83c78b8c7 Eglot: respect user's Eldoc configuration by default
5d0b45cd67 Make the native compiler always use `make-temp-file' for ...
88ee92e61d ; * lisp/progmodes/rust-ts-mode.el (treesit-node-end): De...
02aba20d52 Update to Transient v0.3.7-216-gfe40342
d7010d64b2 Add declaration_list to c-ts-common-indent-type-regexp-alist
19480aa30e Typescript-ts-mode: Add switch case handling
dfc850ca02 Fix object initializer for csharp-mode (bug#61541)
fc4bfa76db Update to Org 9.6.1-34-geea8da
afbce8bb46 Improve tree-sitter indent anchor prev-adaptive-prefix (b...
2e6093b425 Adjust jsx indentation
c544df4fa3 Cleanup preproc indent for c-ts-mode (bug#61558)
d397f3d508 Add comment style toggle for c-ts-mode (bug#61550)
683961cd73 * lisp/simple.el (choose-completion): Check for completio...
1ac05eac74 rust-ts-mode--font-lock-settings: Avoid the explicit 'def...
b5bea14ca1 * lisp/progmodes/xref.el: Bump the version.

# Conflicts:
#	src/comp.c
2023-02-21 10:58:00 +01:00
Stefan Monnier
43a6b3f523 * list/emacs-lisp/cconv.el (cconv-make-interpreted-closure): Tweak docstring 2023-02-20 17:11:08 -05:00
Andrea Corallo
5d0b45cd67 Make the native compiler always use `make-temp-file' for temporary files
* src/comp.c (CALL4I): Define macro.
(Fcomp__compile_ctxt_to_file): Use `make-temp-file' instead of
`make-temp-file-internal'.
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Likewise.
2023-02-20 21:16:04 +01:00
Mattias Engdegård
74463909cb * lisp/emacs-lisp/macroexp.el (mapcan): Set funarg-positions. 2023-02-20 13:17:22 +01:00
Stefan Kangas
9a6f22fd0b Merge from origin/emacs-28
f5a99945b6 ; Update ChangeLog for Emacs 28.3
f7bd5ac552 Update HISTORY for Emacs 28.3

# Conflicts:
#	etc/NEWS
2023-02-19 17:37:59 +01:00