]> git.eshelyaron.com Git - emacs.git/log
emacs.git
15 months agoproject-recompile: New command
Dmitry Gutov [Sun, 21 Jan 2024 05:08:11 +0000 (07:08 +0200)]
project-recompile: New command

* lisp/progmodes/project.el (project-recompile):
New command (bug#68570).

(cherry picked from commit 0a07603ae8db41f69e83b1bfec6e28a92f737852)

15 months ago; * etc/NEWS: Improve mwheel entry.
Po Lu [Sun, 21 Jan 2024 04:49:41 +0000 (12:49 +0800)]
; * etc/NEWS: Improve mwheel entry.

(cherry picked from commit cc8d4b0c9110c1384f5a9c214cf4069b3e99ae9b)

15 months agoDon't invert wheel event directions
Po Lu [Sun, 21 Jan 2024 04:47:24 +0000 (12:47 +0800)]
Don't invert wheel event directions

* lisp/mwheel.el (mwheel--is-dir-p): In Emacs, up means down and
down means up...

(cherry picked from commit 957b4f826a440d3d6fae8e338667530713ddf0ba)

15 months ago* lisp/mwheel.el (mouse-wheel-obey-old-style-wheel-buttons): Simplify
Stefan Monnier [Sun, 21 Jan 2024 04:12:36 +0000 (23:12 -0500)]
* lisp/mwheel.el (mouse-wheel-obey-old-style-wheel-buttons): Simplify

(cherry picked from commit eca7368039d841993ba649bc144017598592fa56)

15 months ago(define-derived-mode): Fix bug#68600
Stefan Monnier [Sun, 21 Jan 2024 04:00:54 +0000 (23:00 -0500)]
(define-derived-mode): Fix bug#68600

* lisp/emacs-lisp/derived.el (define-derived-mode): Use a reference
to the mode symbol instead of the mode's "pretty" name in
the hook variable's docstring.

(cherry picked from commit ca8d451561c5f722f7c3bfc63595961334b7b5f9)

15 months ago; * msdos/sedleim.inp: Adapt to Emacs 30.
Po Lu [Sun, 21 Jan 2024 02:33:30 +0000 (10:33 +0800)]
; * msdos/sedleim.inp: Adapt to Emacs 30.

(cherry picked from commit d88f9717ae6279a7577023f8630bd777d1b153b0)

15 months ago* make-dist (possibly_non_vc_files): Append exec standard files.
Po Lu [Sun, 21 Jan 2024 02:04:02 +0000 (10:04 +0800)]
* make-dist (possibly_non_vc_files): Append exec standard files.

(cherry picked from commit e654f9ce1e6f146346160044a6469e34f25dfeea)

15 months ago; * exec/Makefile.in: Correct typo.
Po Lu [Sun, 21 Jan 2024 01:58:17 +0000 (09:58 +0800)]
; * exec/Makefile.in: Correct typo.

(cherry picked from commit 8da6c8c7c1e25d2d1d511b50c0ff94097e512470)

15 months agoSuppress detection of utmpx.h on Android
Po Lu [Sun, 21 Jan 2024 01:53:55 +0000 (09:53 +0800)]
Suppress detection of utmpx.h on Android

* configure.ac (ac_cv_header_utmpx_h): Predefine to no when
Android is older than 34.

(cherry picked from commit 10ffe161da67a550534c818cab27001b1e75c79f)

15 months ago; * exec/Makefile.in (extraclean): Remove standard files.
Po Lu [Sun, 21 Jan 2024 01:15:55 +0000 (09:15 +0800)]
; * exec/Makefile.in (extraclean): Remove standard files.

(cherry picked from commit 76efd4037eeba53ad5716477c55bdf7ae6ccf6d9)

15 months agoOmit -DHAVE_CONFIG_H
Paul Eggert [Sun, 21 Jan 2024 00:52:31 +0000 (16:52 -0800)]
Omit -DHAVE_CONFIG_H

* configure.ac (CFLAGS): Do not add -DHAVE_CONFIG_H.  It is no
longer needed now that the Android printf hack has been removed.

(cherry picked from commit 416fad04c26d712a0897c7a03566425133c6c7d1)

15 months agoSpeed up make_lisp_symbol when debugging
Paul Eggert [Sun, 21 Jan 2024 00:52:31 +0000 (16:52 -0800)]
Speed up make_lisp_symbol when debugging

* src/lisp.h (make_lisp_symbol): In eassert use XBARE_SYMBOL
rather than XSYMBOL.  This is safe because the symbol must be
bare.  The change speeds up make_lisp_symbol when debugging.

(cherry picked from commit bdcd662a21f4c4265f704b69deb9cf277a663ea7)

15 months agoSimplify and tune XSYMBOL
Paul Eggert [Sun, 21 Jan 2024 00:52:31 +0000 (16:52 -0800)]
Simplify and tune XSYMBOL

* src/lisp.h (XSYMBOL): Simplify and tune.  There is no need to
examine symbols_with_pos_enabled here, since the arg must be a symbol
so if it's not a bare symbol then it must be a symbol_with_pos;
and checking whether a symbol is bare is cheap.

With Ubuntu 23.10 on a Xeon W-1350, this shrank Emacs’s executable
text size by 0.1% and sped up a default build of all *.elc files by
0.4%.

Remove unnecessary eassert, since XBARE_SYMBOL and XSYMBOL_WITH_POS
have easserts that suffice.

(cherry picked from commit cf26f573162130fed73c6e5603cb58e158903add)

15 months agoBe more systematic about parens in C source code
Paul Eggert [Sun, 21 Jan 2024 00:52:31 +0000 (16:52 -0800)]
Be more systematic about parens in C source code

Be more systematic about putting space before paren in calls,
and in avoiding unnecessary parentheses in macros.
This was partly inspired by my wading through gcc -E output
while debugging something else, and seeing too many parens.

This patch does not change the generated .o files on my platform.

(cherry picked from commit b6ed79b71ccb3df8df05531d473ff9510cf9a39f)

15 months agoOmit some parens
Paul Eggert [Sun, 21 Jan 2024 00:52:31 +0000 (16:52 -0800)]
Omit some parens

* src/lisp.h (XBARE_SYMBOL, XSYMBOL): Omit parentheses that are no
longer needed now that we have symbols with positions and these
symbols are never macros.

(cherry picked from commit 0a47a5a4bef0a33c012302346685ecab861cc306)

15 months agoPacify gcc -Wsuggest-attribute=malloc
Paul Eggert [Sun, 21 Jan 2024 00:52:31 +0000 (16:52 -0800)]
Pacify gcc -Wsuggest-attribute=malloc

* src/lisp.h (hash_table_alloc_bytes):
Declare with ATTRIBUTE_MALLOC_SIZE ((1)).

(cherry picked from commit 973c1b8a1838b78d1388437c2aa7f4eb4dceb7d9)

15 months agoFix autogen.sh’s spurious ‘git diff’ output
Paul Eggert [Sun, 21 Jan 2024 00:26:45 +0000 (16:26 -0800)]
Fix autogen.sh’s spurious ‘git diff’ output

Problem reported by Gerd Möllmann (Bug#68464).
* .gitignore: Ignore files in exec that are now copied from build-aux.
* admin/merge-gnulib (avoided_flags): Instead of clearing
autom4te.cache here ...
* autogen.sh (do_git): ... clear it here.
Use config.guess, config.sub and install-sh from
the Emacs repository, as they are more likely to be up to date.
This avoids unnecessary differences among different builders,
and avoids unnecessary ‘git diff’ output after autogen.sh.
Also, copy these files from build-aux to exec since there
should be no difference between the two copies.
* exec/config.guess, exec/config.sub, exec/install-sh:
Remove from repository, as autogen.sh now copies them from build-aux.

(cherry picked from commit afc9cd1721c586f960af5e324a61418775ac4543)

15 months agomwheel.el: Code clean to reduce duplication
Stefan Monnier [Sat, 13 Jan 2024 00:05:24 +0000 (19:05 -0500)]
mwheel.el: Code clean to reduce duplication

* lisp/mwheel.el (mouse-wheel-obey-old-style-wheel-buttons): New var,
extracted from `mouse-wheel-*-event` definitions.
(mouse-wheel-down-event, mouse-wheel-up-event)
(mouse-wheel-left-event, mouse-wheel-right-event): Use it.

(cherry picked from commit 998667f90262432facbf43cdb1f0a96704c84271)

15 months agomwheel.el: Remove `mouse-wheel-*-alternate-event` vars
Stefan Monnier [Fri, 12 Jan 2024 23:52:37 +0000 (18:52 -0500)]
mwheel.el: Remove `mouse-wheel-*-alternate-event` vars

Now that `wheel-DIR` events are hardcoded, we never need more than
one variable (which we actually never needed anyway, we could have
let `mouse-wheel-*-event` vars hold lists of events instead), so
remove the `mouse-wheel-*-alternate-event` vars by merging their
default value into that of the corresponding `mouse-wheel-*-event`.

* lisp/mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event)
(mouse-wheel-left-event, mouse-wheel-right-event): Don't bother holding
`wheel-DIR` events since these are already handled anyway.
Hold the event that would have been held in
`mouse-wheel-DIR-alternate-event` instead.
(mouse-wheel-down-alternate-event, mouse-wheel-up-alternate-event)
(mouse-wheel-left-alternate-event, mouse-wheel-right-alternate-event):
Delete vars.
(mwheel--is-dir-p, mouse-wheel--setup-bindings):
* lisp/edmacro.el (edmacro-fix-menu-commands):
* lisp/completion-preview.el (completion-preview--mouse-map):
Don't use `mouse-wheel-up/down-alternate-event` any more.
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Do nothing, because it already ignored those vars.

(cherry picked from commit 18294854c717a82966090e99130bcb99fc354a5b)

15 months agomwheel.el: Unconditionally use the `wheel-up/down/...` events
Stefan Monnier [Fri, 12 Jan 2024 23:28:12 +0000 (18:28 -0500)]
mwheel.el: Unconditionally use the `wheel-up/down/...` events

The `mouse-wheel-DIR-event` vars were introduced because under X11
we get different `mouse-N` events depending on the users' mouse and
those same events can be used for other things for other rodents, so we
can't unconditionally treat those events as mouse-wheel events.

But this does not apply to the `wheel-up/down/...` events.
So hard code them.

* lisp/mwheel.el (mwheel--is-dir-p): Always consider the `wheel-DIR` events.
(mouse-wheel--setup-bindings): Always bind the `wheel-DIR` events.

* lisp/completion-preview.el (completion-preview--mouse-map):
Unconditionally bind the `wheel-DIR` events.
* lisp/edmacro.el (edmacro-fix-menu-commands): Hard code the
`wheel-DIR` events as mouse events regardless of `mouse-wheel-*-event`s.
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Do nothing, because it's already been done in commit e5be6c7ae309.

* doc/lispref/commands.texi (Misc Events): Document the need to use
`wheel-up/down/left/right` unconditionally.

(cherry picked from commit db8890b3c96289ca95e4ea3ea53f0eda1a948af6)

15 months ago* lisp/completion-preview.el: Fix use in non-GUI session
Stefan Monnier [Fri, 12 Jan 2024 23:08:31 +0000 (18:08 -0500)]
* lisp/completion-preview.el: Fix use in non-GUI session

Fix loading in non-GUI sessions where `mwheel` is not preloaded.
Not requiring `mwheel` would be a lot more complex, since it would
require delaying the construction of `completion-preview--mouse-map`.

* lisp/completion-preview.el (<toplevel>): Require `mwheel`.
Remove correspondingly redundant `defvar`s.
(completion-preview--mouse-map): Use `key-description` rather than mimicking
it with `format`.

(cherry picked from commit 82f71e106afd9bede95cfea3025f7c059d7c2bcf)

15 months ago* lisp/keymap.el (define-keymap): Demote "duplicate def" to a warning
Stefan Monnier [Fri, 12 Jan 2024 23:05:14 +0000 (18:05 -0500)]
* lisp/keymap.el (define-keymap): Demote "duplicate def" to a warning

* test/src/keymap-tests.el (keymap-test-duplicate-definitions):
Adjust accordingly.

(cherry picked from commit eb779ae64677e643d2d78cfc2b016088e8d7ff98)

15 months agoUpdate from Gnulib by running admin/merge-gnulib
Paul Eggert [Sat, 20 Jan 2024 19:45:04 +0000 (11:45 -0800)]
Update from Gnulib by running admin/merge-gnulib

(cherry picked from commit 3add626f1405739aa430adcc0b4c27e587a7c561)

15 months agoAvoid Gnulib ‘access’ module
Paul Eggert [Sat, 20 Jan 2024 19:26:09 +0000 (11:26 -0800)]
Avoid Gnulib ‘access’ module

* admin/merge-gnulib (AVOIDED_MODULES): Add ‘access’,
since I don’t think Emacs cares about the Mac OS X 10.5
bug where faccessat ignores a trailing slash on a symlink
to a directory.  This will matter the next time we run
admin/merge-gnulib.

(cherry picked from commit d276996c4f60395464ca8d5d7de487022b4937fa)

15 months ago(mwheel--is-dir-p): New macro to reduce code duplication
Stefan Monnier [Fri, 12 Jan 2024 22:50:09 +0000 (17:50 -0500)]
(mwheel--is-dir-p): New macro to reduce code duplication

It also slightly reduces memory allocation.

* lisp/mwheel.el (mwheel--is-dir-p): New macro.
(mwheel-scroll, mouse-wheel-text-scale)
(mouse-wheel-global-text-scale): Use it.

(cherry picked from commit a764b503e126a60ff4ea1266da924de7b020637e)

15 months ago(mouse-wheel-*-event): Minor cleanups
Stefan Monnier [Tue, 9 Jan 2024 16:34:05 +0000 (11:34 -0500)]
(mouse-wheel-*-event): Minor cleanups

* lisp/mwheel.el (mwheel-event-button): Mark as obsolete alias.
Change all callers.

* lisp/edmacro.el (mouse-wheel-*-event): Move declarations to ...
(edmacro-fix-menu-commands): ... where we do know that they should
be defined.  Obey `mouse-wheel-*-alternate-event`s as well.

(cherry picked from commit ee2a8fd4cff84cd5bd672fdde8ec3e0800f132be)

15 months ago; * doc/emacs/mini.texi (Completion Multi): Fix typo.
Eshel Yaron [Sun, 21 Jan 2024 07:25:08 +0000 (08:25 +0100)]
; * doc/emacs/mini.texi (Completion Multi): Fix typo.

15 months agoHighlight input separators in 'c-r-m' minibuffers
Eshel Yaron [Sat, 20 Jan 2024 19:03:20 +0000 (20:03 +0100)]
Highlight input separators in 'c-r-m' minibuffers

* lisp/emacs-lisp/crm.el (crm-separator): New face.
(crm-highlight-separators): New function.
(crm-change-separator, completing-read-multiple-mode): Use it.

* doc/emacs/mini.texi (Completion Multi): Mention sep highlighting.

* etc/NEWS: Announce it.

15 months agoEldoc: play nice with mode-line-format-right-align (bug#68547)
Eshel Yaron [Sat, 20 Jan 2024 11:43:27 +0000 (05:43 -0600)]
Eldoc: play nice with mode-line-format-right-align (bug#68547)

* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Avoid nesting
'mode-line-format', since that breaks 'mode-line-format-right-align'.

(cherry picked from commit 412cc0212d7bf2f2d0f49fdb8a4ff69480b8afed)

15 months ago; Merge NEWS.29.
Eli Zaretskii [Sat, 20 Jan 2024 11:40:54 +0000 (06:40 -0500)]
; Merge NEWS.29.

(cherry picked from commit ce836aafaa581e5b713eb289071dbeed73166c99)

15 months ago; Fix merge snafus
Eli Zaretskii [Sat, 20 Jan 2024 11:37:09 +0000 (06:37 -0500)]
; Fix merge snafus

* lisp/jsonrpc.el:
* lisp/progmodes/eglot.el: Fix merge snafus.

(cherry picked from commit 8bb5525b62163d7c3617a8b61da94f1a12a8d8e8)

15 months ago; Skip commit 3a5ee060571b29474f83ebaee11df6920ea68c6a
Eshel Yaron [Sat, 20 Jan 2024 16:29:43 +0000 (17:29 +0100)]
; Skip commit 3a5ee060571b29474f83ebaee11df6920ea68c6a

15 months agoFix blunder in labeled_narrow_to_region
Gregory Heytings [Thu, 11 Jan 2024 23:38:22 +0000 (23:38 +0000)]
Fix blunder in labeled_narrow_to_region

* src/editfns.c (labeled_narrow_to_region): Record point before,
instead of after, calling narrow-to-region; otherwise point may
already have been changed.  Fixes bug#66764.

(cherry picked from commit 5bb5590dec95e813ed120b3f09734451b4ebb18f)

15 months agoFix documentation of icon-elements
Daniel Martín [Sun, 14 Jan 2024 14:36:16 +0000 (15:36 +0100)]
Fix documentation of icon-elements

* lisp/emacs-lisp/icons.el (icon-elements): The plist key it returns
is `image', not `display'.  (Bug#68451)

(cherry picked from commit 78ddb32fadb61b3e78047400e257d57b2cff7cd8)

15 months ago; Fix typos in symbol names
Stefan Kangas [Sun, 14 Jan 2024 13:56:06 +0000 (14:56 +0100)]
; Fix typos in symbol names

(cherry picked from commit 725a3f32f8ba78ac5fffcd03be5b82cbc2c1b275)

15 months agoImprove two docstrings in ox-latex
Stefan Kangas [Sun, 14 Jan 2024 13:52:17 +0000 (14:52 +0100)]
Improve two docstrings in ox-latex

* lisp/org/ox-latex.el (org-latex-src-block-backend)
(org-latex-engraved-theme): Improve docstring; mention that
engrave-faces is a GNU ELPA package.

(cherry picked from commit 6653ee66ca5ebd42322613a09d4c0d2e35af924b)

15 months agoDoc fix in auth-source-read-char-choice
Stefan Kangas [Sun, 14 Jan 2024 13:47:39 +0000 (14:47 +0100)]
Doc fix in auth-source-read-char-choice

* lisp/auth-source.el (auth-source-read-char-choice): Don't
document 'dropdown-list', which was removed in 2011.

(cherry picked from commit 7d869a04029798410773fe6071e76b556d3a9ee2)

15 months agoFix info-xref-tests
Eli Zaretskii [Sat, 13 Jan 2024 18:38:34 +0000 (20:38 +0200)]
Fix info-xref-tests

* doc/lispintro/emacs-lisp-intro.texi (How let Binds Variables):
Fix cross-reference.  (Bug#68428)

* test/lisp/info-xref-tests.el (info-xref-test-write-file): Fix
test on MS-Windows when run from MSYS Bash.

(cherry picked from commit 1f97a8787957e49f1893b9ac73c95228f6ac1a13)

15 months agoAdd @kindex in manuals for existing keybindings on 'C-x x/w' (bug#13167)
Juri Linkov [Sat, 13 Jan 2024 18:11:21 +0000 (20:11 +0200)]
Add @kindex in manuals for existing keybindings on 'C-x x/w' (bug#13167)

* doc/emacs/buffers.texi (Misc Buffer): Add @kindex for 'C-x x r',
'C-x x u', 'C-x x i'.

* doc/emacs/display.texi (Line Truncation): Add @kindex for 'C-x x t'.

* doc/emacs/files.texi (Reverting): Add @kindex for 'C-x x g'.

* doc/emacs/windows.texi (Change Window): Use new keybinding 'C-x w 0'
instead of 'M-x delete-windows-on'.

* doc/misc/info.texi (Create Info buffer): Add @kindex for 'C-x x n'.

(cherry picked from commit 51f391998b19a94d35d743952006afd71ad7f545)

15 months ago; Make Eshell completion test more robust
Eshel Yaron [Sat, 20 Jan 2024 12:27:08 +0000 (13:27 +0100)]
; Make Eshell completion test more robust

15 months agoRound projs computed executing IP/ISECT instructions and improve IUP
Po Lu [Sat, 20 Jan 2024 01:30:04 +0000 (09:30 +0800)]
Round projs computed executing IP/ISECT instructions and improve IUP

* src/sfnt.c (sfnt_multiply_divide_rounded): New function.
(sfnt_multiply_divide_signed): Always round values, as fonts
which rely on IP to move points in concert with prior motion and
subsequently round such points with MDAP are sensitive to minor
deviations in the behavior of the former instruction.
(load_unscaled): New macro.
(IUP_SINGLE_PAIR, sfnt_interpret_iup_1): Compute ratio w/
unscaled points if possible.

(cherry picked from commit b3e4fbe867f96a28c5dc9db19fcad2af5b4a4b7e)

15 months agotrace.el: Mention the last change in NEWS
Stefan Monnier [Fri, 19 Jan 2024 20:04:50 +0000 (15:04 -0500)]
trace.el: Mention the last change in NEWS

(cherry picked from commit a34b76cd663e39d9f5d30c4b0e49ba246fac0d63)

15 months agotrace.el: Make it usable in batch mode as well
Stefan Monnier [Fri, 19 Jan 2024 20:02:50 +0000 (15:02 -0500)]
trace.el: Make it usable in batch mode as well

While at it, this fixes a bug where a traced function was not
able to set `deactivate-mark`.

* lisp/emacs-lisp/trace.el (trace--insert): New function, extracted
from `trace-make-advice`.  Output to stdout in batch mode.
(trace--entry-message): Rename from `trace-entry-message`.
Change calling convention.  Do the insertion directly from here.
(trace--exit-message): Rename from `trace-exit-message`.
Change calling convention.  Do the insertion directly from here.
(trace-make-advice, trace-values): Simplify accordingly.

(cherry picked from commit 1293aac0df4e2837a141818f225539ec847b6684)

15 months agoFix another cause of superfluous inotify signals on Android
Po Lu [Fri, 19 Jan 2024 12:51:24 +0000 (20:51 +0800)]
Fix another cause of superfluous inotify signals on Android

* src/android.c (android_select): If the event queue isn't
empty upon the initial check, clear all fdsets.

(cherry picked from commit bd5bfc29137b6e452e1900a1fc3cf09e77959133)

15 months ago; (crm-change-separator): Enable recursive minibuffers.
Eshel Yaron [Fri, 19 Jan 2024 19:02:21 +0000 (20:02 +0100)]
; (crm-change-separator): Enable recursive minibuffers.

15 months agoNew command 'crm-complete-and-insert-separator'
Eshel Yaron [Sat, 20 Jan 2024 08:32:29 +0000 (09:32 +0100)]
New command 'crm-complete-and-insert-separator'

* lisp/emacs-lisp/crm.el (crm-complete-and-insert-separator): New
command.
(completing-read-multiple-mode-map): Bind it to 'C-,'.
(crm-canonical-separator, crm-common-separators): New variables.
(completions-multi-mode): Adapt mode line lighter.
(crm-complete-and-exit): Only suggest in 'M-x' in 'minibuffer-mode'.
(crm-change-separator): (Re)set canonical separator.

* doc/lispref/minibuf.texi (Minibuffer Completion): Update.
* doc/emacs/mini.texi (Completion Multi): New subsection.
(Completion Commands): Fix markup.
(Completion)
* doc/emacs/emacs.texi (Top): Add menu entry.

* etc/NEWS: Announce 'crm-complete-and-insert-separator'.

15 months ago; * etc/NEWS: (re-)announce 'completions-auto-update-mode'.
Eshel Yaron [Fri, 19 Jan 2024 09:06:16 +0000 (10:06 +0100)]
; * etc/NEWS: (re-)announce 'completions-auto-update-mode'.

15 months ago; Enable recursive minibuffers for reading completion restrictions
Eshel Yaron [Fri, 19 Jan 2024 08:31:50 +0000 (09:31 +0100)]
; Enable recursive minibuffers for reading completion restrictions

* lisp/minibuffer.el (minibuffer-widen-completions): Let-bind
'enable-recursive-minibuffers' to t.

15 months agoRedo doc strings for ERC's entry point commands
F. Jason Park [Sun, 14 Jan 2024 21:02:27 +0000 (13:02 -0800)]
Redo doc strings for ERC's entry point commands

* lisp/erc/erc.el: Bump Compat version in Package-Requires header to
29.1.4.4.
(erc-select-read-args): Revise doc string, and update name of internal
`--interactive-env--' entry-point parameter.
(erc, erc-tls): Don't use `&interactive-env' as a variable name, in
case it confuses persons or programs.  Overhaul doc string in response
to user complaints.  For `erc' specifically, include literal
`:keyword' symbols to help non-Emacs users understand the required
syntax, which isn't obvious without an example, like `erc-tls' has,
and with only "&key" and upcased metasynctatic variables to go by.
(erc--current-buffer-joined-p): Remove assertion.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el
(erc-scenarios-keep-place-indicator--follow): Try waiting for
intermittently failing condition.
* test/lisp/erc/erc-tests.el (erc-select-read-args): Update name of
internal keyword variable.

(cherry picked from commit dd2caf1a7634ea6fd8aebbdc45ea4caf22d786cd)

15 months agoAdd test for erc-extract-command-from-line
F. Jason Park [Mon, 15 Jan 2024 13:53:24 +0000 (05:53 -0800)]
Add test for erc-extract-command-from-line

* lisp/erc/erc.el (erc-extract-command-from-line): Redo doc string.
* test/lisp/erc/erc-tests.el (erc--parse-isupport-value): Add case for
commonly seen escaped character ?=.
(erc-extract-command-from-line): New test.
; * test/lisp/erc/resources/erc-d/resources/basic.eld: Update.
; Don't send unnegotiated multi-prefixed userhost names.
; * test/lisp/erc/resources/erc-d/resources/dynamic-barnet.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/dynamic.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/eof.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/fuzzy.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/incremental.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/linger.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/no-block.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/no-match.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/unexpected.eld: Update.

(cherry picked from commit 13c7933a9d4b26e74e7f5e19d70bb89003239c34)

15 months ago* lisp/international/quail.el (quail-input-method): Fix bug#68338
Stefan Monnier [Thu, 18 Jan 2024 23:28:54 +0000 (18:28 -0500)]
* lisp/international/quail.el (quail-input-method): Fix bug#68338

(cherry picked from commit 81a2212bd52f68045b47d8be9345736655de6607)

15 months ago* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Fix bug#68514
Stefan Monnier [Thu, 18 Jan 2024 19:05:16 +0000 (14:05 -0500)]
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Fix bug#68514

Redo the commit 0db2126d7176 to try and avoid selecting more than
a mere symbol.

(cherry picked from commit a33f3947ea1ba429570e2ecb4c3167341dcae1a2)

15 months ago* test/lisp/emacs-lisp/comp-cstr-tests.el: Use macros in a simpler way
Stefan Monnier [Thu, 18 Jan 2024 19:00:15 +0000 (14:00 -0500)]
* test/lisp/emacs-lisp/comp-cstr-tests.el: Use macros in a simpler way

(comp-cstr-test-ts): Move out of `cl-eval-when`.
(comp-cstr-typespec-test): Delete.
(comp-cstr-synthesize-tests): Make it take the tests as an argument.
(comp-cstr-typespec-tests-alist): Delete var, pass its value to the
macro instead.

(cherry picked from commit b07a86abb6d5bb3d5cd178bb77592ad7208882f5)

15 months agoDon't use Qunbound as hash table key when printing (bug#68244)
Mattias Engdegård [Thu, 18 Jan 2024 17:48:12 +0000 (18:48 +0100)]
Don't use Qunbound as hash table key when printing (bug#68244)

This flaw could cause an assertion failure.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Don't consider Qunbound a
print-circle candidate; it should never be seen by Lisp anyway.

(cherry picked from commit e7a6ce847fd06c4f132bbac2f2fdc8474753ad3c)

15 months agoOnly use a hash index size of 1 for tables with size 0 (bug#68244)
Mattias Engdegård [Thu, 18 Jan 2024 17:45:16 +0000 (18:45 +0100)]
Only use a hash index size of 1 for tables with size 0 (bug#68244)

This invariant was intended but insufficiently enforced which could
lead to an assertion failure.

* src/fns.c (hash_index_size): Assume size>0, and return a value >1.
(make_hash_table): Only use hash_index_size for size>0.

(cherry picked from commit ef01250ef9c22aa1ac2ecff3136aabf79b2a677b)

15 months agoAvoid font-lock reset in `gnus-message-citation-mode'
Eric Abrahamsen [Thu, 18 Jan 2024 15:24:39 +0000 (07:24 -0800)]
Avoid font-lock reset in `gnus-message-citation-mode'

* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use
`font-lock-add-keywords' and `font-lock-remove-keywords' instead of
modifying font-lock defaults.  Make no font-lock changes until
`font-lock-mode' is active.

Thanks to Morgan Willcock

(cherry picked from commit 2c887f497c723c2397888e2f406faa4de3a8208a)

15 months ago; * src/androidterm.c (handle_one_android_event): Fix typo.
Po Lu [Thu, 18 Jan 2024 02:32:50 +0000 (10:32 +0800)]
; * src/androidterm.c (handle_one_android_event): Fix typo.

(cherry picked from commit d4d5830f8a071a3634926adeeaedaf573d49a063)

15 months ago; Fix test failures from the fix for bug#67661
Jim Porter [Wed, 17 Jan 2024 17:32:18 +0000 (09:32 -0800)]
; Fix test failures from the fix for bug#67661

* test/lisp/eshell/em-cmpl-tests.el
  (em-cmpl-test/file-completion/non-unique): Make test more robust.

(cherry picked from commit 5f5faad249747ce5bd4b7f2968f737206c136265)

15 months agoShow completions category in heading line
Eshel Yaron [Fri, 19 Jan 2024 06:38:46 +0000 (07:38 +0100)]
Show completions category in heading line

Extend 'completions-header-format' with a placeholder for the
completions category.  Stop hard-coding the 'shadow' face for the
heading line default value, instead define a derived face.

* lisp/minibuffer.el (completions-header-format): Extend.
(completions-heading): New face.
(completion-category): New variable.
(minibuffer-completion-help): Let-bind it.
(display-completion-list): Use it.

* doc/emacs/mini.texi (Completion Options): Elaborate.

* etc/NEWS: Announce.

15 months agoNew helper function for creating completion tables with metadata
Eshel Yaron [Thu, 18 Jan 2024 18:59:57 +0000 (19:59 +0100)]
New helper function for creating completion tables with metadata

* lisp/minibuffer.el (completion-styles-table): Remove in favor of...
(completion-table-with-metadata): New function.
(minibuffer-set-completion-styles)
(minibuffer-narrow-buffer-completions)
(minibuffer-complete-history, minibuffer-complete-defaults)
* lisp/bookmark.el (bookmark-completing-read)
* lisp/international/emoji.el (emoji--read-emoji)
* lisp/international/mule-cmds.el (read-char-by-name)
* lisp/progmodes/project.el (project--file-completion-table)
* lisp/progmodes/xref.el (xref-show-definitions-completing-read)
* lisp/recentf.el (recentf-open)
* lisp/simple.el (read-from-kill-ring)
* lisp/tmm.el (tmm--completion-table): Use it.

* etc/NEWS: Announce it.

15 months agoRevert "; * doc/misc/ert.texi (Top): Fix menu entry."
Eshel Yaron [Wed, 17 Jan 2024 17:02:01 +0000 (18:02 +0100)]
Revert "; * doc/misc/ert.texi (Top): Fix menu entry."

This reverts commit 961730ea3f7824244f1e7234c7cf63329d72188c.

15 months agoRevert "; Avoid "Index" as Info node name"
Eshel Yaron [Wed, 17 Jan 2024 16:59:53 +0000 (17:59 +0100)]
Revert "; Avoid "Index" as Info node name"

This reverts commit 320db150fbdc6305aecd8ec46cae05f951db52ef.

That change broke `i` in Elisp *Help* buffers, and anyhow there must
be a nicer way to avoid collisions with index.html

15 months ago* Update a comp test (bug#68523)
Andrea Corallo [Wed, 17 Jan 2024 14:28:43 +0000 (15:28 +0100)]
* Update a comp test (bug#68523)

* test/src/comp-tests.el (comp-tests-ret-type-spec-71): Update a test
due to new 'sxhash-equal' behaviour.

(cherry picked from commit c5031a52c5c6ad74fab27d3754700e7457717516)

15 months agoIncrease accuracy of IP instruction
Po Lu [Wed, 17 Jan 2024 01:30:47 +0000 (09:30 +0800)]
Increase accuracy of IP instruction

* src/sfnt.c (sfnt_interpret_ip): Avoid precision loss by
retrieving original positions from the unscaled outline,
whenever possible.

(cherry picked from commit daec3e7b410cdb8deefbb241d056f8b42dfb40ac)

15 months agoUpdate pdumper hashes for buffer and Lisp_Hash_Table
Mattias Engdegård [Mon, 15 Jan 2024 13:58:43 +0000 (14:58 +0100)]
Update pdumper hashes for buffer and Lisp_Hash_Table

* src/pdumper.c (dump_hash_table): Update for changes in recent
hash-table patch suites (bug#68244).
(dump_buffer): Update for case-fold-search changes (bug#66117).

(cherry picked from commit f19f5604deb72c4d548702b2d9b8565805ffbca1)

15 months agoMore efficient hash table thawing
Mattias Engdegård [Mon, 15 Jan 2024 09:58:59 +0000 (10:58 +0100)]
More efficient hash table thawing

* src/fns.c (hash_table_thaw): Don't allocate anything for empty
tables.  Don't initialise the next vector twice.
(maybe_resize_hash_table): Factor out min_size constant.

(cherry picked from commit dc404c5d0caac798627751bfd77ed005629abd4e)

15 months agoImprove 'read-face-name' completions alignment
Eshel Yaron [Wed, 17 Jan 2024 11:01:55 +0000 (12:01 +0100)]
Improve 'read-face-name' completions alignment

* lisp/faces.el (read-face-name-sample-text): Add new possible values
that specify whether to show sample text before, or after, face names.
(completion-face-name-affixation): Pixel-align face names and samples.

* etc/NEWS: Improve wording.

* doc/lispref/display.texi (Face Functions): Update.

15 months ago; * etc/NEWS: Fix wording of recently-added entry.
Eli Zaretskii [Tue, 16 Jan 2024 17:14:09 +0000 (19:14 +0200)]
; * etc/NEWS: Fix wording of recently-added entry.

(cherry picked from commit 0b8fe3c73ce4e9a2a8f025655970e86e0d81a0aa)

15 months agoNew display action alist entry 'post-command-select-window' (bug#67993)
Juri Linkov [Tue, 16 Jan 2024 16:54:04 +0000 (18:54 +0200)]
New display action alist entry 'post-command-select-window' (bug#67993)

* doc/lispref/windows.texi (Buffer Display Action Alists):
Add 'post-command-select-window'.

* lisp/window.el (display-buffer): Add 'post-command-select-window'
to the docstring and handle at the end of function.

(cherry picked from commit 6f75d0f36dd44fa794ed264042bb6edb4d897bec)

15 months agoEnable the system's Arabic and Khmer fonts under Android
Po Lu [Tue, 16 Jan 2024 02:59:34 +0000 (10:59 +0800)]
Enable the system's Arabic and Khmer fonts under Android

* lisp/international/fontset.el (setup-default-fontset): If
`android', search for Arabic or Khmer fonts with script tags,
not OTF features.

(cherry picked from commit 44fcab04f6a346e602f00a6d9f5b0e6f0dbeb5e0)

15 months agoFix folder creation error (Bug#67361)
Mike Kupfer [Mon, 15 Jan 2024 19:47:43 +0000 (11:47 -0800)]
Fix folder creation error (Bug#67361)

* lisp/mh-e/mh-funcs.el (mh-kill-folder), lisp/mh-e/mh-search.el
  (mh-index-new-folder), lisp/mh-e/mh-utils.el (mh-prompt-for-folder):
  Check for existence of speedbar-buffer rather than
  mh-speed-folder-map. The latter can exist if mh-speed has only been
  loaded but not displayed.

(cherry picked from commit e6a2901b1be6b4aa01f8bf0d3c6e06344ce8d366)

15 months ago* lisp/help-fns.el (help-fns--parent-mode): Mention the extra parents
Stefan Monnier [Tue, 16 Jan 2024 00:00:50 +0000 (19:00 -0500)]
* lisp/help-fns.el (help-fns--parent-mode): Mention the extra parents

As suggested by Stefan Kangas in bug#68246.

(cherry picked from commit 27ff4d9c4956fe06c59f342def8b35d32bbc3b50)

15 months ago* lisp/info-xref.el (info-xref-subfile-p): Avoid false positives. (Bug#68428)
Michael Albinus [Mon, 15 Jan 2024 15:55:27 +0000 (16:55 +0100)]
* lisp/info-xref.el (info-xref-subfile-p): Avoid false positives.  (Bug#68428)

(cherry picked from commit 2ef3111b136599ee26ec4316199677107bffedbc)

15 months agoJsonrpc: fix bug in jsonrpc--remove
João Távora [Mon, 15 Jan 2024 12:32:51 +0000 (06:32 -0600)]
Jsonrpc: fix bug in jsonrpc--remove

* lisp/jsonrpc.el (jsonrpc--remove): Check timer before cancelling it.
(Version): Bump to 1.2.24

See https://github.com/joaotavora/eglot/issues/1342

(cherry picked from commit 43612103c221ffb300536798e2b8a8adb753f594)

15 months ago; * src/xterm.c (x_focus_frame): Insert missing unblock_input.
Po Lu [Mon, 15 Jan 2024 06:32:26 +0000 (14:32 +0800)]
; * src/xterm.c (x_focus_frame): Insert missing unblock_input.

(cherry picked from commit c11cdf1858cc89464cd7118d6109c7472c50e652)

15 months ago(js-json-mode): Don't derive from `js-mode` (bug#67463)
Stefan Monnier [Mon, 15 Jan 2024 03:17:13 +0000 (22:17 -0500)]
(js-json-mode): Don't derive from `js-mode` (bug#67463)

* lisp/progmodes/js.el (js--mode-setup): New function, extracted from
`js-mode`.
(js-mode): Use it.
(js-json-mode): Use it instead of inheriting from `js-mode`.

(cherry picked from commit 314c939d1e182b8d015fc9c63d445274e0494748)

15 months ago; * admin/git-bisect-start: Update failing commits
Gregory Heytings [Mon, 15 Jan 2024 00:53:36 +0000 (00:53 +0000)]
; * admin/git-bisect-start: Update failing commits

(cherry picked from commit 0d336507dfe34a36916c00add3b89abe396fea33)

15 months ago; Add a test for 'dom-print'
Eshel Yaron [Tue, 16 Jan 2024 14:29:12 +0000 (15:29 +0100)]
; Add a test for 'dom-print'

* test/lisp/dom-tests.el (dom-tests-print): New test.

15 months ago; Provide metadata for 'recentf' completions
Eshel Yaron [Tue, 16 Jan 2024 12:39:39 +0000 (13:39 +0100)]
; Provide metadata for 'recentf' completions

* lisp/recentf.el (recentf-completion-table): New function.
(recentf-open): Use it.  Allow specifying file names that are not in
'recentf-list', after confirmation.

15 months ago; Fix non-symbol DEFAULT argument handling in 'read-face-name'
Eshel Yaron [Tue, 16 Jan 2024 11:38:42 +0000 (12:38 +0100)]
; Fix non-symbol DEFAULT argument handling in 'read-face-name'

This fixes an error in 'hi-lock-read-face-name' that was introduced in
6cd47f59326.

* lisp/faces.el (read-face-name): Fix DEFAULT normalization.

15 months ago; Align completion annotations with spaces for multi-column format
Eshel Yaron [Tue, 16 Jan 2024 09:44:46 +0000 (10:44 +0100)]
; Align completion annotations with spaces for multi-column format

Use actual spaces to align completion annotations instead of
"specified space" display properties, since that allows
'completion--insert-strings' to correctly align multiple completion
columns when 'completions-format' is not 'one-column'.

* lisp/faces.el (completion-face-name-affixation)
* lisp/minibuffer.el (completion-styles-affixation)
(completion-file-name-affixation)
(minibuffer-narrow-buffer-completions)
(completion-buffer-name-affixation)
* lisp/simple.el (read-extended-command--affixation): Align
annotations with spaces instead of using '(space :align-to ...)'
display properties.

15 months ago; Avoid attempting to restore stale previous completion input
Eshel Yaron [Mon, 15 Jan 2024 19:50:01 +0000 (20:50 +0100)]
; Avoid attempting to restore stale previous completion input

* lisp/minibuffer.el (minibuffer--cache-completion-input): Accept the
minibuffer base contents, not just its length.
(minibuffer-restore-completion-input): Ensure cached minibuffer base
is up to date before restoring.
(completion--do-completion, completion-all-sorted-completions)
(minibuffer-completion-help): Adapt.

15 months ago; (minibuffer-set-completion-styles): Enable recursive minibuffers.
Eshel Yaron [Sun, 14 Jan 2024 17:00:13 +0000 (18:00 +0100)]
; (minibuffer-set-completion-styles): Enable recursive minibuffers.

15 months ago; Stop saying that 'C-o' invokes 'open-line' in the minibuffer
Eshel Yaron [Sun, 14 Jan 2024 16:35:32 +0000 (17:35 +0100)]
; Stop saying that 'C-o' invokes 'open-line' in the minibuffer

* doc/emacs/mini.texi (Minibuffer Edit): Update.

15 months agoFix recent ses-tests mistakes (bug#5852)
Mattias Engdegård [Sun, 14 Jan 2024 13:10:17 +0000 (14:10 +0100)]
Fix recent ses-tests mistakes (bug#5852)

* test/lisp/ses-tests.el
(ses-set-formula-write-cells-with-changed-references):
Quote constant list.  Remove unused variable.

(cherry picked from commit a83e60eccbc16613fc3da85f46a3fb032c098a82)

15 months agoUse forward-line instead of next-line in noninteractive test
Mattias Engdegård [Sun, 14 Jan 2024 12:37:44 +0000 (13:37 +0100)]
Use forward-line instead of next-line in noninteractive test

* test/lisp/textmodes/page-tests.el (page-tests-what-page):
Silence byte-compiler warning; forward-line works nicely here.

(cherry picked from commit d4b1e2c3b630ec3b38fb1e6592ba253452c52052)

15 months agoMake object-intervals linear instead of quadratic
Mattias Engdegård [Sun, 14 Jan 2024 11:50:36 +0000 (12:50 +0100)]
Make object-intervals linear instead of quadratic

* src/fns.c (collect_interval, Fobject_intervals):
Build the returned list in reverse instead of appending single
elements.

(cherry picked from commit cd0855cbd81b5fd3866c9a3242f0490c938b6d4d)

15 months agoSpeed up sxhash-equal-including-properties
Mattias Engdegård [Sun, 14 Jan 2024 11:33:12 +0000 (12:33 +0100)]
Speed up sxhash-equal-including-properties

This function now no longer conses at all.  Previously, it constructed
a list structure of all string intervals for the sole purpose of
hashing.

* src/fns.c (hash_interval): New.
(Fsxhash_equal_including_properties):
Use it instead of collect_interval.

(cherry picked from commit 3869944bb4f9434e0c49063a291ed8a0a33cba50)

15 months agoRetype traverse_interval arg type from Lisp_Object to void *
Mattias Engdegård [Sun, 14 Jan 2024 10:58:33 +0000 (11:58 +0100)]
Retype traverse_interval arg type from Lisp_Object to void *

This is a refactoring.  It eliminates a few unnecessary conses and
allows for further improvements.

* src/intervals.c (traverse_intervals):
Change argument type.  All callers adapted.
* src/fns.c (collect_interval, Fsxhash_equal_including_properties)
(Fobject_intervals):
* src/print.c (print_check_string_charset_prop)
(print_prune_string_charset, print_object, print_interval):
Pass a pointer to a Lisp_Object instead of a Lisp_Object.

(cherry picked from commit a9cee9c6675a7002441bdd186402f45eb5379172)

15 months agoCorrect implementations of FLIPRGON and FLIPRGOFF
Po Lu [Sun, 14 Jan 2024 13:06:10 +0000 (21:06 +0800)]
Correct implementations of FLIPRGON and FLIPRGOFF

* src/sfnt.c (sfnt_interpret_fliprgoff)
(sfnt_interpret_fliprgon): Reorder arguments to match
the order in which arguments are popped by macro wrappers.
Fix sundry typos.

(cherry picked from commit dd83db2e23062642ab964bad226146a8bdac1349)

15 months agoFix bug#65116
Po Lu [Sun, 14 Jan 2024 00:26:27 +0000 (08:26 +0800)]
Fix bug#65116

* src/xterm.c (xi_focus_handle_for_device): Correct typo.
(x_focus_frame): Don't focus frames Emacs believes to be
focused if they are frames with independent minibuffer
frames.  (bug#65116)

(cherry picked from commit c566ee9d06caa80c120dd8631eb3dee17e152fc9)

15 months agoHash-table documentation updates (bug#68244)
Mattias Engdegård [Sat, 30 Dec 2023 15:00:28 +0000 (16:00 +0100)]
Hash-table documentation updates (bug#68244)

* doc/lispref/hash.texi (Creating Hash, Other Hash):
Manual updates for make-hash-table, hash-table-rehash-size and
hash-table-rehash-threshold.
* doc/lispref/objects.texi (Hash Table Type): Update example.
* src/fns.c (Fhash_table_rehash_size, Fhash_table_rehash_threshold):
Update doc strings.
* etc/NEWS: Announce changes.

(cherry picked from commit d2c3a983146b7c0fb0f8b855268effb695d0bbf5)

15 months agoDon't pretend that hash-table-size is useful
Mattias Engdegård [Sat, 30 Dec 2023 14:54:32 +0000 (15:54 +0100)]
Don't pretend that hash-table-size is useful

* lisp/emacs-lisp/shortdoc.el (hash-table): Remove hash-table-size entry.
* doc/lispref/hash.texi (Other Hash):
* src/fns.c (Fhash_table_size): Make it clear that hash-table-size is
probably not worth using.

(cherry picked from commit 519c7ca7356fc7f9707b97c143c9495deea5b272)

15 months agoChange hash_hash_t to uint32_t
Mattias Engdegård [Wed, 22 Nov 2023 13:54:34 +0000 (14:54 +0100)]
Change hash_hash_t to uint32_t

This saves a lot of memory and is quite sufficient.  Hash functions
are adapted to produce a hash_hash_t eventually, which eliminates some
useless and information-destroying intermediate hash reduction steps.

We still use EMACS_UINT for most of the actual hashing steps before
producing the final value; this may be slightly wasteful on 32-bit
platforms with 64-bit EMACS_UINT.

* src/lisp.h (hash_hash_t): Change to uint32_t.
* src/fns.c (reduce_emacs_uint_to_hash_hash): New.
(hashfn_eq, hashfn_equal, hashfn_user_defined): Reduce return values
to hash_hash_t.
(sxhash_string): Remove.  Caller changed to hash_string.
(sxhash_float, sxhash_list, sxhash_vector, sxhash_bool_vector)
(sxhash_bignum): Remove wasteful calls to SXHASH_REDUCE.
(hash_hash_to_fixnum): New.
(Fsxhash_eq, Fsxhash_eql, Fsxhash_equal)
(Fsxhash_equal_including_properties): Convert return values to fixnum.

(cherry picked from commit 1998039f7a8f2ecc884a6fed85c0cc1ce06f83e2)

15 months agoUse key Qunbound instead of hash value hash_unused for free entries
Mattias Engdegård [Tue, 21 Nov 2023 21:12:08 +0000 (22:12 +0100)]
Use key Qunbound instead of hash value hash_unused for free entries

Previously, free hash table entries were indicated by both hash value
hash_unused and key Qunbound; we now rely on the latter only.
This allows us to change the hash representation to one that does not
have an unused value.

* src/lisp.h (hash_unused): Remove.
All uses adapted to calling hash_unused_entry_key_p on the key instead.
The hash values for unused hash table entries are now undefined; all
initialisation and assignment to hash_unused has been removed.

(cherry picked from commit 11e467eb6004286765c1d8c408f8d773d9113aca)

15 months agoDon't dump Qunbound
Mattias Engdegård [Wed, 22 Nov 2023 12:47:56 +0000 (13:47 +0100)]
Don't dump Qunbound

The dumper uses a hash table to keep track of dumped objects but as
this clashes with the use of Qunbound for marking unused hash table
entries, don't dump that value at all.  The symbol name is fixed up
after loading.

An alternative solution would be to use a different unique value for
unused entries.

* src/pdumper.c (dump_object_needs_dumping_p): Skip Qunbound.
(dump_vectorlike_generic): New function.
(pdumper_load): Call it.

(cherry picked from commit 7ad5d427730fea3865bc678c6673ffd58b6af653)

15 months agoChange hash_idx_t to int32_t on all platforms
Mattias Engdegård [Tue, 21 Nov 2023 18:26:23 +0000 (19:26 +0100)]
Change hash_idx_t to int32_t on all platforms

* src/lisp.h (hash_idx_t): Change to int32_t.
* src/fns.c (hash_index_size): Adapt to new index type.

(cherry picked from commit 68f8bc3111424527205ebfe4498e5bebf50f50bf)

15 months agoFaster hash table growth, starting at zero size
Mattias Engdegård [Sat, 4 Nov 2023 17:21:06 +0000 (18:21 +0100)]
Faster hash table growth, starting at zero size

The algorithms no longer use the rehash_threshold and rehash_size
float constants, but vary depending on size.  In particular, the table
now grows faster, especially from smaller sizes.

The default size is now 0, starting empty, which effectively postpones
allocation until the first insertion (unless make-hash-table was
called with a positive :size); this is a clear gain as long as the
table remains empty.  The first inserted item will use an initial size
of 8 because most tables are small.

* src/fns.c (std_rehash_size, std_rehash_threshold): Remove.
(hash_index_size): Integer-only computation.
(maybe_resize_hash_table): Grow more aggressively.
(Fhash_table_rehash_size, Fhash_table_rehash_threshold):
Use the constants directly.
* src/lisp.h (DEFAULT_HASH_SIZE): New value.

(cherry picked from commit ed06de52a53135ee42e528496fdddbf3d74b0479)

15 months ago; Reorder struct Lisp_Hash_Table and struct hash_table_test
Mattias Engdegård [Fri, 3 Nov 2023 15:02:56 +0000 (16:02 +0100)]
; Reorder struct Lisp_Hash_Table and struct hash_table_test

Mainly for efficiency, to keep frequently used fields together.

(cherry picked from commit 47502c55b0ce2e4cd3f43fefb77d9c2c11ed7c0a)

15 months agoShare hash table test structs
Mattias Engdegård [Thu, 2 Nov 2023 16:05:26 +0000 (17:05 +0100)]
Share hash table test structs

This saves several words in the hash table object at the cost of an
indirection at runtime.  This seems to be a gain in overall
performance.

FIXME: We cache hash test objects in a rather clumsy way. A better
solution is sought.

* src/lisp.h (struct Lisp_Hash_Table): Use a pointer to the test
struct.  All references adapted.
* src/alloc.c (garbage_collect):
* src/fns.c (struct hash_table_user_test, hash_table_user_tests)
(mark_fns, get_hash_table_user_test): New state for caching test
structs, and functions managing it.

(cherry picked from commit 7d93a0147a14e14d6964bf93ba11cf494b9d49fd)