]> git.eshelyaron.com Git - emacs.git/log
emacs.git
11 months ago; Elaborate minibuffer file name reading documentation
Eshel Yaron [Sat, 6 Jan 2024 13:28:14 +0000 (14:28 +0100)]
; Elaborate minibuffer file name reading documentation

* doc/emacs/mini.texi (Minibuffer File): Slightly elaborate.
(Completion Commands): Fix markup.

11 months agoSupport sorting file name completions list by last modified time
Eshel Yaron [Sat, 6 Jan 2024 12:31:23 +0000 (13:31 +0100)]
Support sorting file name completions list by last modified time

(minibuffer--sort-file-names-by-last-modified-time): New function.
(read-file-name-default): Add it to
'minibuffer-completions-sort-orders' buffer-locally.
* doc/emacs/mini.texi (Completion Commands): Elaborate about
'minibuffer-sort-completions'.

11 months agoAdd completion annotations for file name completion
Eshel Yaron [Fri, 5 Jan 2024 18:03:13 +0000 (19:03 +0100)]
Add completion annotations for file name completion

* lisp/minibuffer.el (completion-file-name-affixation): New function.
(completion-file-name-table): Use it as 'affixation-function'.
* doc/emacs/help.texi (Name Help): Move doc of 'completions-detailed'
from here to...
* doc/emacs/mini.texi (Completion Options): ...here.  Improve wording.
* etc/NEWS: Announce.

11 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'.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 months ago; Fix typos in recent documentation additions
Eshel Yaron [Wed, 10 Jan 2024 17:28:39 +0000 (18:28 +0100)]
; Fix typos in recent documentation additions

* doc/emacs/mini.texi (Narrow Completions)
* doc/lispref/minibuf.texi (Minibuffer Completion): Fix typos.

11 months ago; Add menu entry for 'minibuffer-set-completion-styles'
Eshel Yaron [Wed, 10 Jan 2024 13:04:41 +0000 (14:04 +0100)]
; Add menu entry for 'minibuffer-set-completion-styles'

* lisp/menu-bar.el: Bind 'minibuffer-set-completion-styles'.

11 months agoNew command 'minibuffer-set-completion-styles'
Eshel Yaron [Wed, 10 Jan 2024 09:56:09 +0000 (10:56 +0100)]
New command 'minibuffer-set-completion-styles'

Add an interactive command for setting completion styles in the
current minibuffer.

* lisp/minibuffer.el (completion-style)
(completion--matching-style, completion-local-styles): New vars.
(completion--styles): Use 'completion-local-styles' when it's non-nil.
(completion--nth-completion): Set 'completion--matching-style' to the
matching completion style.
(completion-styles-affixation, completion-styles-table): New funs.
(minibuffer-set-completion-styles): New command.
(minibuffer-local-completion-map): Bind it.
(minibuffer-completion-help): Set 'completion-style' in the
"*Completions*" buffer.
* lisp/simple.el (completion-setup-function): Keep 'completion-style'.
(completion-list-mode): Display 'completion-style' in mode line.

* doc/emacs/mini.texi (Completion Commands, Completion Styles):
Document new command.

* doc/lispref/minibuf.texi (Completion Commands)
(Completion Variables): Document new command and variable.

* etc/NEWS: Announce new command.

11 months ago; Fix 'crm-change-separator'
Eshel Yaron [Mon, 8 Jan 2024 15:25:36 +0000 (16:25 +0100)]
; Fix 'crm-change-separator'

* lisp/emacs-lisp/crm.el (crm-current-separator): New variable.
(crm-complete-and-exit, crm-change-separator)
(completions-multi-mode): Use it instead of 'crm-separator'.
(completing-read-multiple): Let-bind 'crm-current-separator' to the
current value of 'crm-separator'.

11 months agoImprove handling of file name completion predicate
Eshel Yaron [Thu, 4 Jan 2024 20:09:53 +0000 (21:09 +0100)]
Improve handling of file name completion predicate

