1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00
Commit graph

176247 commits

Author SHA1 Message Date
Stefan Kangas
91b2b3654f 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.
2025-01-17 18:17:35 +01:00
Pranshu Sharma
efd4fb51ec Do not rotate dedicated windows
* lisp/window-x.el (rotate-windows): Do not rotate windows
dedicated to their buffers.
2025-01-17 16:35:43 +01:00
Stefan Monnier
4fada67748 (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.
2025-01-17 08:43:50 -05:00
Stefan Kangas
965e50e3ae Make NSM warn for TLS 1.1
* lisp/net/nsm.el (nsm-protocol-check--version): Warn also for
TLS 1.1.  Update docstring.
2025-01-17 12:25:39 +01:00
João Távora
f7ff5f1ba4 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.

Github-reference: https://github.com/joaotavora/eglot/discussions/1480

* lisp/progmodes/flymake.el (flymake-mode): Fix bug.
2025-01-17 10:58:15 +00:00
Stefan Kangas
c9196cf64e 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.
2025-01-17 11:38:25 +01:00
Eli Zaretskii
0b6ac3c6c1 ; * doc/lispref/variables.texi (Lexical Binding): Fix a recent change. 2025-01-17 10:14:18 +02:00
Paul Eggert
bc4c5818df Update from Gnulib by running admin/merge-gnulib 2025-01-16 23:22:34 -08:00
Po Lu
37b5b3ea91 Fix the Lisp reference manual for older Texinfo
* doc/lispref/symbols.texi (Standard Properties): Don't provide
empty reference.

* doc/lispref/variables.texi (Lexical Binding): Don't abuse xref
in a standalone sentence.
2025-01-17 09:25:39 +08:00
Stephen Gildea
863fd1c276 Property definition-type becomes find-function-type-alist
lisp/emacs-lisp/find-func.el (find-function-search-for-symbol): Use
symbol property 'find-function-type-alist' instead of 'definition-type'
(find-function-update-type-alist): New convenience function.
* doc/lispref/symbols.texi (Standard Properties): Update example to use
'find-function-type-alist' and 'find-function-update-type-alist'
* doc/lispref/functions.texi (Defining Functions):
* doc/lispref/tips.texi (Coding Conventions):
* doc/misc/ert.texi (How to Write Tests):
* etc/NEWS: Change reference to 'definition-type' to name
'find-function-type-alist' instead
2025-01-16 15:35:01 -08:00
Stefan Monnier
dace7fa2ab (cl-block, cl-return-from): Fix bug#75498
* lisp/emacs-lisp/cl-macs.el (cl-block, cl-return-from):
Change encoding so it obeys variable coping (i.e. lexical scoping when
`lexical-binding` is non-nil).
(cl--block-wrapper, cl--block-throw): Adjust accordingly.

* test/lisp/emacs-lisp/cl-macs-tests.el
(cl-macs--test-cl-block-lexbind-bug-75498): New test.
2025-01-16 17:48:21 -05:00
Stefan Monnier
8fc5001ba5 (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.
2025-01-16 17:18:24 -05:00
Thierry Volpiatto
78f5ea750a Handle correctly DISPLAY-FUNCTION arg in 'bookmark--jump-via'
This fixes bug #75354 where when jumping to a eww bmk to other
window (or frame) the buffer is displayed both in other window
and current window.
Previously 'bookmark--jump-via' was calling DISPLAY-FUNCTION on the
current-buffer from the new buffer created by bookmark handler
(e.g. eww) now DISPLAY-FUNCTION is called on the new buffer from
the current buffer (winconf is saved when calling handler).
In addition to make eww bookmarks displayed properly, this fix as
well w3m bookmarks and as a side effect fix the eww quit function
which restore properly winconf after quitting (previously leaving
two windows open).
* lisp/bookmark.el (bookmark--jump-via): Fix it.
2025-01-16 18:43:06 +02:00
Kierin Bell
edec6e2264 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.
2025-01-16 18:33:29 +02:00
Pip Cet
7fdec438ef ; * src/font.c (syms_of_font): Fix typo. 2025-01-16 15:55:30 +00:00
Eli Zaretskii
8d471adece 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.
2025-01-16 17:51:47 +02:00
Eli Zaretskii
b86b8f52a6 ; * lisp/emacs-lisp/rx.el: Remove extra dash. (Bug#75603) 2025-01-16 17:15:42 +02:00
Stephen Gildea
d30351e038 Update recent find-func change to fix elisp-mode-tests
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol):
Check that symbol is a symbol before trying to get a property.
2025-01-16 06:10:57 -08:00
Steven Allen
ec20ebf241 Take the tab-line into account when computing the window edges
window-body-height correctly subtracts the tab-line's height but
window-edges did not add this same height to the y-offset.

See https://github.com/emacs-exwm/exwm/pull/114

* lisp/window.el (window-edges): Add the tab-line-height to the y-offet
of the window body.  (Bug#75576)
2025-01-16 09:50:22 +02:00
Paul Eggert
74dc2bd280 Update from Gnulib by running admin/merge-gnulib 2025-01-15 19:31:39 -08:00
Stefan Kangas
4f946a6522 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>.
2025-01-15 23:16:19 +01:00
Stefan Kangas
86916c136b Add clear-string to symbol-releases.eld
* etc/symbol-releases.eld (clear-string): Add function.
2025-01-15 23:12:00 +01:00
Stefan Kangas
e092aabf71 Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'
* src/comp.c (emit_limple_insn):
* src/msdos.c (dos_set_keyboard, dos_rawgetc):
* src/sysdep.c (convert_speed, list_system_processes):
* src/w32fns.c (deliver_wm_chars, Fx_file_dialog):
* src/w32term.c (record_event, w32_read_socket):
Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.

* admin/coccinelle/arrayelts.cocci: New file.
2025-01-15 20:19:39 +01:00
Stefan Kangas
16c89c5ae5 Use calln instead of calling Ffuncall directly
* src/bytecode.c (bcall0):
* src/comp.c (bcall0):
* src/eval.c (apply1):
* src/lisp.h (call0):
* src/thread.c (invoke_thread_function): Use calln instead of calling
Ffuncall directly.

* admin/coccinelle/calln.cocci: New semantic patch.
2025-01-14 21:37:04 +01:00
Juri Linkov
2e937dc2b5 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'.
2025-01-14 21:48:53 +02:00
Juri Linkov
0bd12f560b 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).
2025-01-14 21:41:48 +02:00
Juri Linkov
6b71d0b178 * lisp/tab-bar.el (tab-bar-select-tab): Fix tab-bar-history-mode.
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.
2025-01-14 20:20:42 +02:00
João Távora
0ff82eb487 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.
2025-01-14 17:47:17 +00:00
João Távora
3a1b36a39d 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.
2025-01-14 17:44:38 +00:00
Eli Zaretskii
e633bbfec0 ; Fix wording and coding style of a recent commit
* src/treesit.c (treesit_traverse_match_predicate): Fix style.

* doc/lispref/parsing.texi (User-defined Things): Fix wording.
2025-01-14 14:49:27 +02:00
Martin Rudalics
d4aeb6bd23 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'.
2025-01-14 09:51:17 +01:00
Eshel Yaron
0226d35794
; (completion-preview--bg-color): Fix bug#75544.
* lisp/completion-preview.el (completion-preview--bg-color):
Fix loop check.
2025-01-14 07:40:57 +01:00
Stefan Kangas
e6ad99e36c src/comp.c: New macro CALLNI
* src/comp.c (CALL0I, CALL1I, CALL2I, CALL4I): Delete macros.
(CALLNI): New macro, replacing the above.  All callers updated.
2025-01-14 00:48:07 +01:00
Stefan Kangas
383de5c3f6 Prefer calln to CALLN where applicable
* src/callint.c (read_file_name):
* src/comp.c (CALL0I, CALL1I, CALL2I, CALL4I, declare_imported_func):
* src/data.c (Ffset, notify_variable_watchers):
* src/eval.c (Ffuncall_with_delayed_message):
* src/keymap.c (Fdescribe_buffer_bindings):
* src/minibuf.c (Fread_buffer, Fcompleting_read):
* src/pdumper.c (Fdump_emacs_portable):
* src/print.c (print_vectorlike_unreadable):
* src/treesit.c (treesit_traverse_match_predicate)
(treesit_build_sparse_tree): Prefer calln to CALLN.
2025-01-14 00:16:40 +01:00
Yuan Fu
f0e63558bd
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.
2025-01-12 23:41:47 -08:00
Yuan Fu
4687fff4f0
; Move c-ts-mode keyword variables forward
* lisp/progmodes/c-ts-mode.el (c-ts-mode--type-keywords):
(c-ts-mode--operators):
(c-ts-mode--c++-operators):
(c-ts-mode--c++-operator-keywords): Move before
c-ts-mode--keywords to avoid undefined variable error.
2025-01-12 23:38:24 -08:00
Yuan Fu
8cfa3447b7
Add special indent rule for FOR_EACH_TAIL in c-ts-mode
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--emacs-macro-rules): New function
(c-ts-mode--simple-indent-rules): Add new rule.
2025-01-12 23:03:41 -08:00
Yuan Fu
04032cd00a
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.
2025-01-12 22:23:36 -08:00
Yuan Fu
7d3bc1ff2f
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.
2025-01-12 21:27:41 -08:00
Stephen Gildea
e6591b549f New symbol property 'definition-type' used by 'find-function'.
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol):
Look for new property 'definition-type' on the symbol.
* doc/lispref/symbols.texi (Standard Properties): Add 'Definition-type'.
* doc/lispref/functions.texi (Defining Functions):
* doc/lispref/tips.texi (Coding Conventions):
* doc/misc/ert.texi (How to Write Tests):
Add cross reference to new property 'definition-type'.
* etc/NEWS: Announce new symbol property 'definition-type'.

