1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
Commit graph

10547 commits

Author SHA1 Message Date
Eli Zaretskii
03b258fe44 ; Improve doc strings of some igc functions
* src/igc.c (Figc__arena_step):
* lisp/emacs-lisp/igc.el (igc--current-idle-time, igc--on-idle):
Doc fixes.
2025-12-06 15:15:50 +02:00
Jeremy Bryant
c5be680ec3 ; * lisp/emacs-lisp/igc.el: Add docstrings and fix typos
(igc--current-idle-time): Add docstring.
(igc--idle-timer): Fix typo in docstring.
(igc--predict-idle-time): Add docstring.
(igc--on-idle): Fix typo in comment, add docstring.
2025-12-05 08:41:32 +01:00
Eli Zaretskii
00ad86045f ; * lisp/emacs-lisp/igc.el (igc-collect): Doc fix. 2025-11-29 19:57:36 +02:00
Helmut Eller
937aa5afe0 Merge branch 'master' into feature/igc 2025-11-25 20:19:43 +01:00
Sean Whitton
1844ce4a0f * lisp/emacs-lisp/cond-star.el (pcase*): New dummy definition. 2025-11-25 14:22:58 +00:00
Philip Kaludercic
c767928997
Only search for package descriptors in package root
See the following thread for a background on this change:
https://mail.gnu.org/archive/html/emacs-devel/2025-08/msg00332.html.
This change reverts b81f937e.

