Commit graph

176443 commits

Author SHA1 Message Date
João Távora
ac902ddadc Eglot: abandon track-changes.el
After a ~10 month period of using track-changes.el as a support library
for tracking buffer changes, I've decided to go back to manually using
after-change-functions and before-change-functions.

track-changes.el showed promise:

- One of the selling points was to turn complicated a-c-functions and
  b-c-functions into something easier, but that objectively didn't pan
  out, with "virtual" positions, one-shot hooks, and tracker
  registrations being abstractions and complications mastered by very
  few.

- The other selling point was the ability to log and detect those parts
  of Emacs that cheat the modification hooks and correct them.  As far
  as I can tell, only one such cheater -- quail.el -- was identified.
  But with little consequence, only an ugly workaround in eglot.el (now
  removed).

- After using Eglot daily for all this time, I didn't notice any
  decrease in desynchronization events.

- I did notice an increase in track-changes.el related bugs, some of
  which still baffle me and and hard to reproduce.  A common occurence
  is the '(cl-assertion-failed (memq id track-changes--trackers))'
  which is hard to track down.

- The library makes it more complicated to run Eglot on older Emacsen.

I might yet revisit this matter for the next version but this
experience has shown that it didn't bring the advantages I thought it
would, so I'm abandoning it until at least 1.19 is out.

