João Távora [Tue, 14 Jan 2025 17:44:38 +0000 (17:44 +0000)]
Flymake: improve idempotence of flymake-mode (bug#69809)
In some circumstances, such as the ones described in the referenced bug
report, flymake-mode is activated non-interactively and asynchronously
in buffers where it may already be active and in the midst of
operations.
This commit ensures that flymake-mode a bit safer to re-enable in such
circumstances and fixes the bug. It also adds some comments documenting
the situation.
* lisp/progmodes/flymake.el (flymake-mode): Don't smash flymake--state.
Add some comments. No need to check for flymake--state nil.
(flymake--project-diagnostics): No need to check for flymake--state nil.
Martin Rudalics [Tue, 14 Jan 2025 08:51:17 +0000 (09:51 +0100)]
Handle removal of selected tty child frame
* src/dispextern.h (root_frame):
* src/frame.h (root_frame): Move declaration from dispextern.h
to frame.h.
(SET_FRAME_VISIBLE): Whend making the selected tty child frame
invisible, use mru_rooted_frame to find a frame to switch to.
* src/dispnew.c (root_frame): Move root_frame to frame.c.
* src/frame.c (do_switch_frame): On ttys don't change the
top frame when switching from a child frame to another frame
with the same root.
(root_frame): Move here from dispnew.c.
(Fframe_root_frame): New Lisp function.
(delete_frame): Whend deleting the selected tty child frame use,
mru_rooted_frame to find a frame to switch to.
* src/window.c (mru_rooted_frame): New function.
* src/window.h (mru_rooted_frame): Declare it.
* doc/lispref/frames.texi (Child Frames): Describe new function
'frame-root-frame'.
Daniel Mendler [Sun, 8 Dec 2024 19:05:07 +0000 (20:05 +0100)]
New customization variable `completion-eager-display'
The customization option can be set to t or nil, to respectively
always or never show the *Completions* buffer eagerly at the
beginning of a completion session. Furthermore the option can
be set to the value auto. In this case the *Completions* buffer
will only be shown if requested by the completion table.
Completion tables can use the `eager-display' completion
metadata to do so. (Bug#74616, Bug#74617)
* lisp/minibuffer.el (completion-eager-display): New
customization variable.
(completion-metadata): Update docstring, document the
new `eager-display' completion metadata.
(completion-extra-properties): Update docstring, document the
new `:eager-display' completion metadata.
(completion-category-overrides): Add `eager-display' to the
custom type specification.
(completing-read-default): Handle the `completion-eager-display'
customization variable and the `eager-display' completion
metadata.
(completion-table-with-metadata): New function to create
a completion table with metadata.
(minibuffer-complete-defaults, minibuffer-complete-history):
Use it.
* lisp/ffap.el (ffap-menu-ask): Add `ffap-menu' completion
category and `eager-display' completion metadata. Use
`completion-table-with-metadata'.
* lisp/imenu.el (imenu-eager-completion-buffer): Correct
docstring, which had been inverted.
(imenu--completion-buffer): Add `eager-display' completion
metadata. Use `completion-table-with-metadata'.
* lisp/tmm.el (tmm-prompt): Add `tmm' completion category and
`eager-display' completion metadata. Use
`completion-table-with-metadata'. Add keymap setup.
(tmm-add-prompt): Remove keymap setup.
(tmm-goto-completions): Call `tmm-add-prompt' to ensure that a
*Completions* buffer is shown.
(tmm--completion-table): Remove unused internal function.
* etc/NEWS: Announce the change.
Yuan Fu [Mon, 13 Jan 2025 07:41:47 +0000 (23:41 -0800)]
Add 'and', 'named', and 'anonymous' predicate for tree-sitter
* doc/lispref/parsing.texi (User-defined Things): Mention the
new predicate.
* src/treesit.c (treesit_traverse_validate_predicate): Recognize
named, anonymous, and and predicates.
(treesit_traverse_match_predicate): Handle named, anonymous, and
and predicates.
Yuan Fu [Mon, 13 Jan 2025 06:23:36 +0000 (22:23 -0800)]
Fix c-ts-mode indentation (bug#75442)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--simple-indent-rules):
Use standalone-parent instead of parent.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts:
New test.
Yuan Fu [Sun, 12 Jan 2025 08:35:20 +0000 (00:35 -0800)]
Add newly supported keywords to c-ts-mode (bug#75226)
For the new keywords, test if the grammar supports them before
useing it.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--optional-c-keywords): New variable.
(c-ts-mode--ms-keywords): New variable.
(c-ts-mode--compute-optional-keywords): New function.
(c-ts-mode--keywords): Add new optional keywords.
(c-ts-mode--c++-operators): New variable.
(c-ts-mode--c++-operator-keywords): New variable.
(c-ts-mode--font-lock-settings): Use c-ts-mode--c++-operators.
Roland Winkler [Sun, 12 Jan 2025 21:17:28 +0000 (15:17 -0600)]
bibtex-string-file-path and bibtex-file-path are lists of directories
* lisp/textmodes/bibtex.el (bibtex-string-file-path, bibtex-file-path):
These user options are now lists of directories. For backward compatibility,
the old, obsolete format is still supported.
(bibtex-string-files-init, bibtex-initialize): Change accordingly.
Use file-name-extension and file-name-with-extension.
* etc/NEWS: Entry for new format of bibtex-string-file-path and
bibtex-file-path.
Mauro Aranda [Sun, 12 Jan 2025 18:19:40 +0000 (15:19 -0300)]
Emphasize the use of :tag for new customization types
* doc/lispref/customize.texi (Type Keywords): Name important use
cases of the :tag keyword.
(Defining New Types): Emphasize the use of the :tag keyword when
using the lazy widget. (Bug#74409)
Juri Linkov [Sun, 12 Jan 2025 18:17:16 +0000 (20:17 +0200)]
Add treesit-thing-settings to yaml-ts-mode and enable transpose-sexps
* lisp/treesit.el (treesit-major-mode-setup): Move setting of
'transpose-sexps-function' outside of 'treesit-thing-defined-p'
since 'treesit-transpose-sexps' doesn't depend on the 'sexp' thing.
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode):
Add 'treesit-thing-settings' with the 'list' thing,
but use it only for list commands, not sexp commands (bug#73404).
Juri Linkov [Sat, 11 Jan 2025 18:28:43 +0000 (20:28 +0200)]
Improve treesit list navigation support for #if/#endif (bug#73404)
* lisp/treesit.el (treesit--forward-list-with-default): Improve to
better support the case when point is inside an opening/closing node
with a name longer than 1 character such as "#if" and "#endif".
(treesit-navigate-thing): No need to check for thing 'list'
since list commands now use other functions.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--thing-settings): Add
more preproc nodes such as #if/#endif and #ifdef/#endif and their
variants to the 'list' thing.
Juri Linkov [Sat, 11 Jan 2025 17:39:56 +0000 (19:39 +0200)]
* lisp/progmodes/typescript-ts-mode.el: Fix syntax of tsx tags.
(tsx-ts--s-p-query): Bind 'jsx_opening_element' and
'jsx_closing_element' to @jsx to be able to use the < and > syntax
for angle brackets in 'tsx-ts--syntax-propertize-captures' (bug#73978).
Daniel Mendler [Sat, 28 Dec 2024 12:21:46 +0000 (13:21 +0100)]
ibuffer: Add the "Recency" column
Define a column which shows how many seconds ago the respective
buffer has been displayed. The time is formatted with the
`seconds-to-string' function, with the new arguments READABLE=t
and ABBREV=t.
* lisp/ibuffer.el (ibuffer-recency-header-map): New keymap.
(define-ibuffer-column recency): New column.
* etc/NEWS: Mention new `recency' column. (Bug#73047)
Stefan Kangas [Wed, 8 Jan 2025 03:50:53 +0000 (04:50 +0100)]
Clarify that 'mac' line ending convention is not used on macOS
* doc/emacs/mule.texi (Coding Systems):
* doc/lispref/nonascii.texi (Coding System Basics): Clarify that the
'mac' line ending convention is not used on macOS, and is now rare
outside of legacy software.
Hong Xu [Sat, 4 Jan 2025 20:32:24 +0000 (12:32 -0800)]
Improve the documentation of 'key-valid-p'
* lisp/keymap.el (key-valid-p): Add an function key and mouse
button example. Mention '<left>' as a cursor control key
instead of a function key. Briefly explain what an event may
be. (Bug#75366)
Jared Finder [Tue, 7 Jan 2025 04:52:11 +0000 (20:52 -0800)]
Support TTY child frames with GPM mouse
* lisp/frame.el (x-list-fonts): Delete `frame-at', to move to
C implementation.
* lisp/xt-mouse.el (xterm-mouse-event): Call new `tty-frame-at'.
* src/term.c (tty_frame_at, Ftty_frame_at): New C function,
replacing `frame-at' only for TTYs.
(term_mouse_position): Use last_mouse_frame when it is set.
(handle_one_term_event): Call tty_frame_at to get frame under
mouse, store it in last_mouse_frame. Alter event coordinates
based on mouse frame.
(syms_of_term): Add tty-frame-at, last_mouse_frame.
* src/termhooks.h: Make Gpm_Event parameter const.
Martin Rudalics [Fri, 10 Jan 2025 08:24:20 +0000 (09:24 +0100)]
Have 'split-window' optionally resurrect deleted windows
* src/window.c (Fwindow_old_buffer): Handle deleted window as
argument.
(make_parent_window): Remove function.
(Fsplit_window_internal): New argument REFER for resurrecting
deleted windows. Incorporate functionality of defunct
make_parent_window.
(Fdelete_window_internal, delete_all_child_windows): Store any
deleted window's buffer in the window's old_buffer slot.
(window_dead_windows_table): Make it a 'value' type hash table
so the sequence number cannot affect its weakness.
* lisp/window.el (split-window): New argument REFER.
* doc/lispref/windows.texi (Resurrecting Windows): New section.
(Splitting Windows): Explain new argument REFER.
(Window Hooks): Rewrite description of 'window-old-buffer'.
* etc/NEWS: Mention new REFER argument for 'split-window'.
Juri Linkov [Fri, 10 Jan 2025 07:33:49 +0000 (09:33 +0200)]
Use the treesit thing 'list' with symbol property 'treesit-thing-symbol'
* doc/lispref/parsing.texi (User-defined Things): Mention new
functions 'treesit-forward-list', 'treesit-down-list',
'treesit-up-list', 'treesit-show-paren-data' that use the thing
'list' with the symbol property 'treesit-thing-symbol' (bug#73404).
* lisp/treesit.el: Put the property 'treesit-thing-symbol'
on the symbol 'list'.
(treesit--forward-list-with-default, treesit-down-list)
(treesit-up-list, treesit-navigate-thing)
(treesit-show-paren-data--categorize, treesit-major-mode-setup):
Replace 'sexp-list' with 'list'.
* src/treesit.c (treesit_traverse_validate_predicate)
(treesit_traverse_match_predicate): Check if the 'pred'
symbol has the property 'Qtreesit_thing_symbol'.
(syms_of_treesit): New symbol 'Qtreesit_thing_symbol'.
Juri Linkov [Thu, 9 Jan 2025 18:33:03 +0000 (20:33 +0200)]
* lisp/man.el (Man-fit-to-window): Don't update on tty with MANWIDTH.
Check if 'Man-columns' is non-nil before trying to reformat
the manpage buffer. The value of the varible 'Man-columns'
is nil on a non-window system where "MANWIDTH" or "COLUMNS"
is defined. And the return value of the function 'Man-columns'
is meaningless in this case anyway. So no need to react
to changes in window width (bug#74924).
Martin Rudalics [Thu, 9 Jan 2025 08:37:13 +0000 (09:37 +0100)]
In xt_action_hook don't act on deleted window's scroll bar (Bug#75120)
* src/xterm.c (xt_action_hook): Make sure window_being_scrolled
is live (Bug#75120).
* src/pdumper.c (dump_subr): Update pertinent hash of
HASH_Lisp_Subr.
Kierin Bell [Wed, 8 Jan 2025 23:29:55 +0000 (18:29 -0500)]
Fix documentation of Iroquoian input methods
* lisp/leim/quail/iroquoian.el: Fix typos in Oneida endonym and in the
docstring of `haudenosaunee-postfix' about keys for inputting Onondaga
nasals. (Bug#75448)
Arash Esbati [Wed, 8 Jan 2025 19:47:43 +0000 (20:47 +0100)]
Remove support for supertabular from RefTeX
* doc/misc/reftex.texi (Builtin Label Environments):
* lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin)
(reftex-default-label-alist-entries): Delete entries for the
supertabular environment. supertabular is an extension of the
normal tabular environment, and therefore doesn't contain a
caption and label. Hence, supporting supertabular in RefTeX is
useless.
Arash Esbati [Wed, 8 Jan 2025 18:12:49 +0000 (19:12 +0100)]
Replace obsolete subfigure package with subfig
* doc/misc/reftex.texi (Builtin Label Environments): Mention the
subfig LaTeX package instead of the obsolete subfigure.
* lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin):
Replace obsolete subfigure entry with subfig. Adjust the macro
names accordingly and the regexp for matching the context.
Unify the descriptions of all entries.
(reftex-default-label-alist-entries): Use subfig as well.
Eshel Yaron [Thu, 9 Jan 2025 11:22:03 +0000 (12:22 +0100)]
Auto-adapt completion preview background color
Teach Completion Preview mode to automatically remap its
faces such that the background color of the preview overlay
matches the background color of the buffer text that is
being completed. Crucially, this resolves an issue where
the preview overlay didn't look nice with hl-line-mode on.
Also see related discussion in bug#71282.
* lisp/completion-preview.el
(completion-preview-adapt-background-color): New option.
(completion-preview--bg-color): New function.
(completion-preview--face-remap-cookie-jar): New variable.
(completion-preview--make-overlay): Use them.
Stefan Kangas [Wed, 8 Jan 2025 05:39:22 +0000 (06:39 +0100)]
Move define_error declaration and docstring
* src/lisp.h (define_error): Move declaration to its proper place, make
external, and move its docstring...
* src/eval.c (define_error): ...to its function definition.
F. Jason Park [Wed, 8 Jan 2025 01:17:50 +0000 (17:17 -0800)]
; Mark ERC keep-place-indicator test as :unstable
* test/lisp/erc/erc-scenarios-keep-place-indicator.el
(erc-scenarios-keep-place-indicator--follow): Don't run on EMBA pending
investigation of test timing out.
F. Jason Park [Sun, 5 Jan 2025 23:59:46 +0000 (15:59 -0800)]
Improve use of Flyspell's API in erc-spelling
* etc/ERC-NEWS: Announce deprecation of `erc-spelling-flyspell-verify'
and `erc-spelling-unhighlight-word'. A slight behavioral change not
worth mentioning is that, previously, ERC arranged for Flyspell to
ignore any word immediately following a forward slash anywhere in the
prompt input, even those for which the slash served as mere
punctuation (a "stroke"), as in "something/misspelt." As of this
change, Flyspell only unconditionally exempts an initial slash-prepended
word, like "tableflip" in "ERC> /tableflip", and checks all others that
follow against known slash commands.
* lisp/erc/erc-spelling.el: Change top-level assignment of `erc-mode'
symbol-property `flyspell-mode-predicate' from
`erc-spelling-flyspell-verify' to `erc-spelling--flyspell-input-p'.
(erc-spelling-mode, erc-spelling-disable): Remove local member from
`flyspell-incorrect-hook'.
(erc-spelling-init): Add `erc-spelling--flyspell-check' to
`flyspell-incorrect-hook' locally. Don't bother explicitly setting
`flyspell-generic-check-word-predicate' because Flyspell already does
that for clients using the `flyspell-mode-predicte' interface.
(erc-spelling-flyspell-verify, erc-spelling-unhighlight-word): Mark
obsolete.
(erc-spelling--flyspell-check, erc-spelling--flyspell-input-p): New
functions, essentially the two halves of a reworked and bifurcated
`erc-spelling-flyspell-verify'. Though used as a predicate, the first
is not named as such because it performs side effects.
* test/lisp/erc/erc-scenarios-spelling.el: New file.
* test/lisp/erc/resources/spelling/auto-correct.eld: New file.
(Bug#75327)
F. Jason Park [Mon, 6 Jan 2025 00:58:50 +0000 (16:58 -0800)]
Fix regression in erc-nicks involving color pools
* lisp/erc/erc-nicks.el (erc-nicks-colors): Tweak doc.
(erc-nicks--create-pool-function): On graphic displays, set value to
`erc-nicks--create-culled-pool', the original default. This fixes a bug
in which ERC mapped all pool members to a primary color, thus excluding
the bulk of them. Thanks to Trevor Arjeski for discovering it.
(erc-nicks--create-coerced-pool): Mention the text-terminal-only
requirement in doc.
(erc-nicks-refresh): Improve doc.
* test/lisp/erc/erc-nicks-tests.el (erc-nicks-tests--track-faces):
Enable `erc-track-mode' prior to running body.
Arash Esbati [Tue, 7 Jan 2025 21:02:13 +0000 (22:02 +0100)]
Update RefTeX manual
* doc/misc/reftex.texi: (Builtin Label Environments): Mention
supported LaTeX packages ctable, minted and listings.
(Reference Styles): Update the supported reference styles and the
corresponding macros.
(Citation Styles): Mention support for biblatex package.
(Language Support): Describe usage of non-ASCII characters in the
LaTeX \label definition.
(Style Files): Mention biblatex.el as well.
(Options - Defining Label Environments): Add entry for
`reftex-label-regexps' option.
Other minor improvements.
Roland Winkler [Tue, 7 Jan 2025 17:56:48 +0000 (11:56 -0600)]
bibtex-braced-string-syntax-table: fix bug #68477
* lisp/textmodes/bibtex.el (bibtex-braced-string-syntax-table):
Give all parentheses the syntax punctuation so that we do not
choke because of unbalanced parentheses other than braces (bug