Thanks to Eli Zaretskii for reviewing this change.
2025-01-12 20:39:02 -08:00
Stephen Gildea
c98d9e8bf5 Lisp Reference Manual: Index standard symbol properties.
* doc/lispref/symbols.texi (Standard Properties):
* doc/lispref/commands.texi:
* doc/lispref/customize.texi (Variable Definitions):
* doc/lispref/help.texi:
* doc/lispref/keymaps.texi:
* doc/lispref/minibuf.texi (Minibuffer History):
* doc/lispref/modes.texi (Setting Hooks):
* doc/lispref/sequences.texi (Char-Tables):
* doc/lispref/text.texi (Undo):
* doc/lispref/variables.texi: Each standard symbol property has exactly
one index entry, uniformly formatted as "(symbol property)".
2025-01-12 20:16:00 -08:00
Roland Winkler
615f06ea53 fix for bibtex.el in prior commit
* lisp/textmodes/bibtex.el (bibtex-string-file-path)
(bibtex-file-path): Check for undefined environment variable
BIBINPUTS.
2025-01-12 18:43:16 -06:00
Stefan Kangas
ccd927d741 Use eabs in Fcurrent_time_zone
* src/timefns.c (Fcurrent_time_zone): Use eabs.
* test/src/timefns-tests.el
(timefns-tests-current-time-zone): New test.
2025-01-13 01:05:42 +01:00
Stefan Kangas
85c73bb901 Delete obsolete coccinelle files
These files relates to a 13 year old attempt at a generational GC that
was never merged.

