1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00
Commit graph

176923 commits

Author SHA1 Message Date
Gerd Möllmann
0b079e1e23 Fix emba igc-tests
* configure.ac (HAVE_MPS): AC_SUBST it.
* test/Makefile.in (HAVE_MPS): New, AC_SUBSTed. Handle case of non-MPS
and MPS build.
* test/src/igc-tests.el (set-commit-limit-test): Add tag :igc.
2025-01-17 11:53:57 +01:00
Gerd Möllmann
9c062a282a * src/igc.c (igc_const_cast): Remove #definition in if 0. 2025-01-17 04:29:24 +01:00
Eli Zaretskii
02ab050874 ; Avoid compilation warnings about uninitialized variables
* src/igc.c (fix_weak_hash_table_strong_part)
(fix_weak_hash_table_weak_part)
(igc_alloc_weak_hash_table_strong_part)
(igc_alloc_weak_hash_table_weak_part): Shut up compiler warnings.
2025-01-16 10:38:08 +02:00
Stefan Kangas
de864e4f3b Remove DEFVAR_LISP_NOPRO when HAVE_MPS
* src/lisp.h [HAVE_MPS] (DEFVAR_LISP_NOPRO): Make into alias for
DEFVAR_LISP.  (Bug#75521)
2025-01-15 20:44:59 +01:00
Gerd Möllmann
86ffcf2347 ; * src/igc.c (gc_init_header): Make switch exhaustive. 2025-01-15 09:28:49 +01:00
Gerd Möllmann
528f711406 Merge branch 'master' into scratch/igc 2025-01-15 09:14:06 +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
Gerd Möllmann
92ccf1c753 ; * src/igc.c (scan_ambig): Make switch exhaustive. 2025-01-13 07:22:52 +01: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
00f830f54e Use exhaustive switches for hash_table_weakness_t
Thanks to -Wswitch, we now get a warning if we forget to update any of
these locations when hash_table_weakness_t changes.

* src/igc.c (fix_weak_hash_table_strong_part)
(fix_weak_hash_table_weak_part, igc_alloc_weak_hash_table_strong_part)
(igc_alloc_weak_hash_table_weak_part): Use exhaustive switches.
2025-01-13 01:27:09 +01: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
Stefan Kangas
71f5ac2357 Delete unused macro DEFVAR_LISP_NOPROX
* src/lisp.h (DEFVAR_LISP_NOPROX): Delete unused macro.
2025-01-12 18:53:41 +01:00
Stefan Kangas
5490d3e6d7 ; Fix indentation in lisp.h
* src/lisp.h (DEFVAR_LISP_NOPROX, DEFVAR_LISP_NOPRO): Fix
indentation.
2025-01-12 18:50:11 +01: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
Stefan Kangas
a24380324d Remove inhibit_garbage_collection when HAVE_MPS
This function call does nothing to stop GC with MPS.  Remove it to save
a few nanoseconds, and, more importantly, for documentation purposes.

* src/alloc.c [HAVE_MPS] (allow_garbage_collection)
(inhibit_garbage_collection): Remove function definitions.
* src/lisp.h [HAVE_MPS] (inhibit_garbage_collection): Don't declare.
* src/alloc.c [HAVE_MPS] (garbage_collect):
* src/eval.c [HAVE_MPS] (probably_quit):
* src/fns.c [HAVE_MPS] (hash_table_user_defined_call):
* src/nsmenu.m [HAVE_MPS] (ns_menu_show):
* src/term.c [HAVE_MPS] (tty_menu_show):
* src/undo.c [HAVE_MPS] (truncate_undo_list):
* src/xdisp.c [HAVE_MPS] (display_echo_area, decode_mode_spec):
* src/xmenu.c [HAVE_MPS] (x_menu_show): Don't call
inhibit_garbage_collection.
Ref: https://lists.gnu.org/r/emacs-devel/2025-01/msg00362.html
2025-01-12 15:49:47 +01:00
Gerd Möllmann
573dbff123 Add storing igc stats in SQLite
* lisp/emacs-lisp/igc.el (toplevel): Require sqlite.
(igc--sqlite): New var containing SQLite database.
(igc-stop-collecting-stats): Handle sqlite case.
(igc-stats-time-format): Change to include milliseconds.
(igc--collect-stats-csv): Renamed from igc--collection-stats.
(igc--collect-stats-sqlite):New function inserting into DB.
(igc--open-sqlite): New function.
(igc-start-collecting-stats): Allow choosing CSV or SQLite.
2025-01-12 14:33:00 +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
Stefan Kangas
b82707d70f Delete admin/IGC-TODO
According to Gerd, everything in this file is done already, so the file
can be deleted.  We might create a new Org file to keep track of TODOs
instead.

* admin/IGC-TODO: Delete file.
Ref: https://lists.gnu.org/r/emacs-devel/2025-01/msg00358.html
2025-01-12 11:26:58 +01:00
Stefan Kangas
af9ce73c0c Fix building IGC with ASan
Build failures were observed on macOS 15.2.  With this patch, the ASan
build works if you set `ulimit -s unlimited` first.

* src/igc.c (scan_ambig): Use ATTRIBUTE_NO_SANITIZE_ADDRESS.
(Bug#75482)
2025-01-12 11:21:18 +01:00
Stefan Kangas
de2089fbba * admin/igc.org: Minor copy edits. 2025-01-12 10:49:34 +01:00
Stefan Kangas
5724d87f57 * src/igc.c: Add introductory comment pointing to igc.org. 2025-01-12 09:34:43 +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
Juri Linkov
54e4b30503 * lisp/treesit.el: Fix 'treesit--explorer-tree-mode-map'.
(treesit--explorer-tree-mode-map): Move this map
before its mode 'treesit--explorer-tree-mode',
otherwise the map has no effect.
2025-01-12 09:39:36 +02:00
Eli Zaretskii
412c1a4f0e ; * src/keymap.c: Fix last change (bug#75219). 2025-01-12 08:24:39 +02:00
Eli Zaretskii
c41ea047a4 Fix mouse-2 clicks on mode line and header line
* src/keymap.c (Fcurrent_active_maps): For clicks on mode-line and
header-line, always override the keymaps at buffer position.
(Bug#75219)
2025-01-12 08:22:24 +02:00
Daniel Colascione
6cea3233a1 Align term-mode control character handling
Terminal emulators generally ignore exotic ASCII control
characters like SOH and STX. Make term-mode do the same.

* lisp/term.el (term-emulate-terminal): ignore ASCII control
characters like other terminal emulators do
2025-01-11 14:36:22 -08:00
Jim Porter
aff9261ab2 Make Eshell's "ls" command return a non-zero status on errors
* lisp/eshell/em-ls.el (eshell/ls): Set exit code when calling 'error-func'.
2025-01-11 11:50:19 -08:00
Juri Linkov
3d375ced1f ; * src/term.c (term_mouse_position): Fix 'fp' pointer. 2025-01-11 20:40:11 +02:00
Juri Linkov
db4bf410f2 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.
2025-01-11 20:28:43 +02:00