Commit graph

9318 commits

Author SHA1 Message Date
Eli Zaretskii
54d7426428 Merge from origin/emacs-29
6eddbfe33f Clarify the meaning of the argument of ':align-to' space ...
5c6a51668b ; * doc/misc/eshell.texi (Argument Modifiers): Fix typo i...
da5e05a50e Fix handling of ".elpaignore" file when compiling packages
2023-08-04 03:17:50 -04:00
Eli Zaretskii
23f4999989 Merge from origin/emacs-29
0c29f53ab8 Fix 'string-pixel-width' under 'line-prefix'
7bbd7cae07 Fix find-dired-with-command for remote directories
c4a8572025 ; * etc/HISTORY: Fix Emacs 28.3 entry.
2023-08-04 03:17:49 -04:00
Stefan Monnier
27ed565ec6 * lisp/emacs-lisp/advice.el (defadvice): Mark as obsolete 2023-08-03 23:41:11 -04:00
Stefan Kangas
0910230be6 ; Prefer HTTPS to HTTP in more links 2023-08-02 23:32:28 +02:00
Stefan Kangas
9fe1bebd13 Add let-alist to alist shortdoc group
* lisp/emacs-lisp/shortdoc.el (alist): Add let-alist.
2023-08-02 21:49:19 +02:00
Mattias Engdegård
ece5ace4a5 rx: better not-wordchar and (syntax word) translation
* lisp/emacs-lisp/rx.el:
Add tables of legacy syntax.
(rx--translate-symbol):
Translate the legacy construct `not-wordchar` as (not wordchar), which
is more intuitively obvious.
* lisp/emacs-lisp/rx.el (rx--translate-syntax):
Generate the shorter \w and \W instead of \sw and \Sw.
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms, rx-syntax, rx-not):
Adapt tests.
2023-08-02 18:32:54 +02:00
Mattias Engdegård
d167888c5b rx performance improvements
* lisp/emacs-lisp/rx.el (rx--generate-alt):
Treat the intervals and classes lists separately without joining,
to reduce allocation.  Handle special cases first.
(rx--union-intervals):
Implement directly instead of using intersection and complement.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Adapt test, as some
character alternatives are now slightly different.
(rx--complement-intervals, rx--union-intervals)
(rx--intersect-intervals): New unit tests.
2023-08-02 18:28:23 +02:00
Mattias Engdegård
cda4396ade ; * lisp/emacs-lisp/shortdoc.el (list): Move misplaced remq entry 2023-08-02 11:21:37 +02:00
Jim Porter
da5e05a50e Fix handling of ".elpaignore" file when compiling packages
* lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Treat
'byte-compile-ignore-files' as a list of regexps per its docstring
(bug#64985).
2023-08-01 18:14:35 -07:00
Mattias Engdegård
ea0685e039 ; * lisp/emacs-lisp/package.el: doc string copy-edit 2023-08-01 19:27:28 +02:00
Eli Zaretskii
0c29f53ab8 Fix 'string-pixel-width' under 'line-prefix'
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Disable
'line-prefix' and 'wrap-prefix' to avoid their effect on the
calculated string width.  (Bug#64971)
2023-07-31 21:50:45 +03:00
Mattias Engdegård
2b8796eea1 Fix rx wrong-code bug: ranges starting with ^
(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.

* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.

(cherry picked from commit 5f5d668ac7)
2023-07-30 18:12:19 +02:00
Mattias Engdegård
5f5d668ac7 Fix rx wrong-code bug: ranges starting with ^
(rx (in (?^ . ?a))) was incorrectly translated to "[^-a]".
Change it so that we get "[_-a^]" instead.

* lisp/emacs-lisp/rx.el (rx--generate-alt): Split ranges starting with
`^` occurring first in a non-negated character alternative.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add and adapt tests.
2023-07-30 17:53:14 +02:00
Earl Hyatt
19777b7c86 Allow default values in 'map-let' and the pcase 'map' form
* lisp/emacs-lisp/map.el (map-let, map)
(map--make-pcase-bindings): Add a third argument for specifying a
default value, like in 'map-elt'. (Bug#49407)

* lisp/emacs-lisp/map.el (map--make-pcase-bindings): Clarify that keys
that aren't found aren't ignored, they actually get the value
nil (unless the new default value is given).  The overall pattern can
still fail to match if the sub-pattern for the unfound key doesn't
match nil.

* test/lisp/emacs-lisp/map-tests.el (test-map-let-default)
(test-map-plist-pcase-default, test-map-pcase-matches): Add tests,
including for the above item.
2023-07-30 15:20:27 +02:00
Mattias Engdegård
4336d7e44a * lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Extend
Add skip-chars-forward, skip-chars-backward, skip-syntax-forward,
skip-syntax-backward, current-column, current-indentation,
char-syntax, syntax-class-to-char, parse-partial-sexp, goto-char,
forward-line, next-window, previous-window, minibuffer-window,
selected-frame, selected-window, standard-case-table,
standard-syntax-table, syntax-table, frame-first-window,
frame-root-window and frame-selected-window as always-true functions.
2023-07-27 17:09:30 +02:00
Mattias Engdegård
93eccb5e04 Better compilation of char-before, backward-char and backward-word
Implement char-before, backward-char and backward-word as compiler
macros instead of byte-compile handlers so that the source-level
optimiser gets to simplify the result.  In particular, this removes
some branches.

* lisp/emacs-lisp/bytecomp.el (byte-compile-char-before)
(byte-compile-backward-char, byte-compile-backward-word): Remove.
(bytecomp--char-before, bytecomp--backward-char)
(bytecomp--backward-word): New.
2023-07-27 17:09:30 +02:00
Mattias Engdegård
27944247d1 Fix broken byte-compilation of unary comparisons
* lisp/emacs-lisp/byte-opt.el (byte-opt--nary-comparison):
Fix a typo causing miscompilation of code such as (OP X),
where OP is <, >, <=, >= or =.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--test-cases): Add test case.

Reported by Richard Copley.
2023-07-26 18:49:51 +02:00
Mattias Engdegård
b4063c399b * lisp/emacs-lisp/byte-opt.el (pure-fns): Add max-char 2023-07-26 17:34:03 +02:00
Neal Sidhwaney
8abe4ca83a Add 'define-error' to font lock keywords for emacs-lisp-mode
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Add 'define-error'.
(Bug#64824)

* test/lisp/emacs-lisp/lisp-mode-tests.el
(test-font-lock-keywords): New test.

Copyright-paperwork-exempt: yes
2023-07-26 17:22:05 +03:00
Brian Leung
bcadb728e2 lisp-mode.el: Add defvar-keymap to lisp-imenu-generic-expression
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
Add defvar-keymap.  We do not ignore (defvar-keymap FOO)
constructs in imenu as we do with (defvar FOO) since the former
constructs are generally not vacuous whereas the latter ones
often are.  (Bug#64831)
2023-07-26 17:14:46 +03:00
Stefan Monnier
ca4bc9baf9 macroexp.el: Fix missing warning for intermediate expansions
When a macro expanded to a call to an obsolete macro, we failed
to emit a warning for that use of the obsolete macro.

* lisp/emacs-lisp/macroexp.el (macroexp-macroexpand):
Use `macroexpand-1` to check obsolecence of intermediate expansions.

* test/lisp/emacs-lisp/macroexp-tests.el
(macroexp--test-obsolete-macro): New test.
2023-07-21 11:48:42 -04:00
Po Lu
f9bbe3189b Merge from origin/emacs-29
4bd8e8c6d2 ; * src/xdisp.c: Fix wording in commentary.
3af27a4b81 Improve commentary in nsfns.m
5de5e4b4d0 Fix typos and ommissions in cus-edit.el
9d93c6ba14 ; * src/xdisp.c: Fix typos in the commentary.
86f2d6d62f ; * src/xdisp.c: Improve commentary.  (Bug#64596)
ac075176bf ; * admin/notes/bugtracker: Fix punctuation.
8151853447 ; * admin/notes/bugtracker: Use 'e.g.' throughout the doc...
f063f79a49 Convert NUL-containing NSString objects to Lisp strings c...
d172cd5985 ; * doc/lispref/keymaps.texi (Modifying Menus): Add cross...
927e8b470f ; * doc/lispref/keymaps.texi (Extended Menu Items): Add @...
77f489421e ; * src/xdisp.c: Minor improvements of the commentary.
ce3f9fba1a ; Improve accuracy of out-out-order message insertion
17073af84d ; Improve robustness of package-report-bug
2023-07-20 19:50:45 +08:00
Alan Mackenzie
f9f9c95ab5 Fix native compilation in dynamically bound files.
This fixes bug#64642.

* lisp/emacs-lisp/comp.el (comp-spill-lap-function/symbol): Add
code for dynamically bound functions.

* test/src/comp-tests.el (comp-tests-result-lambda): New test.

* test/src/comp-resources/comp-test-funcs-dyn2.el: New test
file.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
#	modified:   lisp/emacs-lisp/comp.el
#	new file:   test/src/comp-resources/comp-test-funcs-dyn2.el
#	modified:   test/src/comp-tests.el
#
# Changes not staged for commit:
#	modified:   .gitignore
#
# Untracked files:
#	.gitignore.acm
#	.gitignore.backup
#	.timestamps.txt
#	2021-01-03.err
#	2021-01-06.err
#	2021-12-16.make
#	2021-12-30.err
#	2021-12-31.err
#	2022-01-01.err
#	2022-01-02.check.err
#	2022-01-02.err
#	2022-01-04.err
#	2022-01-05.err
#	2022-01-06.err
#	2022-01-07.err
#	2022-01-07.outerr
#	2022-01-08.err
#	2022-01-09.err
#	2022-01-09b.err
#	2022-01-10.err
#	2022-01-11
#	2022-01-11.err
#	2022-02-22.err
#	2022-02-22.outerr
#	checkout.20220228.out
#	checkout.20220301.out
#	checkout.20220302.out
#	doc/lispref/syntax.20160318.techsi
#	doc/lispref/syntax.20160318b.techsi
#	lib/.deps/
#	lisp/2022-01-09.err
#	lisp/emacs-lisp/comp.el.rej
#	src/2021-12-20.err
#	src/globals.20211124.aitch
#	src/lisp.20211127.aitch
#	test/lisp/calendar/icalendar-tests.elcr5m9Wq
#
2023-07-19 11:26:11 +00:00
Mattias Engdegård
157e735ce8 Don't distort character ranges in rx translation
The Emacs regexp engine interprets character ranges from ASCII to raw
bytes, such as [a-\xfe], as not including non-ASCII Unicode at all;
ranges from non-ACII Unicode to raw bytes, such as [ü-\x91], are
ignored entirely.

To make rx produce a translation that works as intended, split ranges
that that go from ordinary characters to raw bytes. Such ranges may
appear from set manipulation and regexp optimisation.

* lisp/emacs-lisp/rx.el (rx--generate-alt): Split intervals that
straddle the char-raw boundary when rendering a string regexp from an
interval set.
* test/lisp/emacs-lisp/rx-tests.el (rx-char-any-raw-byte):
Add test cases.
2023-07-17 17:56:54 +02:00
Spencer Baugh
17073af84d ; Improve robustness of package-report-bug
* lisp/emacs-lisp/package.el (package-report-bug): Do not assume that
every entry in 'custom-current-group-alist' has a non-nil entry for a
filename.

It is possible for a group to not be associated with any file, e.g. when
a 'defgroup' form is evaluated using 'eval-expression'.  (bug#64543)
2023-07-16 00:27:40 +02:00
Eli Zaretskii
748d2ed515 Merge from origin/emacs-29
7ac947f34c ; * src/lisp.h (struct Lisp_Overlay): Update commentary (...
9bc93c7996 Replace duplicate text from epa.texi by a reference
74cc1d27f1 Add basic usage information and fix references
f24bdbfaf5 Add concept index, title-case structure titles
0165b50b0f ; * lisp/emacs-lisp/lisp.el (raise-sexp): Fix typo in doc...
4cf33b6bd0 ; * doc/misc/modus-themes.org: Fix whitespace (bug#64548).
4821da1ad7 Fix show-paren-mode when the parentheses is partially vis...
419b4d4491 ; Improve documentation of with-restriction
be34e8294a ; * admin/git-bisect-start: Update failing commits
8e06809fcc Merge branch 'scratch/bug64391' into emacs-29
dbac807605 * lisp/net/tramp.el (tramp-get-buffer-string): Stabilize.
01fb898420 Simplify after adding internal function to enter a labele...
b741dc7fcd Add internal function to enter a labeled restriction

# Conflicts:
#	doc/misc/modus-themes.org
2023-07-15 05:30:14 -04:00
Stefan Monnier
47c2da092a cl-print: Allow expanding the contents of hash-tables
* lisp/emacs-lisp/cl-print.el (cl-print-object) <hash-table>:
Add an ellipsis.
(cl-print-object-contents) <hash-table>: New method.
2023-07-13 22:26:19 -04:00
Stefan Monnier
badbfd57cd * lisp/emacs-lisp/backtrace.el (backtrace--change-button-skip): Typo) 2023-07-13 21:51:23 -04:00
Eli Zaretskii
4e8d579f3d Use 'emacs-lisp-compilation-mode' in native compilation buffers
Re-install this commit 40492581f9, now that source of
the recursive-load has been fixed (bug#64494).

* lisp/emacs-lisp/comp.el (comp-log-to-buffer)
(comp-run-async-workers): Use 'emacs-lisp-compilation-mode' in the
buffers where we log the results of native compilation.  Suggested
by No Wayman <iarchivedmywholelife@gmail.com>.  (Bug#64452)
2023-07-13 21:24:24 -04:00
Stefan Monnier
fcade74066 src/comp.c: Use pending_funcalls to fix bug#64494
Make sure `comp.el` is never loaded synchronously by simply
delaying all calls to `native--compile-async` via `pending_funcalls`.

* lisp/startup.el (comp--compilable, comp--delayed-sources): Don't declare.
(startup--require-comp-safely)
(startup--honor-delayed-native-compilations): Delete functions.
(normal-top-level): Don't call `startup--honor-delayed-native-compilations`.

* src/comp.c (maybe_defer_native_compilation): Use `pending_funcalls`.
(syms_of_comp): Delete `Vcomp__delayed_sources` and `comp__compilable`.
Define `Qnative__compile_async`.
2023-07-13 20:13:32 -04:00
Stefan Monnier
3ffb99f28f cl-print: Put buttons on ellipses
Currently, in *Backtrace* we have a nice behavior for cl-printed objects
where they're truncated by default to a manageable size but we can click
on the "..." to expand them when needed.

The patch below moves that functionality to `cl-print.el` such
that it can be enjoyed "everywhere" (bug#64536).  It also has the
benefit of simplifying the code since `backtrace.el` had to look for
ellipses in order to add buttons to them, whereas now we can put
the ellipses right when we write them.

* lisp/emacs-lisp/cl-print.el (cl-print-object-contents): Improve docstring.
(cl-print-expand-ellipsis-function): New var.
(cl-print--default-expand-ellipsis): New function.
(cl-print-expand-ellipsis): New command.
(cl-print-insert-ellipsis): Allow nil instead of 0 to mean "this elides
the whole object".
(cl-print-ellipsis): Move button type from `backtrace.el`.
(cl-print-propertize-ellipsis): Put a button.
(cl-print--expand-ellipsis): Rename from `cl-print-expand-ellipsis`.
(cl-print-to-string-with-limit): Allow new value t for `limit`.

* lisp/emacs-lisp/backtrace.el (backtrace--font-lock-keywords): Simplify.
(backtrace--match-ellipsis-in-string): Delete function.
(backtrace--change-button-skip): Adjust to new button type name.
(backtrace--expand-ellipsis): New function, extracted from
`backtrace-expand-ellipsis`.
(backtrace-expand-ellipsis): Delete function.
(backtrace-ellipsis): Move button type to `cl-print.el`.
(backtrace--print-to-string): Don't look for cl-print ellipses any more.
(backtrace-mode): Use `backtrace--expand-ellipsis`.

* lisp/ielm.el (ielm--expand-ellipsis): New function.
(inferior-emacs-lisp-mode): Use it to fill the data when expanded.

* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-check-ellipsis-expansion)
(cl-print-tests-check-ellipsis-expansion-rx): Adjust to new internal
function name.
2023-07-13 19:00:51 -04:00
Eli Zaretskii
0165b50b0f ; * lisp/emacs-lisp/lisp.el (raise-sexp): Fix typo in doc string. 2023-07-12 15:19:10 +03:00
Stefan Monnier
9c282faf26 cl-print.el: Reduce code duplication
While at it, fix a bug in `cl-print-object-contents` for strings,
where we forgot to pass `stream` to `princ` at one place and simplify
a `substring` call using a negative offset.

* lisp/emacs-lisp/cl-print.el (cl-print--cons-tail)
(cl-print--vector-contents, cl-print--struct-contents)
(cl-print--string-props): New functions, extracted from
`cl-print-object-contents`.
(cl-print-object, cl-print-object-contents): Use them.
2023-07-08 20:19:02 -04:00
Stefan Monnier
1b7c9ecc8f pp-fill: Fix missing indentation in some cases
* lisp/emacs-lisp/pp.el (pp-fill): Improve handling of char-tables.
(pp-buffer): Improve backward compatibility.
2023-07-08 15:10:23 -04:00
Eli Zaretskii
375dac936f Merge from origin/emacs-29
600b90ed56 Mark failing icalendar test as unstable (bug#56241)
f8a918c977 ; * src/coding.c (Fcoding_system_put): Improve doc string.
40f84e906f ; * doc/lispref/keymaps.texi (Key Binding Commands): Fix ...
502a780031 ; Improve documentation of 'vertical-motion' in ELisp manual
0d90873fa4 ; * src/indent.c (Fvertical_motion): Doc fix.
9b38773a20 ; * lisp/dired.el (dired-no-confirm): Doc fix.  (Bug#64493)
a30ebe7a55 ; Improve documentation of key-binding commands
c3fefb2b3a Improve natnump shortdoc
244d4c837a correct info documentation of benchmark-call
67def1f550 * lisp/progmodes/grep.el (rgrep): Fix docstring.
8da2091362 ; Fix documentation of minibuffer-completion commands
aa030698ce ; Fix typos in documented names of keymap-* functions
a9b46bb25d Include a help-echo for flymake's modeline counters
37ed3d15f3 Avoid errors in completion due to 'completion-regexp-list'
15ff876177 ; * lisp/register.el (register-val-describe): Doc fix.
fe7b909c16 ; Fix two typos in recent changes in the manual
7a74b8c327 C Mode: Don't fontify foo globally as type due to "struct...
823bf6bdb1 * lisp/rect.el (rectangle--duplicate-right): Fix rectangl...
e339d0080d ; * test/lisp/misc-tests.el (ert): require misc to avoid ...

# Conflicts:
#	lisp/rect.el
2023-07-08 05:46:10 -04:00
Stefan Monnier
3710178024 * lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Fix bug#64232 2023-07-07 12:09:50 -04:00
Eli Zaretskii
65c90040eb Revert "Use 'emacs-lisp-compilation-mode' in native compilation buffers"
This reverts commit 40492581f9.
It caused a recursive-load error when native-compiling files.
(Bug#64391)
2023-07-06 18:00:05 +03:00
Eli Zaretskii
40492581f9 Use 'emacs-lisp-compilation-mode' in native compilation buffers
* lisp/emacs-lisp/comp.el (comp-log-to-buffer)
(comp-run-async-workers): Use 'emacs-lisp-compilation-mode' in the
buffers where we log the results of native compilation.  Suggested
by No Wayman <iarchivedmywholelife@gmail.com>.  (Bug#64452)
2023-07-06 11:50:41 +03:00
Stefan Monnier
26f31fe3b5 * lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Fix bug#64459 2023-07-05 11:37:28 -04:00
Robert Pluim
c3fefb2b3a Improve natnump shortdoc
* lisp/emacs-lisp/shortdoc.el (number): Make it clear that zero
satisfies 'natnump'.  Move 'natnump' next to 'cl-plusp' to highlight
the difference between them.
2023-07-04 17:44:43 +02:00
Mattias Engdegård
59a350cb91 Warn about misplaced :success in condition-case (bug#64404)
* lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case):
Warn if :success is part of a list of conditions (it must come alone).
2023-07-02 11:53:36 +02:00
Eli Zaretskii
3ba9f9657f Merge from origin/emacs-29
edd36786e1 ; * lisp/bookmark.el (bookmark-bmenu-locate): Doc fix (bu...
16eac20a5d ; Fix last change
ab8d0f7b76 Add project command entries to the menu-bar
fc6099bf04 ; Improve documentation of text-property-search-* functions
cc660bd265 ; * etc/PROBLEMS: Mention MinGW problems with -D_FORTIFY_...
a5bd9fb8c4 ; Improve doc strings in register.el
0be18d8097 ; Fix @xref in last change to doc/emacs/regs.texi.
624c779517 ; Fix tree-sitter C binding typos in Elisp manual.
16e9bdff4f Improve documentation of registers
2023-07-01 06:30:00 -04:00
Eli Zaretskii
e45ddf2fdc Merge from origin/emacs-29
4df510c7a7 Fix VC package build when doc file isn't in a subdir
382f5fa813 ; * doc/emacs/package.texi (Fetching Package Sources): Fi...
fc7e7c3fde Fix type check in tramp-get-buffer-string
2aa57fe6cf ; Fix typo in maintaining.texi (bug#64279)
2023-07-01 06:29:43 -04:00
Eli Zaretskii
fc6099bf04 ; Improve documentation of text-property-search-* functions
* doc/lispref/text.texi (Property Search): Improve wording and markup.

* lisp/emacs-lisp/text-property-search.el (text-property-search-forward)
(text-property-search-backward): Doc fixes.  (Bug#64367)
2023-07-01 12:28:33 +03:00
Stefan Monnier
dcd9209095 * lisp/emacs-lisp/cl-macs.el (cl--slet): Fix bug#64315 2023-06-28 09:24:30 -04:00
Stefan Monnier
82875b1575 cl-macs-tests.el (cl-&key-arguments): Fix regression
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Turn "cannot use
lexical var" errors into warnings.
Make the obey `with-suppressed-warnings`.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments):
Suppress warnings.
2023-06-27 16:14:32 -04:00
Daniel Semyonov
4df510c7a7 Fix VC package build when doc file isn't in a subdir
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Expand 'file' before attempting to get its directory.  (Bug#64242)
2023-06-25 23:33:24 +02:00
Stefan Monnier
4c50af02ab cl-macs.el: Silence recent new "lexical arg shadows" warnings
* lisp/emacs-lisp/cl-macs.el (cl--slet): Add `nowarn` arg.
(cl--defsubst-expand): Use it.
(cl-defstruct): Silence warnings abour lexical shadowing when a slot's
name happens to be the same as a dynbound var.
2023-06-25 11:38:40 -04:00
Stefan Monnier
0228421e34 Allow suppressing the "lexical arg shadows dynbound var" warning
In most cases the right way to fix this warning is by renaming
the offending argument, but in some cases this is inconvenient, as is
the case in `cl-defstruct` where arg names are imposed by slot names.

This patch also happens to fix a few bugs along the way:
- miscompilation of (lambda (gcs-done) (lambda (x) (+ x gcs-done)))
- errors about void function `byte-compile-warn-x` if the warning was
  emitted via `cconv-fv` when bytecomp was not loaded.
Oh, and it improves the warning by making the location info slightly
more precise.

* lisp/emacs-lisp/cconv.el (cconv--analyze-function): Remove this warning.
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list):
Warn about it here instead.  Let `with-suppressed-warnings` control it
under `lexical`.
2023-06-25 11:14:03 -04:00
Stefan Monnier
e85ebb3d82 (macroexp--unfold-lambda): Obey the lexbind semantics
While at it, rework the code so as not to rely on an
intermediate rewriting of (funcall (lambda ..) ...)
to ((lambda ..) ...) since that forms is deprecated.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-funcall): Unfold lambdas
instead of turning them into the deprecated ((lambda ..) ..).
(byte-optimize-form-code-walker): Don't unfold ((lambda ..) ..) any more.
(byte-compile-inline-expand): Revert to non-optimized call if the unfolding
can't be optimized.

* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Don't unfold
((lambda ..) ..) any more.

* lisp/emacs-lisp/cl-macs.el (cl--slet): Remove workaround.

* lisp/emacs-lisp/disass.el (disassemble): Make sure the code is
compiled with its own `lexical-binding` value.

* lisp/emacs-lisp/macroexp.el (macroexp--unfold-lambda): Make it work
both for ((lambda ..) ..) and for (funcall #'(lambda ..) ..).
Be careful not to move dynbound vars from `lambda` to `let`.
(macroexp--expand-all): Unfold (funcall #'(lambda ..) ..) instead of
turning it into ((lambda ..) ..).  Don't unfold ((lambda ..) ..) any more.
2023-06-24 17:53:41 -04:00