]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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)

15 months agoUse hash_idx_t for storing hash indices
Mattias Engdegård [Sun, 5 Nov 2023 11:10:34 +0000 (12:10 +0100)]
Use hash_idx_t for storing hash indices

Now hash_idx_t is a typedef for ptrdiff_t so there is no actual code
change, but this allows us to decouple the index width from the Lisp
word size.

* src/lisp.h (hash_idx_t): New typedef for ptrdiff_t.
(struct Lisp_Hash_Table): Use it for indices and sizes:
index, next, table_size, index_size, count and next_free.
All uses adapted.

(cherry picked from commit 0a998938ca1b7e5e6f09d14b4a62ec7089be2af6)

15 months agoInlined and specialised hash table look-up
Mattias Engdegård [Tue, 21 Nov 2023 11:27:42 +0000 (12:27 +0100)]
Inlined and specialised hash table look-up

This improves performance in several ways.  Separate functions are
used depending on whether the caller has a hash value computed or not.

* src/fns.c (hash_lookup_with_hash, hash_lookup_get_hash): New.
(hash_lookup): Remove hash return argument.
All callers adapted.

hash_lookup_with_hash hash_hash_t arg

(cherry picked from commit 3b00255a4c70bc1075446c94a8ff65c987ac143f)

15 months agoStore hash values as integers instead of Lisp_Object
Mattias Engdegård [Sun, 29 Oct 2023 10:57:06 +0000 (11:57 +0100)]
Store hash values as integers instead of Lisp_Object

This improves typing, saves pointless tagging and untagging, and
prepares for further changes. The new typedef hash_hash_t is an alias
for EMACS_UINT, and hash values are still limited to the fixnum range.
We now use hash_unused instead of Qnil to mark unused entries.

* src/lisp.h (hash_hash_t): New typedef for EMACS_UINT.
(hash_unused): New constant.
(struct hash_table_test): `hashfn` now returns
hash_hash_t.  All callers and implementations changed.
(struct Lisp_Hash_Table): Retype hash vector to an array of
hash_hash_t.  All code using it changed accordingly.
(HASH_HASH, hash_from_key):
* src/fns.c (set_hash_index_slot, hash_index_index)
(hash_lookup_with_hash, hash_lookup_get_hash, hash_put):
(hash_lookup, hash_put): Retype hash value arguments
and return values.  All callers adapted.

(cherry picked from commit a3ae5653cfe1ab2b3eb4c77ce729844ad442b562)

15 months agoUse non-Lisp allocation for internal hash-table vectors
Mattias Engdegård [Fri, 27 Oct 2023 20:15:09 +0000 (22:15 +0200)]
Use non-Lisp allocation for internal hash-table vectors

Using xmalloc for allocating these arrays is much cheaper than using
Lisp vectors since they are no longer marked or swept by the GC, and
deallocated much sooner.  This makes GC faster and less frequent, and
improves temporal locality.

Zero-sized tables use NULL for their (0-length) vectors except the
index vector which has size 1 and uses a shared constant static vector
since it cannot be modified anyway.  This makes creation and
destruction of zero-sized hash tables very fast; they consume no
memory outside the base object.

* src/lisp.h (struct Lisp_Hash_Table): Retype the index, next, hash
and key_and_value vectors from Lisp_Object to appropriately typed
arrays (although hash values are still stored as Lisp fixnums).  Add
explicit table_size and index_size members.  All users updated.
* src/alloc.c (gcstat): Add total_hash_table_bytes.
(hash_table_allocated_bytes): New.
(cleanup_vector): Free hash table vectors when sweeping
the object.
(hash_table_alloc_bytes, hash_table_free_bytes): New.
(sweep_vectors): Update gcstat.total_hash_table_bytes.
(total_bytes_of_live_objects): Use it.
(purecopy_hash_table): Adapt allocation of hash table vectors.
(process_mark_stack): No more Lisp slots in the struct to trace.
* src/fns.c (empty_hash_index_vector): New.
(allocate_hash_table): Allocate without automatically GCed slots.
(alloc_larger_vector): Remove.
(make_hash_table, copy_hash_table, maybe_resize_hash_table):
Adapt vector allocation and initialisation.
* src/pdumper.c (hash_table_freeze, hash_table_thaw, dump_hash_table)
(dump_hash_table_contents):
Adapt dumping and loading to field changes.