* lisp/minibuffer.el (completion-file-name-table): Avoid hard-coding
'file-exists-p', call predicate without directory name and set
'default-directory' to that directory instead.
(read-file-name): Update documentation.
* lisp/pcomplete.el (pcomplete--entries): Handle zero-length arg.
* doc/lispref/minibuf.texi (Reading File Names): Elaborate.

11 months ago; Fix completions restriction descriptions with boundaries
Eshel Yaron [Thu, 4 Jan 2024 15:24:26 +0000 (16:24 +0100)]
; Fix completions restriction descriptions with boundaries

* lisp/minibuffer.el (minibuffer-narrow-completions-to-current):
Respect completion boundaries when formatting restriction description.

11 months ago; Bind 'minibuffer-complete-and-exit' in "Minibuf" menu
Eshel Yaron [Wed, 3 Jan 2024 15:04:59 +0000 (16:04 +0100)]
; Bind 'minibuffer-complete-and-exit' in "Minibuf" menu

* lisp/menu-bar.el (minibuffer-local-completion-map): Bind
'minibuffer-complete-and-exit' in "Minibuf" menu bar menu, shadowing
the binding of 'exit-minibuffer' in that menu.

11 months agoImprove 'completing-read-multiple'
Eshel Yaron [Wed, 3 Jan 2024 13:13:17 +0000 (14:13 +0100)]
Improve 'completing-read-multiple'

This simplifies the implementation of crm.el, making it a thin wrapper
around 'completing-read'.  This obviates the need for bespoke commands
such as 'crm-complete' and 'crm-completion-help', and allows us to
remove incorrect code in minibuffer.el that tried to accommodate for
both 'completing-read' and 'completing-read-multiple'.
'crm-complete-and-exit' is still required to get the right behavior.
While we're at it, also add a command for changing 'crm-separator'
interactively, and an indication of 'completing-read-multiple' in
the *Completions* buffer mode line.

* lisp/emacs-lisp/crm.el (crm-local-completion-map)
(crm-local-must-match-map): No longer used, replace with obsolete
aliases of 'completing-read-multiple-mode-map' in favor of third party
code that uses these variables.
(crm-completion-table, crm--current-element)
(crm--completion-command, crm-completion-help)
(crm-complete, crm-complete-word)
(crm--choose-completion-string): No longer used, remove.
(crm-complete-and-exit): Update.
(read-string-matching-regexp): New local variable.
(read-string-matching-try-exit)
(crm-change-separator): New commands.
(read-string-matching-mode-map)
(completing-read-multiple-mode-map): New keymap variables.
(read-string-matching-mode)
(completing-read-multiple-mode)
(completions-multi-mode): New minor modes.
(read-string-matching, crm-completion-setup): New functions.
(completing-read-multiple): Update.

* lisp/minibuffer.el (minibuffer-sort-completions)
(minibuffer-narrow-buffer-completions)
(minibuffer--add-completions-predicate)
(minibuffer-narrow-completions-to-current)
(minibuffer-widen-completions)
(completions-auto-update): Delegate completion boundaries calculation.

* doc/lispref/minibuf.texi (Minibuffer Completion): Document c-r-m.
* etc/NEWS: Announce 'crm-change-separator'.

11 months agoSupport interactively sorting minibuffer completions
Eshel Yaron [Wed, 27 Dec 2023 09:11:36 +0000 (10:11 +0100)]
Support interactively sorting minibuffer completions

