Stefan Kangas [Fri, 17 Jan 2025 17:17:35 +0000 (18:17 +0100)]
Turn macros into enums in keyboard.h
* src/keyboard.h (item_property_idx, menu_item_pane_idx): Turn macros
into enums.
(ITEM_PROPERTY_MAX): New constant.
* src/keyboard.c (parse_menu_item): Use above new constant.
Stefan Monnier [Fri, 17 Jan 2025 13:43:50 +0000 (08:43 -0500)]
(hack-one-local-variable): Refine last patch (bug#74964)
* lisp/files.el (hack-local-variables--inhibit-eval): Rename from
`hack-local-variables--inhibit`.
(hack-one-local-variable): Skip only those eval forms we're already
in the process of evaluating.
Harald Jörg [Mon, 13 Jan 2025 11:24:40 +0000 (12:24 +0100)]
; cperl-mode.el: Allow bare $ in a signature (Bug#74245)
* lisp/progmodes/cperl-mode.el (cperl--signature-rx): Allow bare
sigils for unused parameters in signatures.
(cperl-find-pods-heres): Avoid $) at the end of a signature being
treated as the punctuation variable $) by treating this dollar as
punctuation
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-signature-rx): Add ($first,$) as a valid signature,
remove ($) from the list of invalid signatures.
João Távora [Fri, 17 Jan 2025 10:57:46 +0000 (10:57 +0000)]
Flymake: fix bug introduced recently
Must protect against flymake--state never having been a hash
table at all, so that flymake-mode can be safely turned off even
if it never turned on in the first place.
Stefan Kangas [Fri, 17 Jan 2025 10:26:49 +0000 (11:26 +0100)]
Make NSM warn for DH key exchange on medium severity
* lisp/net/nsm.el (network-security-protocol-checks): Bump dhe-kx
severity to medium.
(nsm-protocol-check--dhe-kx): Update docstring to describe the so-called
Racoon Attack, discovered in 2020.
Stefan Monnier [Thu, 16 Jan 2025 22:18:24 +0000 (17:18 -0500)]
(asm-mode): Fix bug#75542
* lisp/progmodes/asm-mode.el (asm-mode): Be careful not to override
changes in the mode map or in `comment-start`.
Move the use of `asm-mode-set-comment-hook` back to where it was before
commit 0cff4e67f1de.
(asm-mode-set-comment-hook): Declare it obsolete.
Kierin Bell [Sat, 11 Jan 2025 22:25:51 +0000 (17:25 -0500)]
Improve usability and documentation of Iroquoian input methods
* lisp/leim/quail/iroquoian.el: Add variants for Mohawk and Oneida
endonyms in comments and docstrings. Update the 'oneida-postfix' input
method to make the most commonly used glottal stop character easiest to
input. Update the 'onondaga-postfix' input method with mnemonic keys
for nasals in the Onondaga Nation, New York orthography. (Bug#75448)
* etc/NEWS: Add variants for Mohawk and Oneida endonyms to NEWS entry.
Eli Zaretskii [Thu, 16 Jan 2025 15:51:47 +0000 (17:51 +0200)]
Fix subtle problem with updating 'font_style_table'
* src/font.c (font_style_to_value): Update the Vfont_* variables
to keep them in sync with their slots in 'font_style_table'.
(Bug#75521)
(syms_of_font): Comment on usage of DEFVAR_LISP_NOPRO.
Stefan Kangas [Wed, 15 Jan 2025 22:11:16 +0000 (23:11 +0100)]
Fix clear-string crash with text properties
* src/fns.c (Fclear_string): Fix crash by clearing all text
properties. (Bug#75581)
* doc/lispref/strings.texi (Modifying Strings): Document the above
behavior change.
Fix proposed by Andreas Schwab <schwab@linux-m68k.org>.
Juri Linkov [Tue, 14 Jan 2025 19:48:53 +0000 (21:48 +0200)]
Improve repeat-mode to correctly show multi-key sequences as echo
* lisp/repeat.el (repeat-echo-message-string):
Use 'cl--map-keymap-recursively' that iterates over
complete key sequences. Also it returns key vectors,
so don't need to use 'vector'.
Juri Linkov [Tue, 14 Jan 2025 19:41:48 +0000 (21:41 +0200)]
Fix repeat-mode to keep the same map symbol for repeat-continue
* lisp/repeat.el (repeat-get-map-sym): New function
refactored from 'repeat-get-map'.
(repeat-get-map): Move continue-related code to 'repeat-get-map-sym'.
(repeat-pre-hook): Use 'repeat-get-map-sym' and 'repeat-get-map'.
Set 'repeat-map' to 'map-sym'.
(repeat-post-hook): Use 'repeat-get-map-sym'.
* test/lisp/repeat-tests.el (repeat-tests-continue-another):
Improve to invoke double key 'C-M-o C-M-o' that should not switch
between maps (bug#74140).
Reset the values of 'tab-bar-history-back' and 'tab-bar-history-forward'
to nil to not retain a previous tab's history after switching to another
tab using window-state.
João Távora [Thu, 18 Jul 2024 00:09:10 +0000 (01:09 +0100)]
Flymake: more ambitious cleanup in flymake-mode (bug#69809)
Further improve flymake-mode idempotency by not nuke existing overlays.
This means multiple flymake-mode invocations do the same as just one
one, with minimal or no additional side effects. This is good for
people with lots of 'flymake-mode' in hooks.
The foreign diagnostic importation has been refactored into a separate
function and moved to the "really start" section of 'flymake-start'.
The duplication problem appears to be avoided by some heuristics in
flymake-highlight-line.
A new test has been added.
* lisp/progmodes/flymake.el (flymake--import-foreign-diagnostics): New helper
(flymake-start): Use it.
(flymake-mode): Don't nuke overlays here.
* test/lisp/progmodes/flymake-tests.el (foreign-diagnostics): New
test.
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).