* lisp/progmodes/eglot.el (track-changes): No longer require.
(eglot--virtual-pos-to-lsp-position): Delete.
(eglot--managed-mode): Simplify.
(eglot--track-changes): Delete this variable.
(eglot--recent-changes): Reword doc.
(eglot--before-change, eglot--after-change): Bring back.
(eglot--track-changes-fetch): Delete.
(eglot--add-one-shot-hook): Delete.
(eglot--track-changes-signal): Delete.
2025-01-22 23:02:35 +00:00
Stefan Kangas
d3ada49a37 Minor image_error related cleanups
* src/image.c (image_create_x_image_and_pixmap_1): Avoid temporary
variable by passing the value directly to image_error.
(tiff_handler): Prefer image_error to add_to_log for local
consistency.
2025-01-22 23:42:13 +01:00
Pip Cet
bf55eb1a8a ; * src/pdumper.c (dump_hash_table): Adjust hash; bitfields changed. 2025-01-22 19:50:31 +00:00
Paul Eggert
34166dcf9c Port allows-stdout test to overly-suspicious bwrap
* test/src/emacs-tests.el (emacs-tests/bwrap/allows-stdout):
Skip test if bwrap prohibits even "echo Hi",
which it does on my Ubuntu 24.10 platform.
This extra check means we no longer need to test
separately whether the filter is readable.
2025-01-22 11:04:57 -08:00
Paul Eggert
2efffbe773 Don’t silently truncate connection-lost diagnostic
* src/xterm.c (x_io_error_quitter): Do not silently truncate
the diagnostic when a connection is lost to an X server.
2025-01-21 22:31:00 -08:00
Paul Eggert
db9ea9b77a Check for snprintf truncation in pgtkterm
* src/pgtkterm.c (pgtk_enumerate_devices):
Abort if snprintf truncated.
2025-01-21 22:31:00 -08:00
Paul Eggert
4a25ed300f Port pdumper to unlikely long sprintf output
* src/pdumper.c (dump_ptr_referrer): Port to platforms
where sprintf %p generates absurdly long output.
(dump_vectorlike): Port to hypothetical platforms
where %d generates absurdly long output.
2025-01-21 22:31:00 -08:00
Paul Eggert
8ff7338fdd When debugging image.c, abort if silent truncation
* src/image.c (image_build_heuristic_mask, png_load_body):
Abort if snprintf truncated.  (If truncation is not possible
here we should use sprintf instead, as that simplifies
automatic runtime checking.)
2025-01-21 22:31:00 -08:00
Pip Cet
6ea1e03fe7 Destroy GTK tool bar widget if it was never attached (bug#75636)
* src/gtkutil.c (xg_free_frame_widgets): Call gtk_widget_destroy on an
unpacked toolbar widget.
2025-01-22 00:59:06 +00:00
Stefan Kangas
cdcfffd50a Prefer snprintf to sprintf in image.c
* src/image.c (image_background, image_build_heuristic_mask)
(png_load_body): Prefer snprintf to sprintf.
2025-01-22 00:49:50 +01:00
Stefan Kangas
5f108cb663 Delete some duplicate face attributes
* etc/themes/leuven-dark-theme.el:
* etc/themes/leuven-theme.el:
* etc/themes/manoj-dark-theme.el: Delete duplicate face attributes.
2025-01-21 21:46:54 +01:00
Gerd Möllmann
d30f40868b Improve copying current glyphs when building frame matrix
* src/dispnew.c (build_frame_matrix_from_leaf_window): Don't make space
glyphs. More comments.
2025-01-21 20:43:17 +01:00
Eli Zaretskii
ce50a1d3c1 ; * src/w32.c (w32_memory_info): Fix coding style of last change. 2025-01-21 21:25:15 +02:00
Arthur Miller
58d3d4820a Fix bug in w32_memory_info
* src/w32.c (w32_memory_info): Initialize struct size.
2025-01-21 21:22:58 +02:00
Pip Cet
1f02677500 ; * src/gtkutil.c (free_frame_tool_bar): Remove redundant assignment. 2025-01-21 19:13:24 +00:00
Pip Cet
d7bdaa4170 Handle unknown units provided by the rsvg library (bug#75712)
* src/image.c (svg_css_length_to_pixels): Restructure so GCC warns
about new enum members.  Add case for RSVG_UNIT_CH.  Warn about
unknown units discovered at runtime.
2025-01-21 19:04:11 +00:00
Gerd Möllmann
0fd5b2d146 Don't use a redisplay optimization in a certain case on ttys
* src/dispnew.c (is_tty_root_frame_with_visible_child): New function.
* src/dispextern.h: Declare it.
* src/xdisp.c (redisplay_internal): Don't use optimization 1 for tty root
frames with a visible child frame.
2025-01-21 19:31:53 +01:00
Gerd Möllmann
eaa79e25a6 Remove a false #ifdef HAVE_WINDOW_SYSTEM
* src/xdiso.c (update_tab_bar)_ Don't use #ifdef HAVE_WINDOW_SYSTEM for
setting the selected frame. That only makes a build without window
system misbehave.
2025-01-21 19:30:54 +01:00
Robert Pluim
14e686e6cc Signal error when keyword/arg list is malformed
* src/data.c (syms_of_data): Add Qmalformed_keyword_arg_list
error symbol.

* src/process.c (Fmake_process, Fmake_pipe_process)
(Fserial_process_configure, Fmake_serial_process)
(Fmake_network_process): Signal Qmalformed_keyword_arg_list when
the argument list length is odd.
* src/sound.c (parse_sound): Also here..
* src/w32fns.c (Fw32_notification_notify): ..and here.

(Bug#75584)
2025-01-21 17:41:35 +01:00
Eli Zaretskii
7738641205 Avoid crashes in redisplay due to problematic font setups
* src/xdisp.c (handle_single_display_spec)
(produce_stretch_glyph): Avoid crashes if a face's font is NULL.
(Bug#75725)
2025-01-21 14:24:57 +02:00
Stefan Kangas
64d314e0f6 Prefer defface's ':slant italic' to obsolete alias ':italic t'
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/modus-themes.el (modus-themes-faces):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/modus-themes.el (modus-themes-faces):
* lisp/emacs-lisp/eieio-custom.el (eieio-custom-slot-tag-face):
* lisp/gnus/gnus-art.el (gnus-emphasis-italic)
(gnus-emphasis-underline-italic, gnus-emphasis-bold-italic)
(gnus-emphasis-underline-bold-italic, gnus-signature)
(gnus-header-from, gnus-header-subject, gnus-header-newsgroups)
(gnus-header-content):
* lisp/gnus/gnus-cite.el (gnus-cite-attribution, gnus-cite-1)
(gnus-cite-2, gnus-cite-3, gnus-cite-4, gnus-cite-5, gnus-cite-6)
(gnus-cite-7, gnus-cite-8, gnus-cite-9, gnus-cite-10, gnus-cite-11):
* lisp/gnus/gnus-srvr.el (gnus-server-cloud-host)
(gnus-server-closed):
* lisp/gnus/gnus.el (gnus-group-mail-1-empty)
(gnus-group-mail-2-empty, gnus-summary-low-ticked)
(gnus-summary-low-ancient, gnus-summary-low-undownloaded)
(gnus-summary-low-unread, gnus-summary-low-read):
* lisp/gnus/message.el (message-header-to)
(message-header-newsgroups, message-header-other):
* lisp/gnus/mm-decode.el (mm-command-output):
* lisp/mh-e/mh-e.el (mh-face-data, mh-folder-body):
* lisp/net/dictionary.el (dictionary-word-entry-face):
* lisp/org/org-faces.el (org-formula, org-agenda-date-today)
(org-scheduled, org-scheduled-today):
* lisp/proced.el (proced-interruptible-sleep-status-code):
* lisp/progmodes/prolog.el (prolog-font-lock-keywords):
* lisp/progmodes/verilog-mode.el (verilog-font-lock-translate-off-face)
(verilog-font-lock-p1800-face, verilog-font-lock-ams-face)
(verilog-font-lock-grouping-keywords-face):
* lisp/progmodes/vhdl-mode.el (vhdl-font-lock-attribute-face)
(vhdl-font-lock-enumvalue-face, vhdl-font-lock-function-face)
(vhdl-font-lock-directive-face):
* lisp/transient.el (transient-inapt-suffix):
* lisp/vc/ediff-init.el (ediff-even-diff-A, ediff-even-diff-B)
(ediff-even-diff-C, ediff-even-diff-Ancestor, ediff-odd-diff-A)
(ediff-odd-diff-B, ediff-odd-diff-C, ediff-odd-diff-Ancestor):
Prefer defface attribute ':slant italic' to its obsolete alias
':italic t'.  See also Bug#73552.
2025-01-21 09:56:59 +01:00
Stefan Kangas
375befcacc Prefer defface's ':weight bold' to obsolete alias ':bold t'
* etc/themes/adwaita-theme.el (adwaita):
* etc/themes/manoj-dark-theme.el (manoj-dark):
* etc/themes/modus-themes.el (modus-themes-faces):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-denied, gnus-server-offline):
* lisp/gnus/gnus.el (gnus-group-news-1, gnus-group-news-2)
(gnus-group-news-3, gnus-group-news-4, gnus-group-news-5)
(gnus-group-news-6, gnus-group-news-low, gnus-group-mail-1)
(gnus-group-mail-2, gnus-group-mail-3, gnus-group-mail-low-empty)
(gnus-group-mail-low, gnus-summary-high-ticked)
(gnus-summary-high-ancient, gnus-summary-high-undownloaded)
(gnus-summary-high-unread, gnus-summary-high-read):
* lisp/gnus/message.el (message-header-to, message-header-cc)
(message-header-subject, message-header-newsgroups)
(message-header-other, message-header-name, message-header-xheader)
(message-separator, message-cited-text-1, message-cited-text-2)
(message-cited-text-3, message-cited-text-4, message-mml)
(message-signature-separator):
* lisp/mh-e/mh-e.el (mh-face-data, mh-folder-cur-msg-number)
(mh-speedbar-folder-with-unseen-messages)
(mh-speedbar-selected-folder-with-unseen-messages):
* lisp/net/dictionary.el (dictionary-button-face):
* lisp/org/org-faces.el (org-drawer, org-tag, org-list-dt, org-todo)
(org-done, org-headline-todo, org-formula, org-agenda-structure)
(org-scheduled, org-scheduled-today, org-scheduled-previously)
(org-upcoming-deadline):
* lisp/proced.el (proced-uninterruptible-sleep-status-code)
(proced-executable, proced-cpu, proced-user, proced-time-colon):
* lisp/progmodes/erts-mode.el (erts-mode-specification-name)
(erts-mode-specification-value):
* lisp/progmodes/prolog.el (prolog-font-lock-keywords):
* lisp/progmodes/verilog-mode.el (verilog-font-lock-p1800-face)
(verilog-font-lock-ams-face)
(verilog-font-lock-grouping-keywords-face):
* lisp/progmodes/vhdl-mode.el (vhdl-font-lock-prompt-face)
(vhdl-font-lock-attribute-face, vhdl-font-lock-enumvalue-face)
(vhdl-font-lock-function-face, vhdl-font-lock-directive-face)
(vhdl-font-lock-reserved-words-face): Prefer defface attribute
':weight bold' to its obsolete alias ':bold t'.  See also Bug#73552.
2025-01-21 09:29:09 +01:00
João Távora
49f449bb5b Eglot: release version 1.18
* etc/EGLOT-NEWS: Update.

* lisp/progmodes/eglot.el (Version): Bump to 1.18
2025-01-20 21:44:45 +00:00
João Távora
aa94e1c56c Eglot: fix signature's of Eglot's ElDoc functions
These functions are specified to be passed at least one
argument, so our implementation must accept an arbitrary number
of arguments.

* lisp/progmodes/eglot.el (eglot-signature-eldoc-function)
(eglot-hover-eldoc-function): Fix signature.
2025-01-20 19:21:29 +00:00
João Távora
1143cf09a3 Eglot: add support for insertReplaceEdit (bug#73857)
* lisp/progmodes/eglot.el (eglot-server-programs): Mention zig-ts-mode.
(eglot--lsp-interface-alist): Describe 'InsertReplaceEdit'.
(eglot-client-capabilities): Advertise 'insertReplaceSupport'.
(eglot-completion-at-point): Consider 'InsertReplaceEdit'.
(eglot--apply-text-edits): Consider 'InsertReplaceEdit'.

* test/lisp/progmodes/eglot-tests.el
(eglot-test-zig-insert-replace-completion): New test.

Special thanks to kcbanner@gmail.com
2025-01-20 18:58:05 +00:00
João Távora
a1ce633ca9 Eglot: make eglot-test-javascript-basic more robust
* test/lisp/progmodes/eglot-tests.el
(eglot-test-javascript-basic): Mark test expensive and increase timeout.
2025-01-20 17:43:35 +00:00
João Távora
73f51f3a99 Eglot: try again to fix try-completion logic
Emacs partial completion simply doesn't make sense in LSP.
Attempts to make it make some sense end up failing for one
reason or another.

This commit restores the original intention of the
eglot--dumb-allc and eglot--dumb-tryc functions, which was to be
dumb and pop up a *Completions* buffer (or a company tooltip),
as soon as there is doubt over what the user wants to do.

It also fixes tests, including an expensive Rust test that had
been broken for a long time.

* lisp/progmodes/eglot.el (eglot--dumb-allc): Consider point.
(eglot--dumb-tryc): Make it suitably dumb again.

* test/lisp/progmodes/eglot-tests.el
(eglot--wait-for-rust-analyzer): Wait longer.
(eglot-test-common-prefix-completion): Delete this test.  It's not
the intended behavior.
(eglot--kill-completions-buffer): New helper.
(eglot-test-try-completion-nomatch): Rework test.
(eglot-test-try-completion-inside-symbol): Pops *Completions*
buffer because mustn't partial complete.
(eglot-test-try-completion-inside-symbol-2): Does complete.
(eglot-test-rust-completion-exit-function): Fix long-broken test.
2025-01-20 17:43:35 +00:00
Stefan Kangas
275df7420c Prefer defvar-keymap in bat-mode.el
* lisp/progmodes/bat-mode.el (bat-mode-map): Prefer defvar-keymap.
(bat-menu): Move to top level.
2025-01-20 18:32:33 +01:00
Tassilo Horn
40d5ff01e5 Don't skip or double-process files in dired with auto-revert-mode (bug#75626)
* lisp/dired.el (dired--inhibit-auto-revert): New variable.
(dired-map-over-marks): Make the generated code bind it.
(dired-buffer-stale-p): Return nil if dired--inhibit-auto-revert is
non-nil.
2025-01-20 17:54:02 +01:00
Robert Pluim
0e3687e600 Improve 'key-valid-p' docstring
* lisp/keymap.el (key-valid-p): Add "RET", "<return>", and "C-m"
examples.

(Bug#75586)
2025-01-20 17:26:11 +01:00
Stefan Kangas
b568ff418c Use 'max' macro in clip_to_bounds
* src/lisp.h (clip_to_bounds): Use 'max' macro.
2025-01-20 14:05:57 +01:00
Eli Zaretskii
ad51b3b391 ; Fix last change
* src/treesit.c (Ftreesit_parser_create): Fix comment wording.

* doc/lispref/parsing.texi (Using Parser): Fix wording and markup.
2025-01-20 14:39:20 +02:00
Yuan Fu
4581351556
Make treesit-language-remap-alist completely transparent (bug#72388)
* doc/lispref/parsing.texi (Using Parser): Update manual.
* src/treesit.c (Ftreesit_parser_create): Use the LANGUAGE
argument given as the language for the parser, not the actual
language.
2025-01-19 22:45:52 -08:00
Stefan Kangas
9093a0f824 pdumper: Add static_assert for EMACS_RELOC_TYPE_BITS
* src/pdumper.c: Add static_assert for EMACS_RELOC_TYPE_BITS.
2025-01-20 03:10:34 +01:00
Stefan Kangas
278d1994af Remove redundant case_Lisp_Int macro
The case_Lisp_Int macro was originally introduced with different
definitions depending on USE_2_TAGS_FOR_INTS.  However, since commit
2b57012478, we have assumed that USE_2_TAGS_FOR_INTS is always
defined, and the macro has only a single definition.  As a result, the
macro is now unnecessary, and replacing it with standard C case labels
improves readability and understanding.

* src/lisp.h (case_Lisp_Int): Delete macro.
* src/alloc.c (process_mark_stack, survives_gc_p):
* src/data.c (Fcl_type_of):
* src/fns.c (value_cmp, sxhash_obj):
* src/pdumper.c (dump_object):
* src/print.c (print_object):
* src/xfaces.c (face_attr_equal_p): Remove uses of above macro.
2025-01-20 02:14:08 +01:00
Paul Eggert
dcccb92562 Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h
* configure.ac (HAVE_SQLITE): Yes only if sqlite3.h can be
included (Bug#75667).
2025-01-19 16:23:27 -08:00
Paul Eggert
a94988c01d Port better to AIX 7.3 with -lz but not zlib.h
* configure.ac (HAVE_ZLIB, LIBZ):
Define only if zlib.h can be included (Bug#75667).
2025-01-19 16:23:27 -08:00
Stefan Kangas
4021b92403 Remove workaround for AIX 3.2 crashes
Emacs does not support AIX 3.2 since 2008.

This workaround for AIX 3.2.3 and 3.2.4 (released in 1992) was
introduced in 1999 and was only active with #ifdef AIX3_2.  In 2008, the
condition was changed to #ifdef AIX when support for these older AIX
versions was dropped. I couldn't find any justification for why this
workaround was retained (instead of being removed) in the commit message
or mailing list archives.

Given that users of AIX 4.0 (released in 1995) or later have not had
this workaround for over a decade (1999-2008), it seems safe to assume
that it is no longer necessary.  Removing it will also prevent the
incorrect overriding of the LANG variable on those systems.

* src/emacs.c [AIX] (main): Remove workaround for AIX 3.2.  (Bug#75153)
2025-01-19 18:09:36 +01:00
Stefan Kangas
c37aa3df9d Prefer the 'min'/'max' macros where possible
* src/composite.c (find_automatic_composition):
* src/lisp.h (clip_to_bounds):
* src/pgtkfns.c (PATH_MAX_LEN):
* src/profiler.c (approximate_median):
* src/unexmacosx.c (unexec_write_zero, unexec_copy, unexec_realloc):
* src/xdisp.c (get_nearby_bol_pos): Prefer the 'min' and 'max' macros.
2025-01-19 17:21:22 +01:00
Stefan Kangas
f3b57fa519 Delete duplicate 'min' macro
* src/gmalloc.c (min): Delete duplicate macro.  We import lisp.h
unconditionally, so it is always defined here.
2025-01-19 17:16:01 +01:00
Stefan Kangas
4106fd28c7 Make NSM warn for RSA key exchange on medium severity
* lisp/net/nsm.el (network-security-protocol-checks): Bump rsa-kx
severity to medium.
(nsm-protocol-check--dhe-kx): Update docstring to describe several more
recent attacks, and its removal in TLS 1.3.
2025-01-19 15:11:28 +01:00
Stefan Kangas
9878092d2b Minor copyedits in internals.texi
* doc/lispref/internals.texi (Writing Emacs Primitives): Minor
copyedits.
2025-01-19 14:30:31 +01:00
Stefan Kangas
4726900fdc Better document side-effect free and pure C functions
* doc/lispref/internals.texi (Writing Emacs Primitives):
Document that side-effect free and pure properties of C functions
are defined in byte-opt.el.
2025-01-19 14:30:31 +01:00
Stefan Kangas
6a0db0d80d Delete unused aliases for calln
* src/lisp.h (call1, call2, call3, call4)
(call5, call6, call7, call8): Delete unused aliases for calln.
2025-01-19 14:29:41 +01:00
Stefan Kangas
251e3d2654 Replace call[1-8] with calln
Since the introduction of the 'calln' macro, the 'call1', 'call2', ...,
'call8' macros are just aliases for the former.  This is slightly
misleading and potentially unhelpful.  The number of arguments N can
also easily go out-of-synch with the used alias callN.  There is no
reason not to replace these aliases with using 'calln' directly.

To reduce the risk for mistakes, the tool Coccinelle was used to make
these changes.  See <https://coccinelle.gitlabpages.inria.fr/website/>.

* src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c:
* src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c:
* src/chartab.c, src/cmds.c, src/coding.c, src/composite.c:
* src/data.c, src/dbusbind.c, src/dired.c, src/doc.c:
* src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c:
* src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c:
* src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c:
* src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c:
* src/pgtkselect.c, src/print.c, src/process.c, src/sort.c:
* src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c:
* src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c:
* src/xmenu.c, src/xselect.c, src/xterm.c:
Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
2025-01-19 14:29:41 +01:00
Stefan Kangas
7362f9f75d Document use of calln in C code in internals.texi
* doc/lispref/internals.texi
(Writing Emacs Primitives): Don't recommend `call0`, `call1`, etc.
Instead recommend `calln`, which covers all of those use cases.
2025-01-19 14:29:41 +01:00
Peter Seibel
2fd72a6ed3 Improved git-add completion
* lisp/pcmpl-git.el (pcomplete/git)): Complete untracked files.
(Bug#75336)

Copyright-paperwork-exempt: yes
2025-01-19 14:56:17 +02:00
Manuel Giraud
ba5360f700 Fix keybinding alignment in `tmm-menubar'
* lisp/tmm.el (tmm--shorten-space-width): New function that
reduces the space between the text menu entry and its keybinding
to avoid a misalignement.
(tmm-add-one-shortcut): Use it.  (Bug#75500)
2025-01-19 14:53:31 +02:00
Eli Zaretskii
be786ab3bb ; Fix autorevert-tests on MS-Windows
* test/lisp/autorevert-tests.el
(auto-revert-test04-auto-revert-mode-dired): Fix test on
MS-Windows.
2025-01-19 14:42:46 +02:00
Eli Zaretskii
f367b01f12 * src/fileio.c (Finsert_file_contents): Fix last change. 2025-01-19 14:20:18 +02:00