(cherry picked from commit fa5c07fc87d557e642fc325852e8d0c87a9c176e)

15 months agoAllow zero hash table size
Mattias Engdegård [Sat, 4 Nov 2023 14:16:38 +0000 (15:16 +0100)]
Allow zero hash table size

This avoids any extra allocation for such vectors, including empty
tables read by the Lisp reader, and provides extra safety essentially
for free.

* src/fns.c (make_hash_table): Allow tables to be 0-sized.  The index
will always have at least one entry, to avoid extra look-up costs.
* src/alloc.c (process_mark_stack): Don't mark pure objects,
because empty vectors are pure.

(cherry picked from commit 49fd4d120deb0b878ad262aea7d849c7275bc12c)

15 months agoLeaner hash table dumping and thawing
Mattias Engdegård [Sat, 4 Nov 2023 15:34:09 +0000 (16:34 +0100)]
Leaner hash table dumping and thawing

Only dump the actual data, and the test encoded as an enum.  This
simplifies dumping, makes dump files smaller and saves space at run
time.

* src/lisp.h (hash_table_std_test_t): New enum.
(struct Lisp_Hash_Table): Add frozen_test member, consuming no extra space.
* src/fns.c (hashfn_user_defined): Now static.
(hash_table_test_from_std): New.
(hash_table_rehash): Rename to...
(hash_table_thaw): ...this and rewrite.
* src/pdumper.c (hash_table_contents): Only include actual data, not
unused space.
(hash_table_std_test): New.
(hash_table_freeze): Set frozen_test from test.
(dump_hash_table): Dump frozen_test, not the whole test struct.
Don't bother other dumping fields that can be derived.

(cherry picked from commit d3cefd3e98354929d96c9396e5920e8a123784dc)

15 months agoRemove rehash-threshold and rehash-size struct members
Mattias Engdegård [Thu, 26 Oct 2023 15:17:01 +0000 (17:17 +0200)]
Remove rehash-threshold and rehash-size struct members

These parameters have no visible semantics and are hardly ever used,
so just use the default values for all hash tables.  This saves
memory, shrinks the external representation, and will improve
performance.

* src/fns.c (std_rehash_size, std_rehash_threshold): New.
(hash_index_size): Use std_rehash_threshold.  Remove table argument.
All callers updated.
(make_hash_table): Remove rehash_size and rehash_threshold args.
All callers updated.
(maybe_resize_hash_table)
(Fhash_table_rehash_size, Fhash_table_rehash_threshold):
Use std_rehash_size and std_rehash_threshold.
(Fmake_hash_table): Ignore :rehash-size and :rehash-threshold args.
* src/lisp.h (struct Lisp_Hash_Table):
Remove rehash_size and rehash_threshold fields.
(DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE): Remove.
* src/lread.c (hash_table_from_plist): Don't read rehash-size or
rehash-threshold.
(syms_of_lread): Remove unused symbols.
* src/print.c (print_object): Don't print rehash-size or rehash-threshold.
* src/pdumper.c (dump_hash_table): Don't dump removed fields.

(cherry picked from commit c3d0cc50faf588479db62e20ceabe044dd89e244)

15 months agoRepresent hash table weakness as an enum internally
Mattias Engdegård [Thu, 26 Oct 2023 13:49:32 +0000 (15:49 +0200)]
Represent hash table weakness as an enum internally

This takes less space (saves an entire word) and is more type-safe.
No change in behaviour.

* src/lisp.h (hash_table_weakness_t): New.
(struct Lisp_Hash_Table): Replace Lisp object `weak` with enum
`weakness`.
* src/fns.c
(keep_entry_p, hash_table_weakness_symbol): New.
(make_hash_table): Retype argument.  All callers updated.
(sweep_weak_table, Fmake_hash_table, Fhash_table_weakness):
* src/alloc.c (purecopy_hash_table, purecopy, process_mark_stack):
* src/pdumper.c (dump_hash_table):
* src/print.c (print_object): Use retyped field.