* lisp/minibuffer.el (minibuffer-completions-sort-function): New var.
(minibuffer-read-sort-order-with-completion)
(minibuffer-completions-sort-orders): New user options.
(minibuffer-sort-completions): New command.
(minibuffer-local-completion-map): Bind it to 'C-x C-v'.
(display-completion-list, minibuffer-completion-help): Take
'minibuffer-completions-sort-function' into account.
(completions-header-format): Add '%t' format spec construct,
substituted with a description of the current sort order.
* lisp/menu-bar.el (minibuffer-local-completion-map): Add menu bar
menu entry for sorting completions candidates.
* doc/emacs/mini.texi (Completion Commands): Document new command.
Improve documentation and indexing of 'minibuffer-complete-and-exit'.
(Completion Exit, Completion Options): Update
* doc/lispref/minibuf.texi (Completion Commands): Document new user
options and command.
* etc/NEWS: Announce new feature.

11 months ago; (completion-metadata): Mention 'narrow-completions-function'.
Eshel Yaron [Wed, 27 Dec 2023 09:05:14 +0000 (10:05 +0100)]
; (completion-metadata): Mention 'narrow-completions-function'.

11 months ago; Support removing individual completions restrictions
Eshel Yaron [Mon, 25 Dec 2023 11:24:51 +0000 (12:24 +0100)]
; Support removing individual completions restrictions

* lisp/minibuffer.el (minibuffer-widen-completions): New optional
argument ALL, if nil prompt for individual restrictions to remove.
Also, take into account completions boundaries when calling
'minibuffer-completion-help'.
* doc/emacs/mini.texi (Completion Commands, Narrow Completions):
Update documentation.
* lisp/menu-bar.el (map): Update help text.

11 months ago; Respect 'completion-boundaries' in 'completions-auto-update'
Eshel Yaron [Mon, 25 Dec 2023 11:07:48 +0000 (12:07 +0100)]
; Respect 'completion-boundaries' in 'completions-auto-update'

* lisp/minibuffer.el (minibuffer-regexp-mode): Use new helper function
'minibuffer--completion-help' to compute completion boundaries.

11 months ago; Respect 'completion-boundaries' in narrow-completions commands
Eshel Yaron [Mon, 25 Dec 2023 10:59:49 +0000 (11:59 +0100)]
; Respect 'completion-boundaries' in narrow-completions commands

* lisp/minibuffer.el (minibuffer--completion-boundaries): New helper
function, return 'completion-boundaries' for minibuffer input as
a pair of buffer positions in the minibuffer.
(minibuffer--add-completions-predicate)
(minibuffer-narrow-completions-by-regexp)
(minibuffer-narrow-completions-to-current): Use it.

11 months agoAdd Completions Auto Update minor mode
Eshel Yaron [Sat, 23 Dec 2023 09:13:51 +0000 (10:13 +0100)]
Add Completions Auto Update minor mode

This adds a new global minor that updates the *Completions* buffer as
you type in the minibuffer.

* lisp/minibuffer.el (completions-auto-update-idle-time): New option.
(completions-auto-update-timer): New buffer-local variable.
(completions-auto-update)
(completions-auto-update-start-timer)
(completions-auto-update-setup)
(completions-auto-update-exit): New functions.
(completions-auto-update-mode): New global minor mode.
* doc/emacs/mini.texi (Completion Options): Document it.
* etc/NEWS: Announce it.

11 months ago; doc/emacs/mini.texi: Improve cross referencing.
Eshel Yaron [Sat, 23 Dec 2023 07:11:58 +0000 (08:11 +0100)]
; doc/emacs/mini.texi: Improve cross referencing.

11 months ago* doc/lispref/minibuf.texi (Completion Commands): Fix typos.
Eshel Yaron [Fri, 22 Dec 2023 19:29:30 +0000 (20:29 +0100)]
* doc/lispref/minibuf.texi (Completion Commands): Fix typos.

11 months agoSupport narrowing (restricting) minibuffer completions
Eshel Yaron [Thu, 21 Dec 2023 19:43:59 +0000 (20:43 +0100)]
Support narrowing (restricting) minibuffer completions

Add new minibuffer commands for restricting the list of possible
completion candidates.

