* lisp/completion-preview.el
(completion-preview-inhibit-functions): New option.
(completion-preview--post-command): Respect it.
* etc/NEWS: Announce it.
* doc/lispintro/emacs-lisp-intro.texi (Permanent Installation):
Add a cross-reference to "Contributing" in the Emacs user manual.
Suggested by Matto Fransen <matto@matto.nl>. (Bug#80393)
* lisp/speedbar.el (speedbar-get-focus)
(speedbar-frame-or-window): Support for 'speedbar-prefer-window'
with fix of 'speedbar-window' trying to delete current frame.
(Bug#80392)
* src/buffer.c (overlays_in): Fix commentary to match the code.
(Foverlays_in, Foverlays_at): Doc fixes. (Bug#80242)
* test/src/buffer-tests.el (test-overlays-at-2): Add one test.
* doc/lispref/display.texi (Finding Overlays): Update and improve
the documentation of 'overlays-in' and 'overlays-at'.
* etc/NEWS: Announce the changes.
* src/pgtkfns.c (xg_set_icon_from_xpm_data):
* src/xfns.c (xg_set_icon_from_xpm_data):
gdk-pixbuf 2.44 (2025-09) deprecated xg_set_icon_from_xpm_data,
and this breaks --enable-gcc-warnings builds.
For now, pacify GCC by using a pragma.
Uses of <vla.h>’s macro VLA_ELEMS were removed some time ago.
* admin/merge-gnulib (GNULIB_MODULES): Remove vla.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/vla.h: Remove.
* src/fns.c, src/lread.c: Do not include <vla.h>.
* lisp/vc/vc.el (vc-log-show-limit):
Change the default to 500 (bug#80037).
(vc-print-log-setup-buttons): Have the first button prompt and
propose 4X the current limit as the default.
(vc-print-fileset-branch-log):
Update the reference to the changed button text.
* lisp/vc/log-view.el (log-view-end-of-defun-1): Same.
* doc/emacs/maintaining.texi (VC Change Log): Also here.
The greedy regexp matching, broken scoring and broken highlight were
sources of frequent complaints about the 'flex' matching style. This
commit fixes that.
Inspired by the 'hotfuzz' style (available at
https://github.com/axelf4/hotfuzz) it uses a modified version of Gotoh's
1982 dynamic programming algorithm. It is strictly more correct than the
"old" flex. For example, when matching the pattern 'goto' to no longer
will 'eglot-format' be sorted before some hypothetical much better
'goobarbaz-goto'. And of course the highlighting is also correctly
placed on the 'goto', not scattered across the candidate.
Regarding performance, it is faster than the naive 'flex', primarily
because of the Elisp rewrite in minibuffer.el. The matching and costing
algorithm matters but is not the bottleneck.
The Elisp parts of the style were almost completely decoupled from the
pcm/substring styles in lisp/minibuffer.el. Only
'completion-flex-try-completion' uses some of pcm's code for pattern
augmentation.
* src/minibuf.c (completion--flex-cost-gotoh): New function.
* lisp/minibuffer.el (completion-flex--pattern-str): New variable.
(flex-score-match-tightness): Make obsolete.
(completion--flex-all-completions-1): New helper function.
(completion-flex-try-completion, completion-flex-all-completions): Rewrite.
(completion-substring--all-completions): No longer take transform-pattern-fn.
(completion--flex-adjust-metadata): Tweak.
(completion--flex-score, completion--flex-score-1)
(completion--flex-score-last-md, completion-flex--make-flex-pattern): Delete.
* test/lisp/minibuffer-tests.el (completion--sorted-flex-completions):
New helper function.
(completion-flex-test-non-ascii): New test.
(completion--pcm-score): Delete.
(completion-pcm-test-3, completion-pcm-test-4)
(completion-substring-test-1, completion-substring-test-2)
(completion-flex-test-2, completion-flex-test-3): Tweak.
* etc/NEWS: Describe change.
* lisp/emacs-lisp/package.el (package-dir-info): Do not check
files that do not satisfy 'file-regular-p' when trying to find
the file with the package metadata. (Bug#79742)
* lisp/emacs-lisp/package-activate.el (package--autosugest-line-format):
Remove variable and function.
(package--autosuggest-after-change-mode): Inject upgrade prompt
using ':propertize'. We can drop the condition testing if there
are any suggestions, as installing the package changes the major
mode and thus also 'mode-name'.
* test/lisp/progmodes/eglot-tests.el
(eglot-test-project-wide-diagnostics-rust-analyzer):
Bind project-vc-non-essential-cache-timeout to 0 so that the
result of project-current is refreshed (bug#80387).
The composite DisplayDevice is meant to be presented to the user
only if it IsPresent. It is not entirely clear whether PowerSupply
implies IsPresent, so check both (bug#80229).
* lisp/battery.el (battery-upower): Skip hot-removable batteries
that are missing from the bay.
Now that battery--upower-subscribe registers to signals from
DisplayDevice (bug#80229), it is possible to react to more than just
State changes, including Percentage and IsPresent (although the
latter may already be covered by the DeviceAdded and DeviceRemoved
signals).
That means that it should be possible to disable polling via
battery-update-timer and still get timely mode line updates.
* etc/NEWS
(Changes in Specialized Modes and Packages in Emacs 31.1):
Announce new battery-update-interval :type.
* lisp/battery.el (battery-update-interval): Allow setting to nil.
(display-battery-mode): Do not create battery-update-timer then.
(battery-upower-display-device-path): New constant.
(battery--upower-subscribe): Use it.
(battery-upower-subscribe-properties): New variable.
(battery--upower-props-changed): Use it for more flexibility over
which DisplayDevice properties to react to.
(battery--upower-signal-handler): Call battery-update-handler
directly when there is no battery-update-timer.
* lisp/battery.el (battery--upower-props-changed): Check if the
"State" has changed.
(battery--upower-subscribe): Subscribe to state changes of the
"DisplayDevice" (bug#80229).
* src/lisp.h (struct Lisp_Fwd): With the predicate enum, we can now pack
the offset and the predicate into a one-word struct.
(XBUFFER_OFFSET): Use the new field name.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the one-word struct.
* src/data.c (store_symval_forwarding): Use the new field name.
Using an enum instead of a symbol makes it obvious that this field is
of no concern to the GC.
* src/lisp.h (enum Lisp_Fwd_Predicate): New.
(struct Lisp_Fwd): Use it instead of a symbol.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the necessary enum constant
instead of a symbol.
* src/data.c (check_fwd_predicate, check_choice): New helpers.
(store_symval_forwarding): Use it.
* src/lisp.h (struct Lisp_Buffer_Objfwd): Deleted.
(struct Lisp_Fwd): Add the fields bufoffset and bufpredicate.
Make the type a 1-byte bitfield so that the entire struct still
fits in two words.
(XBUFFER_OFFSET): Renamed from XBUFFER_OBJFWD.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer)
(buffer_local_value): Update accordingly.
* src/data.c (do_symval_forwarding, store_symval_forwarding)
(set_internal, default_value, set_default_internal)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_): Use
XBUFFER_OFFSET.
* src/lisp.h (struct Lisp_Kboard_Objfwd): Deleted ...
(struct Lisp_Fwd): ... replaced with field kbdoffset.
(DEFVAR_KBOARD): Use new field.
* src/data.c (XKBOARD_OFFSET): Renamed from XKBOARD_OBJFWD.
(do_symval_forwarding, store_symval_forwarding
(set_default_internal): Use it .
* src/lisp.h (struct Lisp_Objfwd): Deleted.
(struct Lisp_Fwd): Replace it with objvar field.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_LISP_NOPROX): Use the field.
* src/lread.c (defvar_lisp): Updated as needed.
* src/pdumper.c (dump_field_fwd): Use the field.
* src/data.c (XOBJVAR): Renamed and updated from XOBJFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/lisp.h (struct Lisp Boolfwd): Deleted
(struct Lisp_Fwd): Replaced it with a boolvar field.
(DEFVAR_BOOL): Update.
* src/data.c (XBOOLVAR): Renamed from XBOOLFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/pdumper.c (dump_field_fwd): Use boolvar field.
It was a struct with a single field.
* src/lisp.h (struct Lisp_Intfwd): Deleted.
(struct Lisp_Fwd): Add an intvar field instead.
(DEFVAR_INT): Update accordingly.
* src/data.c (XINTVAR): Updated and renamed from XFIXNUMFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
This contains the type and an union of Lisp_Objfwd, Lisp_Intfwd etc.
lispfwd is now a pointer to a struct Lisp_Fwd; the void *fwdptr field is
gone.
* src/lisp.h (struct Lisp_Fwd): New.
(Lisp_Intfwd, Lisp_Boolfwd, Lisp_Objfwd, Lisp_Buffer_Objfwd)
(Lisp_Kboard_Objfwd): The type is in in Lisp_Fwd.
(lispwfd): Is now a pointer to struct Lisp_Fwd.
(SYMBOL_BLV, SET_SYMBOL_FWD, XFWDTYPE, BUFFER_OBJFWDP): Update
accordingly.
(defvar_lisp, defvar_lisp_nopro, defvar_bool, defvar_int)
(defvar_kboard): These all take now a Lisp_Fwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Update for new types.
* src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
(defvar_lisp, defvar_kboard): Update for new types.
* src/pdumper.c (dump_field_fwd, dump_blv): Update accordingly.
(dump_fwd_int, dump_fwd_bool, dump_fwd_obj, dump_fwd_buffer_obj)
(dump_fwd): Deleted.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer, buffer_local_value)
(set_buffer_internal_1): Update accordingly for new types.
* src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD, boundp)
(store_symval_forwarding, swap_in_global_binding)
(swap_in_symval_forwarding, find_symbol_value, set_internal)
(default_value, set_default_internal, make_blv, Fmake_local_variable):
Update accordingly.
The predicate field is always a builtin symbol. That means we know the
bit pattern at compile-time and they don't change at runtime.
* src/buffer.c (DEFVAR_PER_BUFFER): Create a const struct.
(defvar_per_buffer): Remove predicate and address arguments.
(syms_of_buffer): Instead of &BVAR (current_buffer, foo) use a plain foo
as argument to DEFVAR_PER_BUFFER.
* src/pdumper.c (dump_field_fwd): No more relocs needed for
Lisp_Fwd_Buffer_Obj and we can't apply them in the .rodata section.
The forwarding structs already exist in the data or bss section.
They are all created with DEFVAR_INT and similar macros. Instead
of creating new structs in the dump, create relocs to the data section.
* src/pdumper.c (dump_field_fwd): New.
(dump_blv, dump_symbol): Use it.
(dump_pre_dump_symbol): Don't dump fwd objects.
This restores the original behavior of 'overlays_in'. Changes in
this behavior had been made for cases of narrowing, but this
resulted in a regression with uses of 'remove-overlays'.
* src/buffer.c (overlays_in): Change all occurrences of ZV to Z.
* test/src/buffer-tests.el (test-overlays-in-2)
(test-remove-overlays): Adjust expected results to accommodate
changes in 'overlays_in'.
* lisp/emacs-lisp/package-activate.el (package-autosuggest-mode):
We don't need a special initializer for the minor mode, if we
are not enabling the option OOTB.
Accommodate NS Emacs on a headless system.
Add error checking for failed calls to NSColorList writeToURL
and writeToFile.
* src/nsterm.m (ns_term_init): Move color initialization to
nsfns.m.
* src/nsfns.m (ns_init_colors): New function.
(Fns_list_colors): Call ns_init_colors.