* lisp/emacs-lisp/package.el (package-dir-info): Do not
recursively try to find all Lisp files that might have package
metadata.  (Bug#79742)
2025-11-24 20:53:22 +01:00
Philip Kaludercic
c3604c3224
; Fix issue when installing packages from Dired
* lisp/emacs-lisp/package.el (package-dir-info, package-unpack):
Force Dired to return list of packages explicitly marked for
installation.  Without the optional argument, Dired will return
the file under the current point if no files are selected.
2025-11-24 20:53:22 +01:00
Philip Kaludercic
4ea81f359c
Replace underscores in bind-and* with fresh symbols
* lisp/emacs-lisp/cond-star.el (cond*-convert-condition): Bind
unused values to fresh symbols, to avoid the compiler warning
that a symbol starting with an underscore is accessed later on.
This mirrors the behaviour of `if-let*' and family.
2025-11-24 20:53:22 +01:00
Stefan Monnier
46d0f1fef1 (loaddefs-generate--make-autoload): Fix bug#79852
As JD Smith <jdtsmith@gmail.com> said we had 3 paths:

1. macro has `autoload-macro expand` and is already loaded: expand
2. macro has `autoload-macro expand` but is /not/ yet loaded: shortcut
3. macro does not have `autoload-macro expand`: shortcut

and the co-existence of 1 and 2 is a problem because it means
that same macro is sometimes handled one way and sometimes
another, with different results.
Remove number 2 by removing from the shortcut all the remaining
macros that have `autoload-macro expand`.

The immediate effect is that `make autoloads` now (auto)loads three
more files:

    [...]
    loaddefs-gen: loading file frameset (for cl-defun)
    Loading frameset...
      INFO     Scraping 1547 files for loaddefs...10%
      INFO     Scraping 1547 files for loaddefs...20%
    loaddefs-gen: loading file semantic/analyze (for define-overloadable-function)
    Loading semantic/analyze...
      INFO     Scraping 1547 files for loaddefs...30%
      INFO     Scraping 1547 files for loaddefs...40%
      INFO     Scraping 1547 files for loaddefs...50%
      INFO     Scraping 1547 files for loaddefs...60%
      INFO     Scraping 1547 files for loaddefs...70%
    loaddefs-gen: loading file tramp-adb (for tramp--with-startup)
    Loading tramp-adb...
      INFO     Scraping 1547 files for loaddefs...80%
    loaddefs-gen: loading file grep (for define-compilation-mode)
    Loading grep...
    [...]

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs--defining-macros):
Remove macros that are marked `autoload-macro expand`, even if they are
not predefined.
(loaddefs-generate--make-autoload): Simplify accordingly.
2025-11-22 06:56:46 -05:00
Stefan Monnier
b193a78a6f (loaddefs--defining-macros): Weed out a few more entries
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs--defining-macros):
Remove `define-skeleton`, `define-derived-mode`, and
`define-generic-mode` since their `autoload-macro expand` property is
now preloaded.
2025-11-22 06:56:46 -05:00
Stefan Monnier
74087e252f loaddefs-gen: Weed out some elements from the shortcut path
The predefined macros marked as `autoload-macro expand` can't
get to the shortcul path, so simplify it accordingly.
Mark a few more macros from the shortcut path as `autoload-macro expand`
but don't remove them yet from the shortcut path (need to update
`ldefs-boot.el`).

* lisp/progmodes/compile.el (define-compilation-mode):
* lisp/emacs-lisp/generic.el (define-generic-mode):
* lisp/emacs-lisp/derived.el (define-derived-mode):
* lisp/cedet/mode-local.el (define-overloadable-function):
* lisp/skeleton.el (define-skeleton): Mark as `autoload-macro expand`
so as to make the "shortcut" path in `loaddefs-gen.el` redundant.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs--defining-macros):
Remove the easy-mmode.el macros since they are already marked as
`autoload-macro expand` and they are always defined, so we never check
them against that list.
(loaddefs-generate--make-autoload): Remove handling of the
`easy-mmode.el` macros as well as `defun` and `defmacro` from the
shortcut path since we can never get there with them anyway.
2025-11-22 06:56:46 -05:00
Spencer Baugh
784d5b4954 Fix implicit usage of the current window-width in vtable.el
Previously, many functions in vtable.el called 'vtable--cache',
which computed 'vtable--cache-key' based on the current selected
window and frame; this could cause vtable functions to fail or
misbehave if they were not called from the selected window and
frame that 'vtable-insert' was last called in.

Now, the vtable cache is stored with the text of the vtable, so
that functions which need to interact with some vtable text can
do so reliably without having to use the same selected window
and frame.

Also, 'vtable-update-object' has always required TABLE to be
present at point in the current buffer; now its docstring states
this.

* lisp/emacs-lisp/vtable.el (vtable--current-cache)
(vtable--cache-widths, vtable--cache-lines): Add.
(vtable-insert): Save cache in 'vtable-cache.
(vtable--ensure-cache, vtable--recompute-cache): Inline into
'vtable-insert'.
(vtable--widths, vtable--cache): Delete.
(vtable-update-object): Use 'vtable--current-cache' and
update docstring.  (Bug#69837)
(vtable-remove-object, vtable-insert-object): Use
'vtable--current-cache' and save cache in 'vtable-cache'.
(vtable--sort, vtable--alter-column-width)
(vtable-previous-column, vtable-next-column): Use
'vtable--current-cache'.
2025-11-19 17:26:50 +02:00
Stefan Monnier
4532f5ae8f (loaddefs-generate--emacs-batch): Fix bug#79821 again
Hopefully, this one is for good.
Use `file-truename` on all the input file/dir names to try and
make sure we don't get bitten any more by symlinks or driver
letter capitalization.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Revert last change.
(loaddefs-generate--excluded-files): Remove test that's not needed any
more now that we use all relative names.
(loaddefs-generate--emacs-batch): Apply truename to all input files/dirs.
2025-11-18 17:33:11 -05:00
Stefan Monnier
be2b38ce14 (lisp-indent-function): Auto-load macros to get the indent info
Rather than preload the `lisp-indent-function` property for
autoloaded macros, auto-load them to fetch their property.
In terms of cost, this slightly reduces the heap size at
startup, while tending to increase the heap size while editing
ELisp code since more packages will be (auto)loaded.

The benefit is elsewhere: by loading the definition the macro we
will also load other (non-autoloaded) definitions, so we get
better behavior for things like `ert.el` and `inline.el` where
only some of the macros are autoloaded, because there's a good
chance that we'll end up loading them to indent the autoloaded
macro, after which indentation of the other macros will be
performed correctly (bug#68818).

* lisp/emacs-lisp/byte-run.el (byte-run--dont-autoload): New function.
(macro-declarations-alist): Use it to override `byte-run--set-indent`.

* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Auto-load macros
if needed to get the indent info.
2025-11-18 17:23:11 -05:00
Juri Linkov
6b0cf8ab87 Display daemon startup warnings on the first client frame (bug#79783)
* lisp/emacs-lisp/warnings.el (display-warning): For warnings/errors
on the initial daemon frame use 'after-make-frame-functions'
to postpone their display until the first client frame is created.
(warning--display-buffer): New internal function refactored out of
'display-warning'.
2025-11-18 19:57:04 +02:00
Stefan Monnier
6c770f8624 lisp/emacs-lisp/smie.el (smie-indent-basic): Add safety predicate 2025-11-17 08:51:56 -05:00
Sean Whitton
78a73acf61 ; * lisp/emacs-lisp/cond-star.el (cond*): New FIXME. 2025-11-14 14:12:38 +00:00
Sean Whitton
3c9bcdebe4 Autoload match*, bind*, bind-and* dummy macros
* lisp/emacs-lisp/cond-star.el (match*, bind*, bind-and*):
Autoload, for the sake of syntax highlighting.
2025-11-14 14:11:04 +00:00
Sean Whitton
8e5c4c411d New dummy defmacro for bind*
* lisp/emacs-lisp/cond-star.el (bind*): New macro, like match*
and bind-and*.
2025-11-13 17:15:18 +00:00
Stefan Monnier
05ea637d60 lisp/emacs-lisp/bytecomp.el (define-widget): Add funarg-positions 2025-11-13 09:01:36 -05:00
Stefan Monnier
580d74e1e1 (loaddefs-generate--emacs-batch): Fix bug#79821
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch):
Expand file names before changing directory, in case they're relative.
2025-11-13 08:23:55 -05:00
Helmut Eller
7f925475a2 Merge branch 'master' into feature/igc 2025-11-12 17:48:40 +01:00
David Fussner
69092236f4
Fix package-vc to install multiple info manuals
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
  Take the name of the .info file from the name of the source file,
  instead of from the name of the package.
2025-11-08 14:40:25 +01:00
Philip Kaludercic
60a13d85fe
Fix error messages when building docs for VC packages
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Use the buffer name of the output buffer instead of the buffer
name of the current buffer.
2025-11-08 14:40:25 +01:00
Philip Kaludercic
211f0520fc
Allow 'package-upgrade-all' to upgrade built-in packages
* lisp/emacs-lisp/package.el (package-upgrade-all): Respect
'package-install-upgrade-built-in'.  (Bug#79718)
2025-11-08 14:40:25 +01:00
Lester Longley
cc4de67bd2 Fix 'bind*' in 'cond*'
* lisp/emacs-lisp/cond-star.el (cond*-non-exit-clause-substance):
Fix 'bind*' to match the documentation.  (Bug#79247)

Copyright-paperwork-exempt: yes
2025-11-08 12:43:52 +02:00
Eli Zaretskii
3cc34865e8 ; * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Fix typo. 2025-11-07 18:44:49 +02:00
Stefan Monnier
f356dca70b lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Fix bug#79694 2025-11-07 11:34:32 -05:00
Andrea Corallo
55d41f5d2b * Fix native compiler for circular objects (bug#75135)
* lisp/emacs-lisp/comp.el (comp--ssa-rename-insn): Fix circular objects.
2025-11-06 09:41:36 +01:00
Elías Gabriel Pérez
cc589d7003 hideshow: Rework previous changes
* doc/emacs/programs.texi (Hideshow):
* etc/NEWS: Fix doc.
* lisp/progmodes/hideshow.el: Update Commentary Header.
(hs-modes-alist): Remove.
(hs--get-mode-value, hs-grok-mode-type): Rework.
* lisp/treesit.el (treesit-major-mode-setup):
* lisp/emacs-lisp/lisp-mode.el:
* lisp/nxml/nxml-mode.el:
* lisp/progmodes/cc-mode.el:
* lisp/progmodes/f90.el:
* lisp/progmodes/fortran.el:
* lisp/progmodes/hideshow.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/js.el:
* lisp/progmodes/lua-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/verilog-mode.el:
* lisp/progmodes/vhdl-mode.el:
* lisp/textmodes/bibtex.el:
* lisp/textmodes/mhtml-mode.el:
* lisp/textmodes/sgml-mode.el:
* lisp/treesit.el: Fix and rework previous changes.
2025-11-06 09:41:12 +02:00
Eli Zaretskii
58a2c2494d ; * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix. 2025-11-06 08:01:32 +02:00
Stefan Monnier
34ab8abdd2 (loaddefs-generate--emacs-batch): Chdir to lisp-directory
Chdir once and for all at the beginning to simplify the code.
Eliminate some redundant `expand-file-name`s and fix a broken use
of `expand-file-name` where we passed a list as second arg.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Rename DIR to
DIRS, to clarify that it can be a list.  Use `ensure-list`.
Don't pass DIR(S) directly to `expand-file-name`.
Remove redundant `expand-file-name`.
(loaddefs-generate--excluded-files): Add sanity checks.
Return relative file names since `loaddefs-generate` will make them
absolute anyway.  Simplify.
(loaddefs-generate--emacs-batch): Chdir to `lisp-directory` and
simplify the rest accordingly.
2025-11-05 15:14:45 -05:00
Juri Linkov
b34040302f * lisp/image.el (image-supported-file-p): Fix autoload cookie (bug#79764).
* lisp/emacs-lisp/icons.el (icons--create):
* lisp/mail/rmailmm.el (rmail-mime-set-bulk-data):
Remove unnecessary '(fboundp 'image-supported-file-p)'.
2025-11-05 19:54:56 +02:00
Mattias Engdegård
8815194ea6 Unify constants that are equal-including-properties in compiler
This results in a healthy reduction of .elc file size (> 300 KiB saved)
as well as less memory use.

* lisp/emacs-lisp/bytecomp.el (byte-compile-get-constant):
Use 'equal-including-properties' as equivalence relation for all
constants, not just strings.
* etc/NEWS: Mention it.  Strictly speaking it's not an incompatible
change because it doesn't break any earlier promises, but for people
having code that made incorrect assumptions, this provides a useful
explanation.
2025-11-05 17:44:51 +01:00
Philip Kaludercic
327c16ce14
Add support for 'bind-and*' patterns to 'cond*'
* lisp/emacs-lisp/cond-star.el (cond*): Document 'bind-and*'.
(bind-and*): Add a stub to raise an error if 'bind-and*' is used
outside of 'cond*'.
(cond*-convert-condition): Implement a new type of condition.
2025-11-04 20:45:39 +01:00
Sean Whitton
0175b7209e ; * lisp/emacs-lisp/cond-star.el (cond*): Fix typo. 2025-11-02 17:38:47 +00:00
Eli Zaretskii
6d36c6b6f9 ; Fix byte-compilation warnings (bug#79664)
* lisp/emacs-lisp/rmc.el (overriding-text-conversion-style):
Defvar it.
* lisp/emacs-lisp/map-ynp.el (cl--map-keymap-recursively): Add
autoload form.
2025-11-02 10:28:25 +02:00
Philip Kaludercic
da3e3756c2
; * lisp/emacs-lisp/cond-star.el (match*): Fix ` in docstring 2025-11-01 20:52:05 +01:00
Philip Kaludercic
3dacd8b41a
Check if 'hash-table-contains-p' is available in map.el
* lisp/emacs-lisp/map.el (map-contains-key): Hide old
implementation prior to f60fc128 behind a `fboundp', as the
package is distributed on ELPA and should be backwards
compatible to Emacs 26.  (Bug#79711)
2025-11-01 20:52:05 +01:00
Juri Linkov
2447188a69 'map-y-or-n-p' now uses the minibuffer to read a char (bug#79664)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use the 'read-key'
branch only when the variable 'y-or-n-p-use-read-key' is non-nil.
Add a new cond-branch to read from the minibuffer.
Add a special case when def is nil in a kmacro in batch mode (bug#67836).

* test/lisp/files-tests.el (files-tests--with-buffer-offer-save):
Let-bind 'y-or-n-p-use-read-key' to t.
2025-11-01 20:27:45 +02:00
Juri Linkov
ab4a616b0b 'read-multiple-choice' now uses the minibuffer to read a char (bug#79664)
* doc/lispref/commands.texi (Reading One Event): Mention
'read-char-choice-use-read-key'.

* lisp/emacs-lisp/rmc.el (rmc--show-help): Show non-selected
resized Help window at bottom.  Inhibit useless message.
Remove unnecessary call to 'pop-to-buffer'.
(read-multiple-choice): Call 'read-multiple-choice--from-minibuffer'
when 'read-char-choice-use-read-key' is nil.
(read-multiple-choice--from-minibuffer): New function.

* test/lisp/emacs-lisp/rmc-tests.el (test-rmc--with-minibuffer-setup):
New macro.
(test-read-multiple-choice, test-read-multiple-choice-help):
Test both values of 'read-char-choice-use-read-key'.
2025-11-01 20:21:09 +02:00
David Ponce
1e47f7492a lisp/emacs-lisp/cl-*.el: Minor changes accumulated during new API design
* lisp/emacs-lisp/cl-macs.el (cl-deftype): Support dispatch on
types that take arguments, as long as they can be used without arguments.

* lisp/emacs-lisp/cl-generic.el (cl--generic-derived-mode-specializers):
Rename from `cl--generic-derived-specializers` to clarify it's about
derived modes and not derived types.
(cl--generic-derived-mode-generalizer): Adjust accordingly and rename
from `cl--generic-derived-generalizer` for the same reason.
Ignore additional args in the tagcode function.
(cl-generic-generalizers) <derived-mode>: Adjust accordingly.

* lisp/emacs-lisp/macroexp.el (macroexp--dynamic-variable-p): Simplify.
2025-10-31 13:49:49 -04:00
David Ponce
13ec843352 cl-extra.el: Use the new API to speed up dispatch on derived types
* lisp/emacs-lisp/cl-extra.el (cl--types-of-memo): Delete var.
(cl--derived-type-specializers-memo): New var.
(cl-types-of): Delete function.
(cl--derived-type-specializers): New function.
(cl--derived-type-dispatch-list): Delete var.
(cl--derived-type-generalizer): Use the `:need-specializers` API instead.
(cl--derived-type-generalizers): Don't fill
`cl--derived-type-dispatch-list` any more.

* lisp/emacs-lisp/cl-preloaded.el (cl--derived-type-list): Delete var.
(cl--define-derived-type): Don't add type to `cl--derived-type-list`.

* test/lisp/emacs-lisp/cl-extra-tests.el (cl-types-test): Adjust.
2025-10-31 13:49:14 -04:00
Stefan Monnier
194b10b6ad (cl-generic-define-generalizer): Add new API
Sometimes, the computation of the tag (or the computations of
the list of specializers corresponding to a tag) can be sped up
if we know the set of specializers we're looking for.

So we add a new API for both the TAGCODE-FUNCTION and SPECIALIZERS-FUNCTION
that lets them receive the set of specializers they need to consider (or any
information they can precompute from that), i.e. the set of specializers
handled by the same generalizer currently used by the generic function
for the the specific argument on which we're currently dispatching.

* lisp/emacs-lisp/cl-generic.el (cl-generic-define-generalizer):
Document new API.
(cl--generic-collect-specializers, cl--generic-filter-specializers)
(cl--generic--tagcode-with-specializers): New helper functions.
(cl--generic-get-dispatcher): Use them to support new API.
2025-10-31 13:49:14 -04:00
Mattias Engdegård
8da4072344 * lisp/emacs-lisp/range.el (range-add-list): Don't mutate argument.
It's clear from the doc strings that this function isn't meant
to mutate its arguments.
2025-10-30 12:12:35 +01:00
Mattias Engdegård
676ee88eea Faster constant pool string searching
* lisp/emacs-lisp/bytecomp.el (byte-compile-get-constant):
No reason not to use 'assoc' to search for strings as well.
Previously we kept searching even after having found the string!
2025-10-30 12:12:35 +01:00
Mattias Engdegård
305744fdfc Define compiler macros for /=, atom and nlistp
Calls to these functions were previously rewritten in terms of other
functions both in the optimiser and during codegen, for no good reason.

This also resulted in poor diagnostics: wrong-arity calls to 'atom' and
'nlistp' produced doubled but slightly-different warnings, and no
warnings at all for '/='.

Using compiler macros fixes the problems.  The generated code is the same.

* lisp/emacs-lisp/bytecomp.el (byte-compile-negated)
(byte-compile-negation-optimizer): Replace with...
(bytecomp--define-negated): ...this compiler macro defining macro.
2025-10-30 12:12:35 +01:00
Mattias Engdegård
85e1a64943 Fix numeric comparison bug when optimisation is disabled
* lisp/emacs-lisp/bytecomp.el (byte-compile-cmp):
Don't assume that N-ary comparisons have been normalised, which is done
in the optimiser.  Reported by Pip Cet.
2025-10-30 12:12:35 +01:00
Mattias Engdegård
0fb8ed8c71 Remove unused byte-compile-eval-before-compile
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval-before-compile):
This function has been unused since 2012 (e703069f9c).
2025-10-30 12:12:35 +01:00
Eshel Yaron
330aa07f00
; elisp-scope.el: Improve face specification handling.
Replace the use of 'elisp-scope-face(-1)' for analyzing face
specifications with 'elisp-scope-1' calls with an
appropriate OUTSPEC argument.  This allows us to analyze
face specifications even when they are not passed directly
to relevant functions, but rather appear in a tail position
of a form that evaluates to a face specification.

* lisp/emacs-lisp/elisp-scope.el
(elisp-scope--match-spec-to-arg): Add new 'face' spec.
Use it instead of...
(elisp-scope-face, elisp-scope-face-1): ...these functions.
Remove them, no longer used.

* test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el:
Add test.
2025-10-29 17:20:03 +01:00