(cherry picked from commit c6bdc1ea1dc7f9a0b6d92d443f34c42affde73d1)

15 months agoDon't print or read the hash table size parameter
Mattias Engdegård [Thu, 26 Oct 2023 16:36:05 +0000 (18:36 +0200)]
Don't print or read the hash table size parameter

It's not a meaningful part of the external representation.
This allows for faster printing and reading, smaller
external representation, and less memory consumption.

* src/print.c (print_object): Omit size.
* src/lread.c (hash_table_from_plist): Take size from the data.

(cherry picked from commit 3f9c81a87f7bce854489b8232d817b536ccf349b)

15 months ago* src/print.c (print_object): Don't print empty hash-table data
Mattias Engdegård [Thu, 2 Nov 2023 10:10:24 +0000 (11:10 +0100)]
* src/print.c (print_object): Don't print empty hash-table data

Since no data is the default, this preserves bidirectional compatibility.

(cherry picked from commit a09619f2598a1658feac6794e85bc61a07c4855f)

15 months ago* src/print.c (print_object): Don't print hash table test if `eql`.
Mattias Engdegård [Thu, 26 Oct 2023 16:04:11 +0000 (18:04 +0200)]
* src/print.c (print_object): Don't print hash table test if `eql`.

Since `eql` is the default, this ensures bidirectional compatibility
while reducing the size of the external representation.

(cherry picked from commit 4ba6954e69528f89dc12bf968dec845601b1b24b)

15 months agoNew commands for cycling completions and restoring completed input
Eshel Yaron [Sun, 14 Jan 2024 14:47:05 +0000 (15:47 +0100)]
New commands for cycling completions and restoring completed input

This adds two new minibuffer commands, 'minibuffer-cycle-completion'
and 'minibuffer-restore-completion-input', bound to 'C-o' and 'C-l',
respectively.

* lisp/minibuffer.el (completion--input): New local variable.
(minibuffer--cache-completion-input)
(completion-switch-cycling-direction): New functions.
(completion-all-sorted-completions): Respect
'minibuffer-completions-sort-function', and...
(minibuffer-completion-help)
(completion--do-completion): Cache completion input.
(completions-auto-update): Preserve 'completion--input'.
(minibuffer-force-complete): Highlight inserted candidate in
completions list if *Completions* is already visible.
(minibuffer-cycle-completion)
(minibuffer-restore-completion-input): New commands.
(minibuffer-local-completion-map): Bind them.

* doc/emacs/mini.texi (Completion Commands, Completion Options)
* doc/lispref/minibuf.texi (Completion Commands): Document them.

* etc/NEWS: Announce.

* test/lisp/minibuffer-tests.el (restore-completion-input-test):
New test.