* lisp/minibuffer.el (completion-fail-discreetly): Fix docstring typo.
(minibuffer-narrow-completions-function): New variable.
(completion--fail, minibuffer-narrow-completions-p)
(minibuffer-narrow-completions-by-regexp)
(minibuffer--completion-predicate-description)
(minibuffer--add-completions-predicate): New functions.
(minibuffer-narrow-completions-to-current)
(minibuffer-narrow-completions)
(minibuffer-widen-completions): New commands.
(minibuffer-narrow-completions-map): New prefix keymap.  Bind new
commands to 'n', 'm' and 'w', respectively.
(minibuffer-local-completion-map): Bind new prefix keymap to 'C-x n'.
(completions-header-format, completion--do-completion)
(display-completion-list, minibuffer-completion-help): Update.

* lisp/simple.el (completions-narrow-mode): New minor mode.
(completion-setup-function): Enable it in *Completions* buffer when
there are completions restrictions in place.

* lisp/menu-bar.el (minibuffer-local-completion-map): Add completions
narrowing commands to "Minibuf" menu.

* lisp/help-fns.el (help--symbol-completion-table): Provide bespoke
'narrow-completions-function' that keeps only symbols with a given
symbol property.

* doc/emacs/emacs.texi (Top)
* doc/emacs/mini.texi (Completion): Update menu.
(Narrow Completions): New subsection.
(Completion Commands, Completion Styles)
(Completion Options)
* doc/emacs/help.texi (Name Help)
* doc/lispref/minibuf.texi (Completion Commands):
(Programmed Completion): Update documenation.

* etc/NEWS: Announce new feature.

11 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.

11 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.

11 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

11 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.

11 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.

11 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.

11 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.

11 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

11 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.

11 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.

11 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.

11 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.

11 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).

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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)

11 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

11 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.

11 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`.

11 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

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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)

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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)

11 months agoFix typo in lispref "Creating Strings" section
Xiyue Deng [Sat, 13 Jan 2024 17:08:49 +0000 (18:08 +0100)]
Fix typo in lispref "Creating Strings" section

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

11 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.

11 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 13 Jan 2024 10:36:16 +0000 (05:36 -0500)]
Merge from origin/emacs-29

c494a6e879d Improve documentation of 'emacs_function' in modules
a08e6423ccc ; * doc/emacs/fixit.texi (Spelling): Fix last change.
418547162d5 Improve documentation of Ispell commands
c4b49488455 Don't recommend inverse-video for debugging

11 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 13 Jan 2024 10:36:16 +0000 (05:36 -0500)]
; Merge from origin/emacs-29

The following commit was skipped:

26eb9d3a8a6 Fix typo in lispref "Creating Strings" section

11 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 13 Jan 2024 10:36:16 +0000 (05:36 -0500)]
Merge from origin/emacs-29

99efe5c80f9 Fix count of no-op functions (bug#68375)
0c01f97b73c Wrap @pxref of Abbrevs in parentheses (bug#68375)
70a09325d65 ; Fix last change in widget.texi
63411709a8d ; Fix typos
824cf54951c ; * etc/TODO: Add item to make play-sound non-blocking.
4fadbfe300a Add examples to the Widget manual
1bbb610821e Implement missing functions for custom-icon widget
29af214a75a Fix fontification of cgroup2 in fstab (bug#68367)

11 months ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 13 Jan 2024 10:36:15 +0000 (05:36 -0500)]
; Merge from origin/emacs-29

The following commit was skipped:

5567ce1a9ff Handle package versions that are not version strings

11 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 13 Jan 2024 10:36:15 +0000 (05:36 -0500)]
Merge from origin/emacs-29

d58d0fa52ff Introduce 'let' using lexical binding in the Lisp Introdu...
1b123972636 ; Don't record multiple versions of use-package
8729a2a10d9 Fix 'rmail-summary-by-thread'
2a8c00bfc07 * doc/emacs/back.texi: Fix a typo.

11 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.

11 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.

11 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.

11 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)

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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

11 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.