F. Jason Park [Wed, 5 Jun 2024 07:22:28 +0000 (00:22 -0700)]
Restore deferred date-stamp insertions in ERC
* lisp/erc/erc-stamp.el (erc-stamp--recover-on-reconnect): Treat
`erc-stamp--deferred-date-stamp' as a permanent-local variable.
(erc-stamp--date): Document expected possible values for `fn' slot.
(erc-stamp--defer-date-insertion-on-post-modify): Use the function
`ignore' to mean a new `erc-timer-hook' member has been requested.
Use nil to mean one has already run. Deferred date stamps are new in
ERC 5.6 and Emacs 30.
(erc-stamp--date-mode): Improve doc string.
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--date-mode/reconnect): New test.
Richard Sent [Mon, 27 May 2024 15:32:00 +0000 (11:32 -0400)]
Make 'clone-indirect-buffer-other-window' use other window
Previously, depending on the settings in 'display-buffer-alist',
'clone-indirect-buffer-other-window' would display the cloned
buffer in the original window, behaving identically to
'clone-indirect-buffer' with a non-nil display-flag. This
behavior was inconsistent with other-window commands which
always used another window.
Now, 'clone-indirect-buffer-other-window' uses
'switch-to-buffer-other-window'. This means it uses the same
logic as other-window commands like 'find-file-other-window'
and 'info-other-window'.
display-flag was kept for API stability and functional
compatibility reasons.
* lisp/simple.el: (clone-indirect-buffer-other-window): Use
switch-to-buffer-other-window. (Bug#70819)
Po Lu [Sat, 8 Jun 2024 07:17:23 +0000 (15:17 +0800)]
Improve scaling of tab bar items on high-density displays
* lisp/tab-bar.el (tab-bar-auto-width-max)
(tab-bar-auto-width-min): Accept values of a new format where
the pixel width is a list and is subject to scaling.
(tab-bar-auto-width-1): New function.
(tab-bar-auto-width): Scale pixel values from t-b-a-w-min and
t-b-a-w-max.
Eli Zaretskii [Fri, 7 Jun 2024 19:30:41 +0000 (22:30 +0300)]
Avoid crashes in half-baked emacsclient frames
If a client connection comes in while we handle a Lisp error,
the new frame creation could signal an error before the new
frame is ready for display.
* src/xdisp.c (redisplay_internal): Don't redisplay windows on
frames that were not completely set up. (Bug#71224)
Juri Linkov [Fri, 7 Jun 2024 16:57:07 +0000 (19:57 +0300)]
* lisp/buff-menu.el (Buffer-menu-group-sort-by): New defcustom.
(list-buffers--refresh): Use Buffer-menu-group-sort-by instead of the
hard-coded function (bug#70150).
(Buffer-menu-group-sort-alphabetically): New function as an option for
'Buffer-menu-group-sort-by'.
(list-buffers-noselect): Remove setting outline-minor-mode-use-buttons
to 'in-margins' that it not required for this feature to work correctly.
Po Lu [Fri, 7 Jun 2024 13:39:01 +0000 (21:39 +0800)]
Eliminate Makefile race
* java/Makefile.in (cf-stamp): Don't separately depend on
NDK_BUILD_SHARED, as this renders make liable to descend into
cross/ndk-build twice in different processes.
(clean): Don't remove nonexistent file.
Eli Zaretskii [Fri, 7 Jun 2024 13:34:53 +0000 (16:34 +0300)]
Unbreak the Cygw32 build
It was broken by latest changes to w32image.c.
* src/emacs.c (main): Call 'syms_of_w32image' and
'globals_of_w32image' only if native image APIs are enabled.
(Bug#71412)
Po Lu [Fri, 7 Jun 2024 12:38:56 +0000 (20:38 +0800)]
Document compilation of librsvg on Android
* java/INSTALL (LIBRSVG): New section.
(BUILDING WITH OLD NDK VERSIONS): Update recommended invocation
of configure in the case of a combined toolchain.
Yuan Fu [Sat, 1 Jun 2024 17:33:18 +0000 (10:33 -0700)]
Fix treesit-parse-string crash (bug#71012)
Parsing a large file with treesit-parse-string and then printing the
returned node crashes Emacs, because with-temp-buffer kills the temp
buffer when treesit-parse-string returns, and print.c tries to access
the node's position in the killed buffer.
* lisp/treesit.el (treesit-parse-string): Don't use with-temp-buffer.
Yuan Fu [Sat, 1 Jun 2024 17:20:48 +0000 (10:20 -0700)]
Check for buffer liveness when accessing tree-sitter node (bug#71012)
* src/treesit.h (treesit_node_buffer_live_p): Declare function.
* src/print.c (print_vectorlike): Print node without position if
buffer is killed.
* src/treesit.c (treesit_node_buffer_live_p): New function.
(treesit_check_node): Add buffer liveness check.
(syms_of_treesit): New error treesit-node-buffer-killed.
Arash Esbati [Wed, 5 Jun 2024 19:37:43 +0000 (21:37 +0200)]
Fix names of TeX-related major-modes
* lisp/ffap.el (ffap-alist, ffap-string-at-point-mode-alist): Add
entries for mode names introduced in AUCTeX v14. Use
`plain-tex-mode' for built-in mode. (bug#71376)
Juri Linkov [Fri, 7 Jun 2024 06:45:05 +0000 (09:45 +0300)]
* lisp/buff-menu.el: Mark all entries in outline.
(Buffer-menu-mark, Buffer-menu-unmark, Buffer-menu-delete)
(Buffer-menu-save): Mark all entries in the outline
when `outline-minor-mode' is enabled and point is
on the outline heading line (bug#70150).
(Buffer-menu-backup-unmark): Support outline heading lines.
João Távora [Thu, 6 Jun 2024 22:08:28 +0000 (17:08 -0500)]
Eglot: better fix for bug#70724
If the project's root is or destroyed , this may happen for a
variety of reasons, including reasons affecting non-reconnection
scenarios, so better to check in eglot--connect.
An Eglot "reconnection" has always created as accurate a copy of
the previous server object as possible, down to the 'eq'ness or
the saved initargs, language ids, etc. So re-querying for
projects is not the thing to do here.
A new different server can be created with `M-x eglot` which will
ask about shutting down the existing one.
* lisp/progmodes/eglot.el (eglot-reconnect): Revert previous change.
(eglot--connect): Do sanity check here
Kyle Meyer [Wed, 29 May 2024 04:05:46 +0000 (00:05 -0400)]
Enable code block evaluation when generating .org manuals
* doc/misc/Makefile.in ($(1:.org=.texi)): Enable code
block evaluation in Org mode manual and other .org manuals
to produce automatically generated parts. (Bug#71394)
When testing a scratch sync to the Emacs repo, the build
failed with
make[3]: Leaving directory '/home/kyle/src/savannah/emacs--master/lisp'
Evaluate this emacs-lisp code block on your system? (yes or no)
Error: end-of-file ("Error reading from stdin")
yes-or-no-p("Evaluate this emacs-lisp code block on your system? ")
That's expected given 715148131 (org-manual: Automatically
generate export option list, 2023-07-31) and the default
org-confirm-babel-evaluate value.
Javier Olaechea [Mon, 1 Apr 2024 04:07:10 +0000 (23:07 -0500)]
Add 'sqlite-execute-batch' command
This command is similar to 'sqlite-execute' except that it
executes multiple statements in exchange for not accepting
any arguments. (Bug#70145)
* src/sqlite.c (Fsqlite_execute_batch): New function.
* test/src/sqlite-tests.el (sqlite-multiple-statements): Add
smoke test for 'sqlite-execute-batch'.
* etc/NEWS: Mention new command 'sqlite-execute-batch'.
* doc/lispref/text.texi (Database): Document the new command.
F. Jason Park [Tue, 4 Jun 2024 17:42:35 +0000 (10:42 -0700)]
Select correct frame after enabling erc-nickbar-mode
* lisp/erc/erc-speedbar.el (erc-speedbar--ensure): Re-select frame
originally selected when earlier calling `speedbar-frame-mode'. Do
this because `speedbar-frame' may become the new selected frame when
multiple visible frames exist.
(erc-nickbar-disable): Don't expect the mode to have been enabled
previously.
F. Jason Park [Tue, 28 May 2024 07:32:13 +0000 (00:32 -0700)]
Don't recurse in erc-server-delayed-check-reconnect
* lisp/erc/erc-backend.el (erc-server-delayed-check-reconnect): Run
`reschedule' function on a timer to avoid growing the stack when
calling `delete-process'.
* lisp/erc/erc-common.el (erc--favor-changed-reverted-modules-state):
Fix `pcase' condition so that changing an option to its standard value
does not earn a "STANDARD" label in Customize if that value differs
from the saved one.
* lisp/erc/erc.el (erc-open-socks-tls-stream): Reword doc string.
* test/lisp/erc/erc-tests.el (erc--with-dependent-type-match)
(erc--with-dependent-type-match): Remove useless tests (bug#71178).
* test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld:
Await phantom EOFs and PINGs to somewhat account for a race that can
result in a failure when running the suite in parallel with -jN.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--print-trace): Set `debug-on-error' to t
so that errors in timers always trigger test failures.
;; * test/lisp/erc/resources/base/assoc/reconplay/foonet.eld:
;; Timeouts.
;; * test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld:
;; Timeouts.
;; * test/lisp/erc/resources/base/mask-target-routing/foonet.eld:
;; Timeouts.
;; * test/lisp/erc/resources/join/network-id/barnet.eld: Timeout.
Juri Linkov [Wed, 5 Jun 2024 17:07:28 +0000 (20:07 +0300)]
Allow multi-level outlines in tabulated-list-groups used by list-buffers
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups)
(tabulated-list-groups-categorize, tabulated-list-groups-sort)
(tabulated-list-groups-flatten): New functions (bug#70150).
* lisp/buff-menu.el (Buffer-menu-group-by): Change type from a function
to a list of functions.
(list-buffers--refresh): Use the function 'tabulated-list-groups' where
:path-function uses a list of functions from 'Buffer-menu-group-by', and
:sort-function is hard-coded to sort groups by name.
(Buffer-menu-group-by-mode, Buffer-menu-group-by-root): Remove prefix "*".
Eli Zaretskii [Wed, 5 Jun 2024 16:18:49 +0000 (19:18 +0300)]
Another attempt to prevent crashes when resizing TTY frames
* src/dispnew.c (frame_size_change_delayed): Accept frame as
argument, and check the 'new_size_p' flag of the frame in
addition to 'delayed_size_change'. Callers changed.
(window_to_frame_vpos, build_frame_matrix_from_leaf_window): Call
'frame_size_change_delayed' instead of looking at
delayed_size_change alone. (Bug#71289)
Eshel Yaron [Wed, 5 Jun 2024 08:23:56 +0000 (10:23 +0200)]
New user option 'completion-preview-idle-delay'
Support displaying the completion preview shortly after you
pause typing (on idle) rather than immediately.
* lisp/completion-preview.el (Commentary): Update.
(completion-preview--try-update):
(completion-preview--update-from-timer): New functions.
(completion-preview--timer): New buffer-local variable.
(completion-preview-idle-delay): New user option.
(completion-preview--show): Use it.
(completion-preview--post-command):
(completion-preview-mode): Disable idle timer if active.
Eshel Yaron [Wed, 5 Jun 2024 08:03:06 +0000 (10:03 +0200)]
Allow 'completion-preview-require-minimum-symbol-length' to be nil
With some completion backends, completion preview is useful not only
after a partial symbol, but also after punctuation and other non-symbol
characters. For example, in C code it's helpful to display the
completion preview for struct members when point is after 'foo->'.
Provide an option to skip the check for minimum symbol length at point
in order to support this use case.
* lisp/completion-preview.el
(completion-preview-minimum-symbol-length): Mention possible nil
value in type and docstring.
(completion-preview-require-minimum-symbol-length): Skip check
if 'completion-preview-minimum-symbol-length' is nil.
Juri Linkov [Wed, 5 Jun 2024 06:38:39 +0000 (09:38 +0300)]
Rehighlight hi-lock patterns after reverting the buffer.
* lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): New function.
(hi-lock-mode): Add hi-lock-revert-buffer-rehighlight to
revert-buffer-restore-functions, and remove after mode is disabled.
https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00044.html
Juri Linkov [Tue, 4 Jun 2024 16:53:47 +0000 (19:53 +0300)]
* lisp/outline.el (outline-revert-buffer-rehighlight): New function.
(outline-minor-mode): Add 'outline-revert-buffer-rehighlight' to
'revert-buffer-restore-functions'. When mode is disabled,
remove hooks from 'revert-buffer-restore-functions' and
also from 'after-change-functions'.
Eli Zaretskii [Tue, 4 Jun 2024 16:12:38 +0000 (19:12 +0300)]
Fix the build with mingw.org's MinGW
The change in boot-time.c imported from Gnulib broke the
MinGW build using mingw.org's MinGW. It is wrong to include
sysinfoapi.h, MS documentation says to include <windows.h>.
* lib/boot-time.c: Don't include sysinfoapi.h.
Paul Eggert [Mon, 3 Jun 2024 21:43:10 +0000 (14:43 -0700)]
lwlib: pacify gcc -Wmissing-variable-declarations
* lwlib/lwlib.c (lwlib_toolkit_type): Remove unused var.
* lwlib/xlwmenu.c (submenu_destroyed): Now static.
* src/xmenu.c (widget_id_tick): Declare extern, as a FIXME.
Po Lu [Tue, 4 Jun 2024 02:23:13 +0000 (10:23 +0800)]
Provide additional Android metadata
* java/AndroidManifest.xml.in: Enable preserving user data
beyond uninstallation, restarting activities without persiting
state, increase maximum number of simultaneously open
activities, and provide a sensible category.
Juri Linkov [Mon, 3 Jun 2024 18:13:38 +0000 (21:13 +0300)]
Move revert-buffer-restore-functions use from buff-menu.el to outline.el
* lisp/buff-menu.el (Buffer-menu-mode): Remove
revert-buffer-restore-functions with handling of
outline-minor-mode and move it to outline-minor-mode.
* lisp/outline.el (outline-minor-mode):
Add revert-buffer-restore-functions to call
outline-minor-mode-highlight-buffer after reverting the buffer
with outline-minor-mode and outline-minor-mode-highlight
where font-lock can't be used to update highlighting.