15 months ago* lisp/window.el (window-prefix-map): Bind C-x w q to quit-window (bug#13167)
Juri Linkov [Sat, 13 Jan 2024 18:16:42 +0000 (20:16 +0200)]
* lisp/window.el (window-prefix-map): Bind C-x w q to quit-window (bug#13167)

(cherry picked from commit 76904626b36910b511d3b0a3e56cc80af90d9361)

15 months ago; * lisp/textmodes/page.el (page--what-page): Fix last change.
Eli Zaretskii [Sat, 13 Jan 2024 10:45:10 +0000 (12:45 +0200)]
; * lisp/textmodes/page.el (page--what-page): Fix last change.

(cherry picked from commit 106cd9aafe8248ef91d7e89161adc5f912ea54eb)

15 months agoFix 'what-page'
Lars Brinkhoff [Tue, 2 Jan 2024 08:06:13 +0000 (09:06 +0100)]
Fix 'what-page'

* lisp/textmodes/page.el (page--what-page): Adjust for 1st
line on page, and use 'count-lines' again.  (Bug#68215)

* test/lisp/textmodes/page-tests.el (page-tests-what-page):
Update test.

(cherry picked from commit 740953d1a2f4ea4a200637872b9ecb7dfddfdbe4)

15 months agoImprove documentation of 'emacs_function' in modules
Eli Zaretskii [Sat, 13 Jan 2024 10:01:47 +0000 (12:01 +0200)]
Improve documentation of 'emacs_function' in modules

* doc/lispref/internals.texi (Module Functions): Warn about
accessing the ARGS array in module functions.

(cherry picked from commit c494a6e879dfeecb0cec3e9ae7bc0d3c682a9185)

15 months agoSet the 'name' prop in 'define-advice'
Steven Allen [Sat, 6 Jan 2024 17:19:12 +0000 (09:19 -0800)]
Set the 'name' prop in 'define-advice'

In addition to naming the advice function `symbol@name', set
the 'name' property to NAME.
* lisp/emacs-lisp/nadvice.el (define-advice): set the 'name'
property to NAME (requested in Bug#68114).  Fixes Bug#68294.

* doc/lispref/functions.texi (Advising Named Functions): Document
that 'define-advice' installs the advice with the specified name.

(cherry picked from commit 9b8b352ebc09de3259f655fa4d491507109044b3)

15 months agoFix 'python-info-docstring-p' bug in the 2nd line of a buffer
kobarity [Sat, 6 Jan 2024 13:04:42 +0000 (22:04 +0900)]
Fix 'python-info-docstring-p' bug in the 2nd line of a buffer

* lisp/progmodes/python.el (python-info-docstring-p): Add
'looking-at-p' check when bobp.
* test/lisp/progmodes/python-tests.el (python-font-lock-operator-1)
(python-font-lock-operator-2): Restoration of ERTs deleted by
mistake.
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Change 'font-lock-doc-face'
to 'font-lock-string-face' and remove :expected-result :failed.
(python-info-docstring-p-8): New test.  (Bug#68284)

(cherry picked from commit f2cc8ee2a1a106f9045447a1a025572d7938647e)

15 months ago; * doc/emacs/fixit.texi (Spelling): Fix last change.
Eli Zaretskii [Sat, 13 Jan 2024 09:23:43 +0000 (11:23 +0200)]
; * doc/emacs/fixit.texi (Spelling): Fix last change.

(cherry picked from commit a08e6423ccc94ff51367768c2d13e549204f9f46)

15 months agoFix NULL dereference in w32notify.c
Stefan Kangas [Sat, 13 Jan 2024 09:20:41 +0000 (10:20 +0100)]
Fix NULL dereference in w32notify.c

* src/w32notify.c (start_watching): Return NULL instead of freed
pointer.
(add_watch): Fix NULL dereference.

(cherry picked from commit 893829021bd50604b035c058814f280c7386aa46)

15 months agoPrefer AREF in GET_TRANSLATION_TABLE
Stefan Kangas [Sat, 13 Jan 2024 09:18:03 +0000 (10:18 +0100)]
Prefer AREF in GET_TRANSLATION_TABLE

* src/ccl.c (GET_TRANSLATION_TABLE): Prefer using AREF to depending on
vector internals.

(cherry picked from commit 1bfc7fd33d78ff29ee62f5a6b7d7769c1f8099c8)

15 months ago* src/fns.c (maybe_resize_hash_table): Fix EMACS_INT format specifier.
Eli Zaretskii [Sat, 13 Jan 2024 06:30:50 +0000 (08:30 +0200)]
* src/fns.c (maybe_resize_hash_table): Fix EMACS_INT format specifier.

(cherry picked from commit ec16b69e7f0b9437e998688cb2877cc425edb70b)

15 months agoProperly sort results for partial font specs
Po Lu [Sat, 13 Jan 2024 01:51:59 +0000 (09:51 +0800)]
Properly sort results for partial font specs

* src/sfntfont.c (sfntfont_compare_font_entities): New function.
(sfntfont_list): Sort matching font entities by the number of
fields set, and mention why.

(cherry picked from commit 4edb77132de731f9d4cb2cffee2f8847eafdcc72)

15 months ago; * src/lisp.h (struct Lisp_Hash_Table): Add ASCII art.
Mattias Engdegård [Sun, 7 Jan 2024 17:52:48 +0000 (18:52 +0100)]
; * src/lisp.h (struct Lisp_Hash_Table): Add ASCII art.

(cherry picked from commit 8b7a6d7b6deca9346092501dbfa679e3e5ea5892)

15 months ago; * src/fns.c (Fmake_hash_table): ensure `test` is a bare symbol
Mattias Engdegård [Thu, 30 Nov 2023 13:57:51 +0000 (14:57 +0100)]
; * src/fns.c (Fmake_hash_table): ensure `test` is a bare symbol

(cherry picked from commit 4b7985db11c0fd3a3346a05f271eff9ad687851b)

15 months agoAbstract predicate and constant for unused hash keys
Mattias Engdegård [Thu, 28 Dec 2023 18:04:43 +0000 (19:04 +0100)]
Abstract predicate and constant for unused hash keys

Qunbound is used for many things; using a predicate and constant for
the specific purpose of unused hash entry keys allows us to locate
them and make changes much more easily.

* src/lisp.h (HASH_UNUSED_ENTRY_KEY, hash_unused_entry_key_p):
New constant and function.
* src/comp.c (compile_function, Fcomp__compile_ctxt_to_file):
* src/composite.c (composition_gstring_cache_clear_font):
* src/emacs-module.c (module_global_reference_p):
* src/fns.c (make_hash_table, maybe_resize_hash_table, hash_put)
(hash_remove_from_table, hash_clear, sweep_weak_table, Fmaphash):
* src/json.c (lisp_to_json_nonscalar_1):
* src/minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
* src/print.c (print, print_object):
Use them.

(cherry picked from commit 29e3d1c56f07a53d1955c9a71e68f70f3b901728)

15 months ago; * src/alloc.c (purecopy_hash_table): Simplify
Mattias Engdegård [Tue, 28 Nov 2023 12:54:26 +0000 (13:54 +0100)]
; * src/alloc.c (purecopy_hash_table): Simplify

Copy the entire struct, then take care of fields needing special
treatment.

(cherry picked from commit 484e04efa4fcb81968cba8e05835812c62856287)

15 months agoRefactor hash table vector reallocation
Mattias Engdegård [Sat, 28 Oct 2023 10:07:42 +0000 (12:07 +0200)]
Refactor hash table vector reallocation

* src/fns.c (larger_vecalloc): Remove.
(larger_vector): Simplify.
(alloc_larger_vector): New.
(maybe_resize_hash_table): Use alloc_larger_vector as a simpler and
faster replacement for larger_vecalloc.

(cherry picked from commit 43127e5ec110debadef5e823ee8adbfc561bb708)

15 months agoRefactor: extract hash and index computations to functions
Mattias Engdegård [Sun, 29 Oct 2023 11:27:04 +0000 (12:27 +0100)]
Refactor: extract hash and index computations to functions

* src/lisp.h (hash_from_key):
* src/fns.c (hash_index_index): New.
(hash_table_rehash, hash_lookup, hash_remove_from_table):
(maybe_resize_hash_table, hash_put):
* src/composite.c (composition_gstring_put_cache): Use them.

(cherry picked from commit 462b3e6ae4eefeb65a2dc7b144db3e1af9a7720d)

15 months ago; * src/fns.c (collect_interval): Move misplaced function.
Mattias Engdegård [Sat, 11 Nov 2023 16:42:51 +0000 (17:42 +0100)]
; * src/fns.c (collect_interval): Move misplaced function.

(cherry picked from commit 0bc13945acb8d18bc18b5abc5c5cf9adebc46ca6)

15 months agoRefactor: less layering violation in composite.h
Mattias Engdegård [Mon, 30 Oct 2023 11:34:26 +0000 (12:34 +0100)]
Refactor: less layering violation in composite.h

Avoid using hash table internals directly.

* src/composite.h (COMPOSITION_KEY): New.
(COMPOSITION_GLYPH, COMPOSITION_RULE): Use COMPOSITION_KEY.

(cherry picked from commit 3da324fbd3c7e8e282585ed617efe6ae740acf1a)

15 months agoDecouple profiler from Lisp hash table internals
Mattias Engdegård [Wed, 1 Nov 2023 15:42:59 +0000 (16:42 +0100)]
Decouple profiler from Lisp hash table internals

The profiler stored data being collected in Lisp hash tables but
relied heavily on their exact internal representation, which made it
difficult and error-prone to change the hash table implementation.

In particular, the profiler has special run-time requirements that are
not easily met using standard Lisp data structures: accesses and
updates are made from async signal handlers in almost any messy
context you can think of and are therefore very constrained in what
they can do.

The new profiler tables are designed specifically for their purpose
and are more efficient and, by not being coupled to Lisp hash tables,
easier to keep safe.

The old profiler morphed internal hash tables to ones usable from Lisp
and thereby made them impossible to use internally; now export_log
just makes new hash table objects for Lisp.  The Lisp part of the
profiler remains entirely unchanged.

* src/alloc.c (garbage_collect): Mark profiler tables.
* src/eval.c (get_backtrace): Fill an array of Lisp values instead of
a Lisp vector.
* src/profiler.c (log_t): No longer a Lisp hash table but a custom
data structure: a fully associative fixed-sized cache that maps
fixed-size arrays of Lisp objects to counts.
(make_log): Build new struct.
(mark_log, free_log, get_log_count, set_log_count, get_key_vector)
(log_hash_index, remove_log_entry, trace_equal, trace_hash)
(make_profiler_log, free_profiler_log, mark_profiler): New.
(cmpfn_profiler, hashtest_profiler, hashfn_profiler)
(syms_of_profiler_for_pdumper): Remove.
(approximate_median, evict_lower_half, record_backtrace, export_log)
(Fprofiler_cpu_log, Fprofiler_memory_log, syms_of_profiler):
Adapt to the new data structure.

(cherry picked from commit 22201dde773e5404f80baa1f59768e88d97a322a)

15 months ago; * src/pdumper.c (dump_hash_table): Remove unused argument.
Mattias Engdegård [Fri, 29 Dec 2023 14:32:18 +0000 (15:32 +0100)]
; * src/pdumper.c (dump_hash_table): Remove unused argument.

(cherry picked from commit 8acd89e955f9422c5201d0db102d3a5ac05f3094)

15 months agoAdd internal hash-table debug functions
Mattias Engdegård [Mon, 6 Nov 2023 12:25:07 +0000 (13:25 +0100)]
Add internal hash-table debug functions

These are useful for measuring hashing and collisions.

* src/fns.c (Finternal__hash_table_histogram)
(Finternal__hash_table_buckets, Finternal__hash_table_index_size):
New.

(cherry picked from commit 228e9000181b06e5fd3d775c4c9a31c48ee2a231)

15 months agoImprove documentation of Ispell commands
Eli Zaretskii [Fri, 12 Jan 2024 08:03:08 +0000 (10:03 +0200)]
Improve documentation of Ispell commands

* doc/emacs/fixit.texi (Spelling): Document "C-u M-$" and warn
against modifications in recursive-edit.  (Bug#14192)

(cherry picked from commit 418547162d5273de5a524fe857081867258cd511)

15 months agoDon't recommend inverse-video for debugging
Stefan Kangas [Thu, 11 Jan 2024 21:36:33 +0000 (22:36 +0100)]
Don't recommend inverse-video for debugging

* etc/DEBUG: Don't recommend 'inverse-video', which has been broken
for 20 years, give or take.  (Bug#11430)

(cherry picked from commit c4b4948845508d599f6176441a833ae1a2cb6d40)

15 months agoFix typo in lispref "Creating Strings" section
Xiyue Deng [Thu, 11 Jan 2024 14:18:37 +0000 (15:18 +0100)]
Fix typo in lispref "Creating Strings" section

* doc/lispref/strings.texi (String Basics): Fix typo (bug#68375).

(cherry picked from commit 26eb9d3a8a670a1ce2e8b4f0c6418d39329ec41a)

15 months agoFix count of no-op functions (bug#68375)
Xiyue Deng [Wed, 3 Jan 2024 00:31:30 +0000 (16:31 -0800)]
Fix count of no-op functions (bug#68375)

It looks like there are actually three kinds of no-op functions.

* doc/lispref/functions.texi (Calling Functions): Fix count and
plural of no-op functions.

Copyright-paperwork-exempt: yes
(cherry picked from commit 99efe5c80f9d90de6540ef6f78504c0413947a25)

15 months agoWrap @pxref of Abbrevs in parentheses (bug#68375)
Xiyue Deng [Wed, 27 Dec 2023 20:35:39 +0000 (12:35 -0800)]
Wrap @pxref of Abbrevs in parentheses (bug#68375)

* doc/lispref/symbols.texi (Shorthands): Wrap `@pxref{Abbrevs}' in
parentheses.

Copyright-paperwork-exempt: yes
(cherry picked from commit 0c01f97b73cffc373944fd2720e42520e86bc2e4)

15 months ago; Fix last change in widget.texi
Eli Zaretskii [Thu, 11 Jan 2024 06:22:14 +0000 (08:22 +0200)]
; Fix last change in widget.texi

* doc/misc/widget.texi (url-link, toggle, Defining New Widgets):
Divide @example's into @group's.  (Bug#66229)

(cherry picked from commit 70a09325d658b4618856adac82abc5f66a11a22f)

15 months ago; Fix typos
Stefan Kangas [Wed, 10 Jan 2024 23:32:15 +0000 (00:32 +0100)]
; Fix typos

(cherry picked from commit 63411709a8dbad8b17c7f1e0cfed99f4aeb174a1)

15 months ago; * etc/TODO: Add item to make play-sound non-blocking.
Stefan Kangas [Wed, 10 Jan 2024 23:25:38 +0000 (00:25 +0100)]
; * etc/TODO: Add item to make play-sound non-blocking.

(cherry picked from commit 824cf54951c076e2b6a0e3a8e6fb1342cf58b8b6)

15 months agoAdd examples to the Widget manual
Mauro Aranda [Fri, 22 Sep 2023 23:45:00 +0000 (20:45 -0300)]
Add examples to the Widget manual

* doc/misc/widget.texi (Widget Gallery, Defining New Widgets): Add
examples.  (Bug#66229)

(cherry picked from commit 4fadbfe300a338f8e6e167331bc7ca0bbca26dbc)

15 months agoImplement missing functions for custom-icon widget
Mauro Aranda [Sun, 5 Nov 2023 10:23:55 +0000 (07:23 -0300)]
Implement missing functions for custom-icon widget

* lisp/cus-edit.el (custom-icon-reset-saved, custom-icon-mark-to-save)
(custom-icon-state-set-and-redraw, custom-icon-reset-standard)
(custom-icon-mark-to-reset-standard): New functions.
(custom-icon, custom-icon-extended-menu): Register and add them to the
menu.  (Bug#66947)

(cherry picked from commit 1bbb610821eb143e0828d2541a3f856d29d67b6f)

15 months agoFix fontification of cgroup2 in fstab (bug#68367)
Stephen Berman [Wed, 10 Jan 2024 15:24:53 +0000 (16:24 +0100)]
Fix fontification of cgroup2 in fstab (bug#68367)

* lisp/generic-x.el (etc-fstab-generic-mode): Add cgroup2.

(cherry picked from commit 29af214a75a3d77e603c377e1247a3ca85c130c5)

15 months agoIntroduce 'let' using lexical binding in the Lisp Introduction
Jim Porter [Thu, 26 Oct 2023 03:43:57 +0000 (20:43 -0700)]
Introduce 'let' using lexical binding in the Lisp Introduction

* doc/lispintro/emacs-lisp-intro.texi (Prevent confusion): Rework the
explanation to discuss how things work under lexical binding.
(How let Binds Variables): Describe the differences between lexical
and dynamic binding (including how to configure it).
(defvar): Mention that 'defvar' declares variables as always
dynamically-bound (bug#66756).

(cherry picked from commit d58d0fa52ff22e147b8328759d5f0f762e15bbb5)

15 months ago; Don't record multiple versions of use-package
Eli Zaretskii [Sun, 7 Jan 2024 15:15:18 +0000 (17:15 +0200)]
; Don't record multiple versions of use-package

* lisp/use-package/use-package-ensure-system-package.el: Remove
Version: header, to avoid confusing loaddefs-gene.  (Bug#68304)

(cherry picked from commit 1b123972636d717241a38bcd6daa3e3f424fb8b0)

15 months agoFix 'rmail-summary-by-thread'
Eli Zaretskii [Sat, 6 Jan 2024 17:30:16 +0000 (19:30 +0200)]
Fix 'rmail-summary-by-thread'

* lisp/mail/rmailsum.el (rmail-summary-by-thread): Call
'rmail-new-summary' from the original buffer, not from
'rmail-buffer' to avoid failing the logic in 'rmail-new-summary'
that decides whether to pop up a new window.  Reported by Andrea
Monaco <andrea.monaco@autistici.org>.

(cherry picked from commit 8729a2a10d9b8d88f6ba33b5ce62f74d89e7788a)

15 months ago* doc/emacs/back.texi: Fix a typo.
Jean-Christophe Helary [Sat, 6 Jan 2024 15:55:58 +0000 (15:55 +0000)]
* doc/emacs/back.texi: Fix a typo.

(cherry picked from commit 2a8c00bfc073d8c42c5c325289a8eada2ae5b309)

15 months agoAvoid slow remote file name completion annotations
Eshel Yaron [Sat, 13 Jan 2024 17:35:25 +0000 (18:35 +0100)]
Avoid slow remote file name completion annotations

* lisp/files.el (file-name-attributes-completion-annotation)
(file-name-completion-annotation): New function.
* lisp/minibuffer.el (completion-file-name-affixation): Use it.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist)
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): Register
handler function for 'file-name-completion-annotation'.
(tramp-sh-handle-file-name-completion-annotation)
* lisp/net/tramp.el (tramp-file-name-for-operation): Handle it.

* doc/lispref/files.texi (File Attributes)
(Magic File Names): Document 'file-name-completion-annotation'.

* etc/NEWS: Announce it.

15 months ago* src/nsfont.m (nsfont_open): Fix Ffont_xlfd_name args.
Michael Albinus [Fri, 12 Jan 2024 15:19:42 +0000 (16:19 +0100)]
* src/nsfont.m (nsfont_open): Fix Ffont_xlfd_name args.

(cherry picked from commit 10cfbda88413c8ac0d254553fd537447b890a885)

15 months agosh-script.el: Add support for `case FOO {...}` (bug#55764)
Stefan Monnier [Fri, 12 Jan 2024 03:12:34 +0000 (22:12 -0500)]
sh-script.el: Add support for `case FOO {...}` (bug#55764)

* lisp/progmodes/sh-script.el (sh-font-lock-paren): Also recognize
`FOO)` after `{`.
(sh-smie-sh-rules): Make `for` rule apply to `case FOO { ...}` as well.

* test/manual/indent/shell.sh: Add new test case.

(cherry picked from commit eac3f2a80778b3904c55ae7b65ff862a79eebf2a)

15 months agoEglot: Simplify overlay handling in manual example
Slava Akhmechet [Thu, 11 Jan 2024 21:50:08 +0000 (15:50 -0600)]
Eglot: Simplify overlay handling in manual example

* doc/misc/eglot.texi (Extending Eglot): Simplify.

Copyright-paperwork-exempt: yes
(cherry picked from commit bfb486d8026424ec0859036b3686df9cab1383df)

15 months agoAdd autoload cookie to vc-git-grep
Alyssa Ross [Thu, 9 Nov 2023 14:46:30 +0000 (15:46 +0100)]
Add autoload cookie to vc-git-grep

* lisp/vc/vc-git.el (vc-git-grep): Add autoload cookie.  (Bug#67018)

(cherry picked from commit e4e89e2cb663c730fd563d89228fe3a9a34e63e5)

15 months agoSupport indented continuation lines in lua-ts-mode
john muhl [Sat, 6 Jan 2024 15:36:33 +0000 (09:36 -0600)]
Support indented continuation lines in lua-ts-mode

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Add a rule to indent multi-line assignments and if statements.
(lua-ts-indent-continuation-lines): New user option.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts: Add
tests.  (Bug#68279)

(cherry picked from commit a66069c50c8eaf4a3ee253e7b7e47af48e721585)

15 months ago; Adapt some recent changes around completion categories
Eshel Yaron [Fri, 12 Jan 2024 09:21:24 +0000 (10:21 +0100)]
; Adapt some recent changes around completion categories

* doc/lispref/minibuf.texi (Completion Variables):
* lisp/minibuffer.el (completion-extra-properties)
(completion-category-defaults): Mention 'narrow-completions-function'.
(completion-category-overrides): Do that, and improve Custom type.