* lisp/sqlite-mode.el: (sqlite-mode-list-tables)
(sqlite-mode-list-columns, sqlite--mode--list-data)
(sqlite-mode-delete): Quote identifiers (table and column
names) in the SQL queries. Fixes, e.g., opening databases
which have a table called "values". (Bug#75598)
Gerd Möllmann [Sat, 25 Jan 2025 06:54:56 +0000 (07:54 +0100)]
Multi-tty: selected frame can be a GUI frame
* src/dispnew.c (frame_selected_window_frame): New function.
(is_cursor_obscured): Use it.
(terminal_cursor_magic): Use the frame of the selected window of he root
frame.
(combine_updates_for_frame): Move Android conditional compilation out.
Gerd Möllmann [Sat, 25 Jan 2025 06:33:45 +0000 (07:33 +0100)]
Fix mouse position handling for nested tty child frames
* src/dispnew.c (child_xy): New function.
* src/dispextern.h: Declare it.
* src/term.c (tty_frame_at): Return child-relative (x, y) in output
parameters.
(Ftty_frame_at): Return a list (FRAME CHILD-X CHILD-Y).
(handle_one_term_event): Adapt use of tty_frame_at.
* lisp/xt-mouse.el (xterm-mouse-event): Use new tty-frame-at.
Gerd Möllmann [Sat, 25 Jan 2025 04:33:13 +0000 (05:33 +0100)]
Simplify absolute (x, y) computation on ttys
* src/dispnew.c (root_xy): New function.
(frame_pos_abs): Removed.
(frame_rect_abs, abs_cursor_pos): Use root_xy.
* src/dispextern.h: Declare root_xy.
* src/term.c (mouse_get_xy): Use it.
Stephen Gildea [Fri, 24 Jan 2025 18:12:58 +0000 (10:12 -0800)]
; time-stamp: Rename some internal symbols
* lisp/time-stamp.el: (time-stamp-string-preprocess): Rename 'alt-form'
to 'colon-cnt' because it is now an integer.
* test/lisp/time-stamp-tests.el: Rename 'formatz-generate-tests' to
'define-formatz-tests'.
Gerd Möllmann [Fri, 24 Jan 2025 10:18:54 +0000 (11:18 +0100)]
Disable more redisplay optimizations when child frames are visible
* src/xdisp.c (redisplay_internal): Disable more optimizations
on a tty root frame displaying a child frame.
(try_cursor_movement,(try_window_reusing_current_matrix)
(try_window_id): Don't use on tty root frames displaying a child frame.
Stefan Kangas [Thu, 23 Jan 2025 23:16:08 +0000 (00:16 +0100)]
Don't use negative positions for docstrings
These were used for user-variables (doc starts with a '*'), but we don't
use that convention any more. On my machine, there are no docstrings
starting with a '*' in etc/DOC.
* src/doc.c (Fsnarf_documentation): Never use negative positions.
(get_doc_string): Don't use eabs; position must now be positive, and all
callers are verified to do that.
Stefan Kangas [Thu, 23 Jan 2025 17:45:14 +0000 (18:45 +0100)]
Simplify Fdocumentation and Fdocumentation_property
* src/doc.c (Fdocumentation, Fdocumentation_property): Simplify;
reread_doc_file always returns true so just assume that.
(reread_doc_file): Change return type to void.
F. Jason Park [Tue, 21 Jan 2025 00:32:53 +0000 (16:32 -0800)]
Reuse client cert for connectivity probing in ERC
* lisp/erc/erc-backend.el (erc--server-connect-function)
(erc--server-post-dial-function): Rename former to latter because the
existing name is better suited for the eventual generalizing of
`erc-server-connect' in a future version.
(erc-server-connect): Use new name for `erc--server-connect-function',
`erc--server-post-dial-function'.
(erc--recon-probe-reschedule, erc--recon-probe-sentinel)
(erc--recon-probe-filter, erc--recon-probe-check): New functions
factored out of `erc-server-delayed-check-reconnect'.
(erc-server-delayed-check-reconnect): Refactor, splitting off lambdas
into top-level functions for improved tracing.
* lisp/erc/erc.el (erc-message-english-recon-probe-hung-up)
(erc-message-english-recon-probe-nobody-home): New
variables. (Bug#62044)
Thanks to Libera.Chat user arjan for reporting this bug, which
is new in ERC 5.6 and Emacs 30.1.
João Távora [Wed, 22 Jan 2025 22:25:03 +0000 (22:25 +0000)]
Eglot: unbreak a rarely run test
* test/lisp/progmodes/eglot-tests.el
(eglot-test-snippet-completions-with-company): Don't expect fooba to be
there, do expect two completions to be candidates.
João Távora [Wed, 22 Jan 2025 21:52:56 +0000 (21:52 +0000)]
Eglot: unbreak completion in Emacs 26.3 (at least)
For reasons yet to be investigated, in some Emacs older versions,
callers of the completion table created by eglot-completion-at-point
will destroy text properties in the strings returned by the
"all-completions" call (destroy here means completely erase). This
completely breaks Eglot completion.
(eglot-completion-at-point): Copy substrings in all-completions
call.
João Távora [Wed, 22 Jan 2025 21:43:10 +0000 (21:43 +0000)]
Eglot: abandon compat.el
After period of months using this to help compatibility to older Emacs
versions. It's not really buying us that much and complicates
maintenance, so it gets the axe.
A common problem is the compatibility alias for require-with-check,
which often errors with some "Feature X loaded from Y is now provided by
Z". The tests for Emacs 26.3 were all failing in the Github tracker
ever since this (and track-changes.el) were added to Eglot.
* lisp/progmodes/eglot.el (compat): No longer require.
(eglot-alternatives): Reword comment.
(eglot-alternatives): Call eglot--executable-find.
(eglot--guess-contact): Call eglot--executable-find.
(eglot--connect): Check if package-get-version exists.
(eglot--format): Check if substitute-quotes exists.
(eglot--format-markup): Check if text-property-search exists.
João Távora [Wed, 22 Jan 2025 15:44:41 +0000 (15:44 +0000)]
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.
Stefan Kangas [Wed, 22 Jan 2025 22:42:13 +0000 (23:42 +0100)]
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.
Paul Eggert [Wed, 22 Jan 2025 19:03:08 +0000 (11:03 -0800)]
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.
Paul Eggert [Wed, 22 Jan 2025 06:18:17 +0000 (22:18 -0800)]
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.
Paul Eggert [Wed, 22 Jan 2025 06:16:22 +0000 (22:16 -0800)]
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.)
Pip Cet [Tue, 21 Jan 2025 18:55:01 +0000 (18:55 +0000)]
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.
Gerd Möllmann [Tue, 21 Jan 2025 17:31:10 +0000 (18:31 +0100)]
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.
Gerd Möllmann [Mon, 20 Jan 2025 17:11:58 +0000 (18:11 +0100)]
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.
* 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.
João Távora [Mon, 20 Jan 2025 17:23:08 +0000 (17:23 +0000)]
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.
Tassilo Horn [Mon, 20 Jan 2025 15:21:24 +0000 (16:21 +0100)]
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.
Yuan Fu [Mon, 20 Jan 2025 06:34:11 +0000 (22:34 -0800)]
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.
Stefan Kangas [Mon, 20 Jan 2025 00:55:19 +0000 (01:55 +0100)]
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 2b5701247845, 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.