* admin/coccinelle/frame.cocci:
* admin/coccinelle/window.cocci: Delete files.
2025-01-13 01:05:42 +01:00
Roland Winkler
14b5ba7c61 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.
2025-01-12 15:17:28 -06:00
Mauro Aranda
99b85e116f 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)
2025-01-12 15:19:40 -03:00
Juri Linkov
2d2bc6f1bc 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).
2025-01-12 20:17:16 +02:00
Pranshu Sharma
7648faedd3 Add new option 'rotate-windows-change-selected'
* lisp/window-x.el: Fix header information.
(rotate-windows-change-selected): New option.
(rotate-window-layout-counterclockwise)
(rotate-window-layout-clockwise): Fix doc-strings.
(rotate-windows): Handle 'rotate-windows-change-selected'.
2025-01-12 18:45:30 +01:00
Eshel Yaron
7dcc7605d5
; Touch-ups for new window-x.el
Discussion:
https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg00322.html

* lisp/window-x.el: Autoload commands, provide feature.
(window-tree-normal-sizes): Improve docstring.
(window--window-to-transpose): Remove.
(window--rotate-interactive-arg): New function.
(rotate-window-layout-anticlockwise): Rename to...
(rotate-window-layout-counterclockwise): ...this.
(rotate-window-layout-clockwise)
(flip-window-layout-horizontally)
(flip-window-layout-vertically, transpose-window-layout)
(rotate-windows-back, rotate-windows, window--transpose)
(window--transpose-1): Cosmetics.
2025-01-12 12:02:32 +01:00
Gerd Möllmann
d00de6f166 ; Add some niceties to .lldbinit
* src/.lldbinit: Handle some signals for tty Emacs.
New commands xreload and xattach. Common breakpoints.
2025-01-12 08:46:28 +01:00