Commit graph

9143 commits

Author SHA1 Message Date
Andrea Corallo
fa669c4b17 Comp: Fix limplification pass (bug#62537)
* test/src/comp-resources/comp-test-funcs.el (comp-test-62537-1-f)
(comp-test-62537-2-f): New functions.

* lisp/emacs-lisp/comp.el (comp-jump-table-optimizable): Make it
stricter add a comment.
2023-04-05 19:12:42 +02:00
João Távora
c108132d3b Merge from origin/emacs-29
3bdbb66efb ; CONTRIBUTE: Minor stylistic changes.
d0eb12e8d3 Fix typo in section 14.1 of Emacs Manual
b2fbec37f3 ; * etc/EGLOT-NEWS: Clarify scope of topmost section
131ec049db Eglot: unbreak eglot-extend-to-xref on w32
0622e1f29f Eglot: ensure server shutdown turns off eglot-inlay-hints...
59f66ea302 ; * lisp/emacs-lisp/package-vc.el: Remove completed item ...
d23dc3dd7e ; * lisp/emacs-lisp/package-vc.el (package-vc): Fix manua...
4508a024e8 ; Clarify documentation of 'cursor' text property
d2e82817a3 Add two typescript-ts-mode faces (bug#62429)
10918fc9d2 Fix scrolling window when point moves up
9b32bc134c Improve documentation of 'defcustom's :set keyword
ab4273056e Comp fix calls to redefined primtives with op-bytecode (b...
c98929c7e1 ; Fix last change
a14c3f62a6 ; Fix last change
09fece5722 Fix duplicate defcustom in eww.el
e45bd10a3d Fix indentation regression in 'C-h l'
46fd10a760 * doc/misc/tramp.texi (Remote shell setup): Clarify use o...
2023-04-03 00:33:03 +01:00
João Távora
f2357df91f Eldoc: bump package version to 1.14.0
* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.14.0
2023-04-02 23:40:46 +01:00
João Távora
87f025117b ; Eldoc: fix doc of e-d-functions w.r.t. :origin keyword
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): Fix.
2023-04-02 23:40:46 +01:00
Philip Kaludercic
59f66ea302 ; * lisp/emacs-lisp/package-vc.el: Remove completed item from TODO 2023-03-30 23:28:30 +02:00
Philip Kaludercic
d23dc3dd7e ; * lisp/emacs-lisp/package-vc.el (package-vc): Fix manual reference 2023-03-30 23:28:30 +02:00
Andrea Corallo
ab4273056e Comp fix calls to redefined primtives with op-bytecode (bug#61917)
* test/src/comp-tests.el (61917-1): New test.
	* src/comp.c (syms_of_comp): New variable.
	* lisp/loadup.el: Store primitive arities before dumping.
	* lisp/emacs-lisp/comp.el (comp--func-arity): New function.
	(comp-emit-set-call-subr): Make use of `comp--func-arity'.
2023-03-29 22:25:04 +02:00
Mattias Engdegård
e324060369 Avoid unwind-protect without unwind forms in cl-letf
* lisp/emacs-lisp/cl-macs.el (cl--letf): Use unwind-protect only if
necessary, avoiding a warning.
2023-03-29 19:47:03 +02:00
Mattias Engdegård
9c31ee4686 Warn about unwind-protect without unwind forms
`unwind-protect` without unwind forms is not just pointless but often
indicates a mistake where the intended unwind part is misplaced, as in

    (unwind-protect (progn PROT-FORMS UNWIND-FORMS))   ; oops

or

    (unwind-protect PROT-FORM) UNWIND-FORMS            ; also oops

or entirely forgotten for that matter.  Warning about this makes
sense, and the warning can always be silenced by removing the
`unwind-protect` altogether if it shouldn't be there in the first
place.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Implement
warning.
* etc/NEWS: Announce.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
2023-03-29 19:47:03 +02:00
Stefan Kangas
f24aa0f46a Merge from origin/emacs-29
3965c65d5e ; * lisp/subr.el (read-char-choice): Fix last change.
c1eac5b658 Improve documentation of 'read-choice' and related symbols
a8c9283e17 Revert "Comp fix calls to redefined primtives with op-byt...
8b66d8abd0 Revert "* lisp/emacs-lisp/comp.el (comp-emit-set-call-sub...
4ec4f614c7 ; Fix incompatibility in 'display-buffer-assq-regexp'
ba3ade58f3 Skip ruby-ts-imenu-index test if needed
9133446db8 Fix Eglot Tramp tests on EMBA
5b351bc7fa * test/infra/Dockerfile.emba (emacs-gnustep): Instrument ...
2023-03-29 06:30:09 +02:00
Andrea Corallo
a8c9283e17 Revert "Comp fix calls to redefined primtives with op-bytecode (bug#61917)"
This reverts commit 263d6c3853.

These patch series caused a number of regression and more analysis is
required.
2023-03-28 15:47:54 +02:00
Andrea Corallo
8b66d8abd0 Revert "* lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Improve..."
This reverts commit 4a7a0c9a9f.

These patch series caused a number of regression and more analysis is
required.
2023-03-28 15:47:47 +02:00
Ken Brown
66b4394461 Enable ASLR for dynamic libraries on Cygwin
This seems to avoid the fork failures described in etc/PROBLEMS
("Fork failures in a build with native compilation").

* lisp/treesit.el (treesit--install-language-grammar-1):
* lisp/emacs-lisp/comp.el (native-comp-driver-options): Add the
linker flag "-Wl,-dynamicbase" on Cygwin.
2023-03-27 18:00:14 -04:00
Stefan Monnier
dfa4fb9a2a Merge from origin/emacs-29
b08bf82860 ; Fix :version of the new defcustom
d941666d85 ; Fix last change
e19b7da7b0 Add 'eww-default-download-directory'.
564c26bdbe ; Fix edebug spec for 'gv-define-simple-setter' (bug#62256)
2023-03-27 17:16:58 -04:00
Stefan Monnier
624416a2ae Merge commit '1bc9dfc5be' 2023-03-27 17:14:27 -04:00
Philip Kaludercic
fca7e120d2 Add option to register packages as projects
* lisp/emacs-lisp/package-vc.el (package-vc-register-as-project): Add
new option.
(project-remember-projects-under): Declare function for usage in
'package-vc--clone'.
(package-vc--clone): Respect 'package-vc-register-as-project'.
* etc/NEWS: Document the feature.
2023-03-27 00:05:59 +02:00
Matus Goljer
564c26bdbe ; Fix edebug spec for 'gv-define-simple-setter' (bug#62256) 2023-03-26 14:38:53 +03:00
Mattias Engdegård
52b67740d1 Generalise a LAP optimisation rule
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
rule previously overlooked.  This is usually beneficial in code size
and almost always shortens dynamic paths.
2023-03-25 16:21:09 +01:00
Yuan Fu
f446bfc819
; * lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer-separator): Fix doc. 2023-03-24 12:29:33 -07:00
João Távora
e79b4ccd79 Allow users to customize eldoc buffer separator (bug#62029)
* lisp/emacs-lisp/eldoc.el (eldoc-doc-buffer-separator): New
variable.
(eldoc--format-doc-buffer): Use it.
2023-03-24 17:37:42 +00:00
João Távora
a384401eab Eldoc: slightly enhance meaning of :echo option
Can now be a string to echo instead of a larger docstring.

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions):
Describe :echo.
(eldoc--echo-area-render): Allow :echo to be string.
2023-03-24 17:37:42 +00:00
João Távora
541eec259b Eldoc: fix bug recently introduced in "old" protocol
In the "old" protocol, eldoc-documentation-strategy is actually used
as the deprecated eldoc-documentation-function and it is itself the
"origin" of the doc snippet to be displayed.

* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Fix.
2023-03-24 15:08:50 +00:00
João Távora
e19994fe8c ElDoc: rework rendering of echo area (bug#62029)
Previously, the display function 'eldoc-display-in-echo-area' reused
the same buffer as 'eldoc-display-in-doc-buffer', but that made it
harder to render documentation items differently depending on the
specific constraints of each display functions.

Allow documentation-generating backends to pass an :echo-area property
for tweaking the echo area display of certain documentation items.

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): Update docstring.
(eldoc--doc-buffer-docs): Remove.
(eldoc--format-doc-buffer): Simplify.
(eldoc--echo-area-render): New helper.
(eldoc-display-in-echo-area): Use 'eldoc--echo-area-render'.
2023-03-23 21:14:18 +00:00
João Távora
9b18407c7f ElDoc: remember origin backend in doc snippets (bug#62029)
This lays groundwork for discriminating between different
documentation providers in ElDoc display outlets, i.e. members
of eldoc-display-functions

* lisp/emacs-lisp/eldoc.el (eldoc--make-callback): Take extra origin arg.
(eldoc-documentation-compose-1)
(eldoc-documentation-compose-eagerly)
(eldoc-documentation-default): Pass extra arg to eglot--make-callback.
(eldoc--invoke-strategy): Rework.
(eldoc-documentation-functions): Work docstring.
2023-03-23 21:14:15 +00:00
Eli Zaretskii
bcd02cf512 ; Improve documentation of :predicate in globalized minor modes
* doc/lispref/modes.texi (Defining Minor Modes):
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Improve documentation of the :predicate keyword in defining
globalized minor modes.
2023-03-23 11:30:19 +02:00
Stefan Monnier
930b9fdd3a Fix :predicate handling in globalized minor modes
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Fix a thinko.  (Bug#62376)
2023-03-23 11:03:07 +02:00
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