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

10315 commits

Author SHA1 Message Date
Stefan Monnier
f6d314dfe5 bytecomp.el: Rework the message when the macro is not recognized
The "Macro %s unrecognized, won't work in file" message
happened only for macros defined to `nil`, and the code handling
"unrecognized" code was split with the function part is
`byte-compile-file-form-defmumble` and the macro part in
`byte-compile-file-form-defalias`, so straighten it out
and simplify a bit.

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble):
Don't modify `byte-compile-*-environment` here.
(byte-compile-file-form-defalias): Do it here instead.
Use `macroexp-quote`.  Merge the two "unrecognized macro" warnings.
2025-07-26 18:35:00 -04:00
Eli Zaretskii
ccc3068dae Merge from origin/emacs-30
a44e9139c2 loaddefs-generate--rubric: Note about committing ldefs-bo...
e4908623f2 ; Fix documentation of 'other-window'
5f3cbd62b1 ; * lisp/international/quail.el (quail-insert-kbd-layout)...
47deb38f21 ; face-font-family-alternatives, fixed-pitch: Comments.
dd29b0ab66 Fix Eshell call to 'string-suffix-p' when checking for tr...
cbfc095ed4 * etc/PROBLEMS: Describe how to work around screen reader...
8f00d36b63 (gnus)Scoring Tips: New tip regarding header continuation...
2025-07-26 06:58:12 -04:00
Sean Whitton
a44e9139c2 loaddefs-generate--rubric: Note about committing ldefs-boot.el
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
Note that ldefs-boot.el should be committed on its own.
2025-07-26 10:22:09 +01:00
Eli Zaretskii
fa61deda32 Merge from origin/emacs-30
3b2bfdfef6 ; Fix last change (bug#79042)
740138b113 ; Fix last change
e675d5ba64 ; Update doc strings of Dired functions due to 'marked' v...
a05be41af7 ; * lisp/battery.el (battery-bsd-apm): Explain a FIXME (b...
fe3ac1575a Fix :box attribute of faces in Leuven themes.
86e32aed4a ; define-globalized-minor-mode: Fix capitalization.
2025-07-19 06:56:58 -04:00
Stefan Monnier
f8b9d80ec6 comp.el: Fix minor corner-case annoyances
* lisp/emacs-lisp/comp.el (comp--native-compile): Avoid `%s`
on objects that may not have names.
* src/data.c (Ffset): Don't compute trampoline for no-op `fset`.
2025-07-17 12:36:57 -04:00
Sean Whitton
86e32aed4a ; define-globalized-minor-mode: Fix capitalization. 2025-07-16 11:20:08 +01:00
Sean Whitton
94b2a0b2fc Merge from origin/emacs-30
24db9b7962 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.
756e7e5243 ; * lisp/window.el (window-state-put): Fix a typo (bug#79...
0fb20adf8e ; define-globalized-minor-mode: Fix info node link in doc...
2025-07-16 11:18:41 +01:00
Jonas Bernoulli
105ae06031
Allow trivially autoloading transient-define-group
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Allow uses of transient-define-group to be autoloaded using just
";;;autoload".
2025-07-15 12:45:05 +02:00
Stefan Monnier
7f1cae9637 (cl--class-allparents): Fix bug#78989
Give more control over ordering when linearizing the
parent graph and avoid pathological misbehavior (such as
placing `t` in the middle of the linearization instead of the
end) when we can't "do it right".

* lisp/subr.el (merge-ordered-lists): Degrade more gracefully in case
of inconsistent hierarchies and don't do it silently.

* lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Use the local
ordering to break ties, as in the C3 algorithm.
2025-07-14 12:37:11 -04:00
Alan Mackenzie
c44903b011 Preserve source position of macro calls in macro expansions
This allows the byte compiler to give correct positions, those
of the invoking forms, when an error or warning is caused by
the innards of the invoked macros.

This fixes bug#73725 and bug#73746.

* lisp/emacs-lisp/macroexp.el (macroexp--posify-form-1)
(macroexp--posify-form): New functions.
(macroexp-preserve-posification): New macro.
(macroexp--compiler-macro, macroexp-macroexpand): Use the new
macro to preserve a calling form's position.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form): Use the new
macro to preserve source positions.

* test/lisp/emacs-lisp/bytecomp-resources/bad-error-position.el
* test/lisp/emacs-lisp/bytecomp-resources/bad-error-position-2.el:
New test files.
* test/lisp/emacs-lisp/bytecomp-tests.el: Two new tests using
the new test files.
2025-07-13 20:28:51 +00:00
Sean Whitton
9d750c7e80 New global minor mode vc-auto-revert-mode
* lisp/vc/vc-hooks.el (auto-revert-mode): Declare.
(vc-auto-revert-mode): New global minor mode.
(vc-turn-on-auto-revert-mode-for-tracked-files): New function.
* lisp/vc/vc-dispatcher.el (auto-revert-mode)
(auto-revert-buffers): Declare.
(vc-resynch-window): Don't call vc-revert-buffer-internal when
auto-revert-mode will revert the buffer.  Call
auto-revert-buffers to ensure that this reversion happens in a
timely manner.
* lisp/vc/vc.el (vc-register): Apply vc-auto-revert-mode to
buffers visiting newly registered files.
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Improve the generated docstring.
* doc/emacs/vc1-xtra.texi (VC Auto-Reverting):
* etc/NEWS: Document the new minor mode.
2025-07-13 12:51:04 +01:00
Sean Whitton
0fb20adf8e ; define-globalized-minor-mode: Fix info node link in docstring. 2025-07-13 12:35:02 +01:00
Eli Zaretskii
4bff1dfe1f Merge from origin/emacs-30
ebb65d4163 ; Fix typos
2025-07-12 05:25:02 -04:00
Xiyue Deng
5c75ec6ae5 Add public interfaces for accessing builtin package info (Bug#78844)
* lisp/emacs-lisp/package.el (package-builtin-packages)
(package-builtin-package-version): New functions.
* doc/lispref/package.texi: Add a section 'Package Information' with
documentation for the new functions.
* etc/NEWS: Add entry for 'package-versioned-builtin-packages' and
'package-builtin-package-version'.
2025-07-12 10:03:50 +03:00
Yuan Fu
b85d9048f4
Eldoc: Run eldoc-display-functions with original buffer (bug#78530)
Also bump eldoc version so Eglot can require the new version
later.

* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Run the
hook with the original buffer as the current buffer. This way
we're certain that the buffer-local value of
'eldoc-display-functions' is used.
(eldoc-display-functions): Update docstring.
2025-07-09 19:28:45 -07:00
Andrea Corallo
48a5917681 Nativecomp don't materialize non-materializable objects (bug#78606)
The native compiler should not try to generate in rendered code
immediate floats produced by the constrain on the '=' operator.

* test/src/comp-tests.el (comp-test-78606-1): Add test.
* test/src/comp-resources/comp-test-funcs.el (comp-test-78606-1-f): New
function.
* src/comp.c (emit_mvar_rval): Check if an immediate is materializable.
* lisp/emacs-lisp/comp.el (comp-ctxt): Add 'non-materializable-objs-h'
slot.
(comp--fwprop-insn): Update call.
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Add parameter.
2025-07-09 17:32:07 +02:00
Pip Cet
6a5d9cb07d Call eieio--class-* accessors only on eieio classes (bug#78786)
* lisp/emacs-lisp/eieio-core.el (eieio-oref, eieio-oref-default):
(eieio-oset, eieio-oset-default): Don't look for class slots except in
eieio classes.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-defstruct-slot-value): New test.
2025-07-09 15:20:14 +00:00
Andrea Corallo
05ecb2b8f0 Nativecomp don't error with undeclared types (bug#6573) (don't merge)
Backporting f38e969e47 from trunk to emacs-30

* test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New
function.
* lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type'
is unknown.
2025-07-09 10:31:20 +02:00
Robert Pluim
ebb65d4163 ; Fix typos
* lisp/emacs-lisp/warnings.el (warning-display-at-bottom): Fix typo.
* lisp/replace.el (query-replace-help): Typo fix.
2025-07-07 14:49:23 +02:00
Mattias Engdegård
0de646b6a1 Turn compiler macro defalias messages into warnings
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Turn messages into warnings to make them more visible to the user and
provide a source location (bug#78792).
2025-07-07 11:04:19 +02:00
Stefan Monnier
4024a7d541 (eieio--validate-slot-value): Don't break on struct objects
Nowadays `eieio-oset` applies to more than just EIEIO objects.
The old code tended to work OK but only because `eieio--class-slots`
is usually compiled/inlined without checks.

* lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value):
Don't assume CLASS is an EIEIO class.
2025-07-05 11:18:13 -04:00
Mattias Engdegård
d1677d0a92 Make elint obsolete (bug#78685)
It never was very useful to begin with, produces lots of false positives,
and the byte-compiler has long eclipsed it in warning quality.

* lisp/emacs-lisp/elint.el: Move this file...
* lisp/obsolete/elint.el: ...here, and declare obsolete.
(elint-file, elint-directory, elint-current-buffer, elint-defun):
Declare obsolete.
(elint--file): Split from elint-file to avoid warning.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu):
Remove elint menu entries.
* etc/NEWS: Announce
2025-07-05 14:38:48 +02:00
Eli Zaretskii
4288dc7751 Merge from origin/emacs-30
3f7787c979 ; * lisp/replace.el (query-replace-help): Fix help text (...
b10596a630 ; * lisp/emacs-lisp/warnings.el (warning-display-at-botto...
060f964906 Handle ts_node_type return NULL (bug#78938)
5bdacbe460 Improve documentation of 'warning-display-at-bottom'
30dae2ad23 Handle the case when ts_node_type returns NULL (bug#78938)
985ad1da76 ; * lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc...
de18407f51 ; * doc/lispref/functions.texi (Mapping Functions): Fix w...
2025-07-05 06:02:36 -04:00
Eli Zaretskii
b10596a630 ; * lisp/emacs-lisp/warnings.el (warning-display-at-bottom): Doc fix. 2025-07-05 09:17:40 +03:00
Eli Zaretskii
5bdacbe460 Improve documentation of 'warning-display-at-bottom'
* lisp/emacs-lisp/warnings.el (warning-display-at-bottom):
* doc/lispref/display.texi (Warning Options):
* doc/emacs/windows.texi (Temporary Displays):
* etc/NEWS: Improve documentation of 'warning-display-at-bottom'.
See https://lists.gnu.org/archive/html/emacs-devel/2025-07/msg00024.html
for more details.
2025-07-04 15:02:29 +03:00
Philip Kaludercic
7f35bf9706
Expand DIR arg on `package-vc-install-from-checkout'
Expand the directory name passed to the
'package-vc-install-from-checkout' function so that paths like
"/path/to/pkg/./" are converted to "/path/to/pkg/".  This
ensures that the package name defaults to "pkg" instead of ".".
* lisp/emacs-lisp/package-vc.el
(package-vc-install-from-checkout): Expand the provided
directory name.  (Bug#78855)

Co-developed-by: Roi Martin <jroi.martin@gmail.com>
2025-07-01 22:04:45 +02:00
Eli Zaretskii
985ad1da76 ; * lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc fix (bug#78394). 2025-07-01 14:17:42 +03:00
Zach Shaftel
bca0ce9d07 Add new gv place definitions
* lisp/emacs-lisp/gv.el (char-table-extra-slot, char-table-parent)
(default-toplevel-value, marker-insertion-type, process-plist)
(process-query-on-exit-flag, process-thread, lookup-key)
(window-prev-buffers, window-next-buffers, window-new-normal, font-get)
(charset-plist, get-charset-property): Add gv-setters.
(terminal-parameter): Fix the return value.  (Bug#78291)
2025-06-29 07:29:25 +03:00
Protesilaos Stavrou
202a7039a2 Define dedicated faces for the package.el mode line
* lisp/emacs-lisp/package.el
(package-menu--set-mode-line-format): Apply the faces.
(package-mode-line-total, package-mode-line-installed)
(package-mode-line-to-upgrade, package-mode-line-new): Define
the faces.  (Bug#78867)
2025-06-28 12:50:22 +03:00
Elías Gabriel Pérez
eda47cd2a8 Add tool bar icons to package menu. (Bug#78601)
* etc/images/package-menu/README:
* etc/images/package-menu/delete.xpm:
* etc/images/package-menu/execute.xpm:
* etc/images/package-menu/info.xpm:
* etc/images/package-menu/install.xpm:
* etc/images/package-menu/unmark.xpm:
* etc/images/package-menu/upgrade.xpm:
* etc/images/package-menu/url.xpm:
* etc/images/package-menu/delete.pbm:
* etc/images/package-menu/execute.pbm:
* etc/images/package-menu/info.pbm:
* etc/images/package-menu/install.pbm:
* etc/images/package-menu/unmark.pbm:
* etc/images/package-menu/upgrade.pbm:
* etc/images/package-menu/url.pbm: New files.
* lisp/emacs-lisp/package.el (package-menu--tool-bar-map): New
variable.
(package-menu-mode): Set tool bar.
* lisp/term/pgtk-win.el (x-gtk-stock-map):
* lisp/term/x-win.el (x-gtk-stock-map): Add new icons to alist.
2025-06-28 11:34:41 +03:00
Andrea Corallo
baf0c82202 * Make native comp use lexbinding for sync compilations (bug#78818)
* lisp/emacs-lisp/comp.el (comp--final): Use lexical-binding in the temp file.
2025-06-23 22:04:05 +02:00
Stefan Monnier
08fba517f6 (smerge-refine-shadow-cursor): New variable and face (bug#78806)
* lisp/vc/smerge-mode.el (smerge-refine-shadow-cursor): New variable
and face.
(smerge-refine-regions): Add `cursor-sensor-functions` property
to the covering overlays.
(smerge--refine-at-right-margin-p, smerge--refine-shadow-cursor):
New functions.
(smerge--refine-other-pos): New function, extracted from
`smerge-refine-exchange-point`.
(smerge-refine-exchange-point): Use it.
(smerge--refine-highlight-change): Add thin
highlighted space for insertion/deletion positions.

* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect):
Run functions for `moved` events.  Demote errors.
(cursor-sensor-mode): Adjust docstring accordingly.

* doc/lispref/text.texi (Special Properties) <cursor-sensor-functions>:
Mention the new `moved` direction.
2025-06-23 00:00:38 -04:00
Eli Zaretskii
e66428a0d2 ; Fix last change
* lisp/emacs-lisp/package.el (package-mark-install-line)
(package-mark-delete-line): Doc fixes.  (Bug#78794)
2025-06-22 11:08:04 +03:00
Elías Gabriel Pérez
be0b44e4ed Pretiffy package-menu (Bug#78794)
Add package-menu mode-line which displays information about:
total number of packages installed, total number of packages
from all the packages archive, total number of packages to
upgrade and total number of new packages available.
Highlight packages marked for installation or deletion.
* lisp/emacs-lisp/package.el (package-menu-mode): Add package-menu
mode-line format to 'mode-line-misc-info'.
(package-mark-install-line, package-mark-delete-line): New faces.
(package-menu--overlay-line, package-menu--remove-overlay)
(package-menu--set-mode-line-format): New functions.
(package-menu-mark-delete, package-menu-mark-install)
(package-menu-mark-unmark, package-menu-backup-unmark)
(package-menu-mark-obsolete-for-deletion): Tweak for set/unset the
overlays.
(package-menu-mode-line-format, package-menu-mode-line-info): New
buffer-local variables.
(list-packages): Add 'package-menu--set-mode-line-format' to
'package--post-download-archives-hook'.

* etc/NEWS: Announce changes.
2025-06-22 11:04:51 +03:00
Eli Zaretskii
31febb1a28 Merge from origin/emacs-30
a2bfce5d2a ; Fix customization and doc strings in pp.el
2025-06-21 06:26:10 -04:00
Zach Shaftel
075ebed98f Fix byte-compilation of defalias with a constant macro cons pair
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Quote the function name in '(macro . function-name), since we eval
it later.
* test/lisp/emacs-lisp/bytecomp-tests.el
(test-eager-load-macro-expand-defalias): New test.
(Bug#78792)
2025-06-21 11:40:17 +03:00
Pip Cet
b6cf7c0942 Make cl-random behave consistently for unusual arguments (bug#75105)
The old behavior was for (cl-random -1.0e+INF) to return NaN in about
one in eight million calls, and -1.0e+INF otherwise.  Other unusual
arguments were handled inconsistently as well.

* lisp/emacs-lisp/cl-extra.el (cl-random): Handle positive finite
arguments consistently, error for nonpositive or infinite arguments.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-random): New
test.
2025-06-20 06:09:24 +00:00
Michael Albinus
e3e0be8786 ; Fix last change 2025-06-18 21:08:30 +02:00
Michael Albinus
5310083ba0 Show test name in ERT progress bar
* lisp/emacs-lisp/ert.el
(ert--results-progress-bar-button-help-echo): New defun.
(ert--results-progress-bar-button): Use it.
2025-06-18 20:12:55 +02:00
Pip Cet
af68c6e825 Remove eieio's ...-list-p predicate (bug#78782)
There seem to be no remaining callers of this function, which has not
been working for a while.

* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): Don't
mention "-list-p" predicate.
(eieio-defclass-autoload): Don't autoload predicate.
(eieio-defclass-internal): Remove code to generate list-p predicate.
2025-06-18 11:41:43 +00:00
Mattias Engdegård
3f72004961 Fix function arity check for noncompiled callees (bug#78685)
This fixes a regression from Emacs 29, and is the second attempt after
the later reverted 8b0f5b0597.

* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition):
Make it work for functions that aren't compiled.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--f):
(bytecomp-tests--warn-arity-noncompiled-callee): Add test.
2025-06-17 20:18:53 +02:00
Andrea Corallo
f38e969e47 Make nativecomp don't error when encountering undeclared types (bug#6573)
* test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New
function.
* lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type'
is unknown.
2025-06-17 09:22:32 +02:00
Eli Zaretskii
a2bfce5d2a ; Fix customization and doc strings in pp.el
* lisp/emacs-lisp/pp.el (pp-default-function): Fix :tag's.
(pp-29, pp-28): Doc fixes.  (Bug#78801)
2025-06-16 10:00:41 +03:00
Jim Porter
90c0c9a01e Clean up text properties in 'visual-wrap-prefix-mode'
Before refontifying a region, remove any text properties we care about
so that we don't end up with stray properties.  Additionally, make sure
to remove all the properties when deactivating the mode.

* lisp/emacs-lisp/subr-x.el (add-remove--display-text-property): New
function, extracted from...
(add-display-text-property): ... here.
(remove-display-text-property): New function.

* lisp/visual-wrap.el (visual-wrap--remove-properties): New function...
(visual-wrap-prefix-function, visual-wrap-prefix-mode): ... call it.

* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-remove-display-text-property): New test.

* test/lisp/visual-wrap-tests.el
(visual-wrap-tests/wrap-prefix-stickiness, visual-wrap-tests/cleanup):
New tests.

* doc/lispref/display.texi (Display Property): Document
'remove-display-text-property'.

* etc/NEWS: Announce 'remove-display-text-property' (bug#76018).
2025-06-10 22:09:26 -07:00
Jim Porter
24e6cd4233 Improve documentation for display property functions
Specifically, use the term "display specification" more consistently to
distinguish from "display property", which is the full value of the
'display' text property.

* src/xdisp.c (find_display_property): Rename PROP to SPEC.
(Fget_display_property): Rename PROP to SPEC and improve docstring.

* lisp/emacs-lisp/subr-x.el (add-display-text-property): Rename PROP to
SPEC and improve docstring.

* doc/lispref/display.texi (Display Property): Reword documentation to
more-consistently refer to display specifications.
2025-06-10 22:09:26 -07:00
Jim Porter
4a3c8e6e1d Don't delete in-place when replacing a display property
When calling 'add-display-text-property' on a region of text that
already contains PROP, we first delete the old display specification
from the region.  If the region's 'display' property is a list of
display specifications, we need to avoid destructively modifying the
list; other regions of text could be using the same list object.  (For a
'display' property that's a vector or a single display spec, this
doesn't matter since we first make a new list in the code.)

In addition, be more careful when working with a display property like
((margin ...) ...).  This is a single display specification, not a list
of display specs.

* lisp/emacs-lisp/subr-x.el (add-display-text-property): Don't delete
in-place for list values.  Handle (margin ...) display specification
type correctly.

* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-add-display-text-property): Update test.
2025-06-10 22:09:26 -07:00
Mattias Engdegård
7f6244364b Revert "Fix function arity check for noncompiled callees (bug#78685)"
This reverts commit 8b0f5b0597.

This change wasn't quite right; the solution requires greater care.
2025-06-09 12:56:46 +02:00
Eli Zaretskii
62014576dc Fix 'save-some-buffers' when file name has embedded '%'
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't assume the
prompt will never include the '%' character.  (Bug#78715)
2025-06-07 16:35:42 +03:00
Eli Zaretskii
9629ade0b0 Teach checkdoc about (:this that) in cl-defun
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Support more complex keyword args.  (Bug#78543)
2025-06-07 12:15:33 +03:00
Mattias Engdegård
8b0f5b0597 Fix function arity check for noncompiled callees (bug#78685)
This is a regression from Emacs 29.

* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition):
Make it work for functions that aren't compiled.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--f):
(bytecomp-tests--warn-arity-noncompiled-callee): Add test.
2025-06-05 18:18:05 +02:00