Karl Fogel [Mon, 22 Apr 2024 19:45:39 +0000 (14:45 -0500)]
Fix two bugs in removing bookmark fringe marks
This fixes bug#70019 and a separate fringe-mark removal bug that
also affected bookmarks in certain Info nodes.
* lisp/bookmark.el (bookmark--remove-fringe-mark): Fix bug#70019 by
temporarily widening in order to ensure we fetch the right overlays.
Also, normalize both filenames before comparing, to avoid spurious
failure to match.
Thanks to Dani Moncayo for the bug report and for testing.
* lisp/emacs-lisp/bytecomp.el (byte-compile-format-warn):
Speed up by eliminating the temporary buffer.
Detect invalid format sequences. Use plurals properly.
* test/lisp/emacs-lisp/bytecomp-tests.el: Update test.
Po Lu [Mon, 22 Apr 2024 08:27:30 +0000 (16:27 +0800)]
Generate Android shared library list automatically
* .gitignore: Ignore new generated files.
* cross/Makefile.in (src/Makefile): Remove leftover
specification of the source Gnulib directory.
* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_READELF): New
variable.
* java/Makefile.in (CONFIG_FILE, ALL_DEPENDENCIES, READELF)
(cf-stamp-1, cf-stamp): New variables and rules; compute the set
of library files in the order of loading and generate a file
with this information.
(ALL_CLASS_FILES): New variable; if builddir is not srcdir,
$($(CONFIG_FILE), $(CLASS_FILES)): Depend on EmacsConfig.java.
add generated files in the build directory.
(classes.dex): Adjust to match.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
<static initializer>: Load shared libraries from
EMACS_SHARED_LIBRARIES rather than a hard-coded list.
* m4/ndk-build.m4 (ndk_INIT): Search for readelf...
(ndk_CHECK_MODULES): ...and substitute its path as
NDK_BUILD_READELF.
Juri Linkov [Mon, 22 Apr 2024 06:54:18 +0000 (09:54 +0300)]
* lisp/progmodes/flymake.el: Small improvements for buffers display.
(flymake-mode-map): Bind mouse-1 click on the fringe to
'flymake-show-buffer-diagnostics' (bug#70459).
(flymake-show-buffer-diagnostics): Display buffer diagnostics
at the bottom.
(flymake-show-project-diagnostics): Display project diagnostics
at the bottom.
Juri Linkov [Mon, 22 Apr 2024 06:50:45 +0000 (09:50 +0300)]
* lisp/emacs-lisp/warnings.el (warning-display-at-bottom): New defcustom.
(display-warning): Use 'warning-display-at-bottom' to display
the warning buffer at the bottom of the screen and to scroll
to the last warning message (bug#69983).
* test/lisp/progmodes/rust-ts-mode-tests.el: New file for rust-ts-mode
tests.
* test/lisp/progmodes/rust-ts-mode-resources/font-lock.rs: New file
with rust-ts-mode font-locking tests. New tests added for macro
font-locking (bug#70464) and function signatures
(bug#70465).
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Add font-locking for Rust
macro metavariables, fragment specifiers and repitition patterns.
Yuan Fu [Mon, 22 Apr 2024 04:41:00 +0000 (21:41 -0700)]
Make c-ts-common-comment-indent-new-line work for more cases
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Handle the case where user
types M-j in the middle of a line; and when the line starts with /**.
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): New function.
(c-ts-common-comment-setup): Setup comment-line-break-function and
comment-multi-line.
Improve function signature font-lock rust-ts-mode (bug#70465)
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--font-lock-settings): Add font-lock rule for Rust
function signatures and missing function modifier keyword 'default'.
Eric Abrahamsen [Sun, 21 Apr 2024 00:25:20 +0000 (17:25 -0700)]
Re-encode message bodies with externalized attachments during FCC
Bug#70338
* lisp/gnus/message.el (message-do-fcc): If the user has requested to
externalize attachments, we can't use the cached version of the message
body from sending. This mirrors an equivalent check for GCC in
`gnus-inews-do-gcc'.
The source of bug#70436 is that we print a value into the buffer
and then we generate its print representation a second time to
get its length to find the bounds of the thing we just printed.
Not only it's wasteful, but it risks bugs because the two
"prints" can be inconsistent with each other.
This is not a complete fix because in the non EVALD case we
still use that same broken way.
* lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args):
Don't re-print things just to get their length.
(backtrace--print-to-string): Skip a temp-buffer indirection.
Eli Zaretskii [Sat, 20 Apr 2024 09:11:18 +0000 (12:11 +0300)]
Avoid "C-h for help" prompt in "C-h" commands describing keys
* lisp/info.el (Info-goto-emacs-key-command-node): Call
'read-key-sequence' instead of using 'interactive' with the "k"
code, and suppress the "C-h for help" echo.
* lisp/help.el (help--read-key-sequence): Suppress the "C-h for
help" prompt in echo-keystrokes. Give the prompt the
'minibuffer-prompt' face. (Bug#70432)
Augusto Stoffel [Wed, 17 Apr 2024 18:26:16 +0000 (20:26 +0200)]
With glasses-uncapitalize-p, use a display overlay property
* lisp/progmodes/glasses.el (glasses-make-readable): Use the
'display' property instead of 'after-string', so that one is
able to place the cursor on the uncapitalized character.
(Bug#70441)
Yuan Fu [Fri, 19 Apr 2024 07:18:03 +0000 (00:18 -0700)]
Tree-sitter: only update range and reparse for changed ranges
In the very beginning, there's bug#66732, to solve that bug, we added
treesit--pre-redisplay and treesit--syntax-propertize-notifier.
However, to fix bug#66732, we were updating ranges for the whole
buffer which makes Emacs extremely slow when there are a lot of local
parsers in a large buffer. Then to solve that we introduced a
workaround where we only update ranges in a fixed range around point.
This change fixes the original problem (bug#66732) without using that
workaround.
* lisp/treesit.el (treesit--font-lock-notifier):
(treesit--syntax-propertize-notifier): Remove functions
(treesit--pre-redisplay): Use the new function
treesit-parser-changed-ranges to get the changed ranges of the primary
parser, and only update ranges for those ranges. Plus do the work of
the removed function.
(treesit-major-mode-setup): Remove setup for the removed functions.
Yuan Fu [Wed, 17 Apr 2024 06:46:39 +0000 (23:46 -0700)]
New function treesit-parser-changed-ranges
- Add a new field last_changed_ranges to tree-sitter parser object.
- Add a new function treesit-parser-changed-ranges
* doc/lispref/parsing.texi (Using Parser): Add the function in
tree-sitter manual.
* src/treesit.c (treesit_get_changed_ranges): New function, refactored
out of treesit_call_after_change_functions.
(treesit_call_after_change_functions): Pull out
treesit_get_changed_ranges.
(treesit_ensure_parsed): Save the changed ranges to the parser object.
(make_treesit_parser): Initialize the new parser field
last_changed_ranges.
(Ftreesit_parser_changed_ranges): New function.
(Qtreesit_unparsed_edits): New error.
* src/treesit.h (Lisp_TS_Parser): New field.
Eric Abrahamsen [Fri, 19 Apr 2024 23:26:36 +0000 (16:26 -0700)]
; Improve wording of manual entry for `peg-run'
* doc/lispref/peg.texi (Parsing Expression Grammars): "lambda form"
isn't really a meaningful term. Prefer plain "function", though in this
case we've used "anonymous function" to avoid ambiguity.
João Távora [Fri, 19 Apr 2024 21:21:21 +0000 (16:21 -0500)]
Eglot: tweak previous change (bug#70036)
* lisp/progmodes/eglot.el (eglot--TextDocumentIdentifier-uri):
Rename from eglot--cached-tdi.
(eglot-handle-notification): Tweak comment. Use
eglot--TextDocumentIdentifier-uri.
(eglot--TextDocumentIdentifier)
(eglot--signal-textDocument/didOpen): Use
eglot--TextDocumentIdentifier-uri.
F. Jason Park [Sat, 13 Apr 2024 21:58:13 +0000 (14:58 -0700)]
Fix regression involving erc-query-buffer-p
* lisp/erc/erc.el (erc-server-or-unjoined-channel-buffer-p): Doc.
(erc-query-buffer-p): Don't return non-nil in non-ERC buffers and
server buffers, and continue to honor string arguments. The
regression was introduced by 3d87e343 "Use modern fallback for channel
name detection in ERC". Thanks to Libera user mekeor for reporting
this bug.
* test/lisp/erc/erc-tests.el (erc-query-buffer-p): New test.
(Bug#67220)
F. Jason Park [Fri, 19 Apr 2024 05:18:57 +0000 (22:18 -0700)]
Add erc--skip message property
* lisp/erc/erc-backend.el (erc-server-connect): Add `erc--skip'
property to `erc--msg-prop-overrides' so that timestamps only show up
with the first server-sent message.
(erc-server-PRIVMSG): Move `erc--msg-prop-overrides' declaration to
top-level.
* lisp/erc/erc-button.el (erc-button--display-error-notice-with-keys):
Use `erc--skip' msg prop instead of `erc-stamp--skip' variable.
* lisp/erc/erc-stamp.el (erc-stamp--skip): Remove variable.
(erc-stamp--allow-unmanaged, erc-stamp--allow-unmanaged-p): Rename
former to latter to remain consistent with convention used by other
quasi-internal compatibility-related switches.
(erc-add-timestamp): Check `erc--skip' property instead of deleted
variable `erc-stamp--skip'.
* lisp/erc/erc.el (erc--msg-props): Mention `erc--skip' in doc.
(erc--check-msg-prop): Doc.
(erc--memq-msg-prop): New function.
(erc--ranked-properties): Add `erc--skip'.
* test/lisp/erc/erc-scenarios-stamp.el
(erc-scenarios-stamp--legacy-date-stamps): Revise to expect
"opening connection.." to appear above first stamp.
* test/lisp/erc/erc-tests.el (erc--memq-msg-prop): New test.
(Bug#60936)
F. Jason Park [Mon, 8 Apr 2024 21:21:43 +0000 (14:21 -0700)]
Don't nest date stamp insertions in erc-stamp
* etc/ERC-NEWS: Don't mention certain insertion-adjacent hooks being
suppressed for date stamps, which is no longer true.
* lisp/erc/erc-common.el (erc--solo): New utility function.
* lisp/erc/erc-fill.el (erc-fill-wrap): Don't move last-message marker
when encountering a date stamp.
* lisp/erc/erc-stamp.el (erc-stamp--recover-on-reconnect): Restore
`erc-stamp--date-stamps' on reconnect and rejoin.
(erc-stamp--insert-date-hook): Fix erroneous doc string.
(erc-stamp--date): New struct type.
(erc-stamp--deferred-date-stamp): New internal variable to pass state
between hook members.
(erc-stamp--date-stamps): New internal variable to store a reference
to all inserted timestamps.
(erc-stamp--propertize-left-date-stamp): Don't hide messages because
this function runs on `erc-insert-modify-hook'. Prefer doing so
later, in `erc-insert-post-hook'.
(erc-stamp--find-insertion-point): New helper function.
(erc-stamp--insert-date-stamp-as-phony-message): Remove.
(erc-stamp--lr-date-on-pre-modify): Remove function. Portions of body
now appear in `erc-stamp--defer-date-insertion-on-post-modify'.
(erc-stamp--defer-date-insertion-on-post-modify)
(erc-stamp--defer-date-insertion-on-post-insert)
(erc-stamp--defer-date-insertion-on-post-send): New functions,
although the first incorporates parts of the now defunct
`erc-stamp--lr-date-on-pre-modify'.
(erc-stamp--date-mode): Update hook-member functions.
(erc-stamp-prepend-date-stamps-p): Revise doc.
(erc-insert-timestamp-left-and-right): Remove code to initialize a
date stamp in place through a nested call to `erc-display-message'.
Instead, "pre-render" date stamp and stash it for retrieval by
the function `erc-stamp--defer-date-insertion-on-post-modify'.
(erc-stamp--setup): Kill variables `erc-stamp--deferred-date-stamp'
and `erc-stamp--date-stamps'.
(erc-stamp--reset-on-clear): Remove trimmed stamps from
`erc-stamp--date-stamps'.
* lisp/erc/erc.el (erc--msg-props): Document `erc--hide' in doc
string.
(erc--with-inserted-msg): Remove unused macro.
(erc--insert-line-splice-function): New variable.
(erc--with-spliced-insertion): New macro.
(erc--insert-line-function): Expand doc string.
(erc--remove-from-prop-value-list): Tweak doc string.
(erc--insert-before-markers-transplanting-hidden): New function.
(erc--hide-message): Remember managed `invisible' prop value. Do so
by recording them in the `erc--hide' "msg prop".
(erc--delete-inserted-message, erc--delete-inserted-message-naively):
Rename former to latter to emphasize that it's largely impractical for
general use.
(erc--ranked-properties): Add `erc--hide'.
* test/lisp/erc/erc-button-tests.el
(erc-button-tests--erc-button-alist--function-as-form): Use
`erc-display-message' helper.
* test/lisp/erc/erc-fill-tests.el (erc-fill-tests--insert-privmsg)
(erc-fill-tests--wrap-populate, erc-fill-wrap-tests--merge-action)
(erc-fill-line-spacing): Use `erc-display-message' wrappers to
intercept `erc-timer-hook' modifications.
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--invisible-stamp): Add convenience commands to
`extended-command-history' when running interactively.
* test/lisp/erc/erc-tests.el
(erc--insert-before-markers-transplanting-hidden): New test.
(erc--delete-inserted-message, erc--delete-inserted-message-naively):
Update test name as well as namesake function in body.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common-with-cleanup): Validate `erc-stamp--date-stamps'
members after every scenario test.
(erc-scenarios-common--assert-date-stamps): New function.
* test/lisp/erc/resources/erc-tests-common.el: Require `erc-stamp'
atop file when compiling.
(erc-tests--common-display-message)
(erc-tests-common-display-message)
(erc-tests-common-with-date-aware-display-message): New functions and
macro for running `erc-display-message' while intercepting additions
to `erc-timer-hook' made by date-stamp-related post-insertion hooks.
(erc-tests-common-snapshot-compare): Insert expected output into its
own buffer for easier review during interactive sessions. This change
is unrelated to the rest of this commit. (Bug#60936)
F. Jason Park [Fri, 12 Apr 2024 07:04:50 +0000 (00:04 -0700)]
Improve erc-fill-wrap-merge refilling and movement
* lisp/erc/erc-fill.el (erc-fill--wrap-escape-hidden-speaker): Add
parameter to suppress escaping of hidden prefixes.
(erc-fill--wrap-beginning-of-line): Remember original value of point,
and pass it to `erc-fill--wrap-escape-hidden-speaker'.
(erc-fill--wrap-previous-line, erc-fill--wrap-next-line): Guard call
to `erc-fill--wrap-escape-hidden-speaker' with conditional check for
`erc-fill-wrap-merge'.
(erc-fill--wrap-insert-merged-pre): Add additional text property,
`erc-fill--wrap-merge', to help identify `display' regions servicing
`erc-fill-wrap-merge'. This should make resolving inconsistencies
easier when "splicing" new messages between existing ones.
(erc-fill-wrap): Add `erc-fill--wrap-merge' text property to merged
speaker region.
(erc-fill--wrap-rejigger-region): Remove assertion disallowing a
non-nil `erc-fill--wrap-rejigger-last-message'. Instead, adopt the
existing value of that variable when shadowing it for the remaining
extent of the function's execution. When removing the `display'
property, also look for nonempty replacement text, such as values
specified by the option `erc-fill-wrap-merge-indicator'.
(erc-fill--wrap-merged-button-p): Look for `erc-fill--wrap-merge'
property instead of `display'.
* test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update.
* test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-pre-01.eld:
Update.
* test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update.
(Bug#60936)
F. Jason Park [Fri, 12 Apr 2024 07:04:50 +0000 (00:04 -0700)]
Simplify option erc-merge-wrap-merge-indicator
* lisp/erc/erc-fill.el (erc-fill-wrap-merge-indicator): Reduce
offering of acceptable values by removing leading symbols and ditching
the `post' variant entirely. The justification for the latter move
hinges on it not being well suited to next-gen requirements involving
the splicing and deletion of inserted messages. Meeting these would
be overly burdensome and involve scanning the buffer in both
directions for every such operation. This option is new in ERC 5.6,
which is yet unreleased.
(erc-fill--wrap-massage-legacy-indicator-type): New function to warn
of obsolete `erc-fill-wrap-merge-indicator' value and perform a
migration for the current session.
(erc-fill-wrap, erc-fill-wrap-enable): Preform preflight compat check
for obsolete `erc-fill-wrap-merge-indicator' value types.
(erc-fill-wrap-disable): Don't bother killing nonexistent variable
`erc-fill--wrap-merge-indicator-post'.
(erc-fill--wrap-merge-indicator-post): Remove unused variable.
(erc-fill--wrap-insert-merged-post): Remove unused function.
(erc-fill--wrap-insert-merged-pre): Adapt to simplified format for
option `erc-merge-wrap-merge-indicator'.
(erc-fill-wrap): Remove conditional dispatch because there is only one
path and only one indicator style.
(erc-fill--wrap-rejigger-region): Remove reference to nonexistent
variable `erc-fill--wrap-merge-indicator-post'.
* test/lisp/erc/erc-fill-tests.el
(erc-fill-wrap--merge-action/indicator-pre): Update format of value
for option `erc-fill-wrap-merge-indicator'.
(erc-fill-wrap--merge-action/indicator-post): Remove test focusing on
obsolete and unsupported `post' variant of option
`erc-fill-wrap-merge-indicator'.
(erc-fill--wrap-massage-legacy-indicator-type): New test.
* test/lisp/erc/resources/fill/snapshots/merge-wrap-indicator-post-01.eld:
Delete file. (Bug#60936)
F. Jason Park [Mon, 8 Apr 2024 02:28:24 +0000 (19:28 -0700)]
; Improve erc-services and upgrade documentation
* doc/misc/erc.texi (Getting Help and Reporting Bugs): Describe
alternate method for upgrading from GNU ELPA. This is a partial
workaround for bug#68660 discovered by ERC contributor Alcor.
* lisp/erc/erc-backend.el (erc-call-hooks): Add comment.
* lisp/erc/erc-services.el (erc-nickserv-alist): Doc.
* test/lisp/erc/erc-scenarios-base-renick.el
(erc-scenarios-base-renick-queries-bouncer): Adjust timeout.
Make publishDiagnostics faster by using cached variable
* lisp/progmodes/eglot.el (eglot--cached-tdi): Move variable.
(eglot-handle-notification): Expose 'server' and search through managed
buffers for a cached textDocumentIdentifier, which has a file-truename
resolved path.
* test/lisp/progmodes/eglot-tests.el (eglot-test-basic-symlink): Add
regression test for symlink behavior
Stefan Monnier [Fri, 19 Apr 2024 03:39:30 +0000 (23:39 -0400)]
(eglot--signal-textDocument/didChange): Fix tests
The tests call `eglot--signal-textDocument/didChange` eagerly,
which means in the case where we use `track-changes` that they
call it before the tracker's signal has been called.
So make sure we fetch pending changes even if we haven't yet
been notified of them, and make sure `eglot--versioned-identifier`
is incremented even when the signal is not called.
* lisp/progmodes/eglot.el (eglot--track-changes-fetch)
(eglot--after-change): Increment `eglot--versioned-identifier` here...
(eglot--track-changes-signal): ...instead of here.
(eglot--signal-textDocument/didChange): Try and fetch changes even if the
tracker's signal wasn't called yet.
* test/lisp/progmodes/eglot-tests.el (eglot-tests--get): New function.
(eglot-tests--lsp-abiding-column-1): Use it.
João Távora [Thu, 18 Apr 2024 13:03:10 +0000 (08:03 -0500)]
Better way to fix bug#70036
Cache a new eglot--cached-tdi var per buffer, which contains value to
return from eglot--TextDocumentIdentifier.
This avoids frequent expensive recomputation of a value that requires
potentially many 'file-truename' calls. This technique is used in a
number of other cases already, like eglot--recent-changes or
eglot--versioned-identifier.
* lisp/progmodes/eglot.el (eglot--cached-tdi): New variable.
(eglot--TextDocumentIdentifier): Tweak.
(eglot--signal-textDocument/didOpen): Clear eglot--cached-tdi.
It introduces bugs when a project contains symlinked files. The server
will be informed of duplicate documents which are really the same and it
frequently has no means to deduplicate such information.
This leads to bugs such as excessive textDocument/references to a
function.
Stephen Berman [Thu, 18 Apr 2024 13:35:49 +0000 (15:35 +0200)]
Don't error on tabbing to a widget at BOB (bug#69943)
* lisp/wid-edit.el (widget-move): Don't move backward when at
beginning of buffer, and keep point on widget's left side.
* test/lisp/wid-edit-tests.el (widget-test-widget-move): Test that
moving to a widget at beginning of buffer does not signal a
beginning-of-buffer error.
Ensure that specbind arg is always bare symbol, and drop check
* src/eval.c (FletX, Flet, internal_lisp_condition_case)
(funcall_lambda): Ensure that the first argument to `specbind` is
a bare symbol in the few cases where this isn't statically guaranteed.
(specbind): Drop the symbol argument type check on the fast path.
Drop unnecessary type check in varref and varset byte ops
* src/bytecode.c (exec_byte_code):
We can safely assume that the immediate argument to varref and varset
is a bare symbol; the byte-compiler should guarantee that.
Avoid unnecessary escaping in 'url-build-query-string'
* lisp/url/url-util.el (url-query-key-value-allowed-chars):
New defconst.
(url-build-query-string): Use it to escape only those
characters that need it in keys and values.
* test/lisp/url/url-util-tests.el (url-util-tests): Add
new test cases. (Bug#70312)
Add optional support for display flymake error in margin,
this allow displaying error indicators in both graphical and
terminal frames.
* doc/misc/flymake.texi (Customizable variables)
(Flymake error types): Document new margin indicator.
* etc/NEWS: Announce the new Flymake user option for margin
indicators.
* lisp/progmodes/flymake.el (flymake-indicator-type)
(flymake-margin-indicators-string, flymake-autoresize-margins)
(flymake-margin-indicator-position): New user options.
(flymake--original-margin-width): Add buffer-local variable for
store original buffer margin width.
(flymake-error, flymake-warning, flymake-note): Use new margin
value.
(flymake--indicator-overlay-spec): Rework and Rename from
flymake--fringe-overlay-spec.
(flymake--resize-margins): Add new function for resize margin
width.
(flymake--highlight-line, flymake-mode): Rework.
Eli Zaretskii [Thu, 18 Apr 2024 08:53:26 +0000 (11:53 +0300)]
Fix sending input to SQL when point is not at EOB
* lisp/progmodes/sql.el (sql-send-string): Move point to EOB
before sending input to the SQL process. Suggested by Gary Hollis
<ghollisjr@gmail.com>. (Bug#69420)
Juri Linkov [Thu, 18 Apr 2024 06:36:18 +0000 (09:36 +0300)]
* lisp/tab-line.el: Use the new keyword :key for 'sort'.
(tab-line-tabs-fixed-window-buffers): Use :key for 'sort'.
Rename the window parameter 'tab-line-fixed-window-buffers'
to shorter 'tab-line-buffers'. Add '(tab-line-buffers . writable)
to window-persistent-parameters.
Po Lu [Thu, 18 Apr 2024 02:37:31 +0000 (10:37 +0800)]
Correctly verify availability of Android content URIs
* java/org/gnu/emacs/EmacsService.java (checkContentUri): Call
checkUriPermission with IPC-effective PID and UID rather than
checkCallingUriPermission, which never considers permissions of
Emacs itself, and delete the now-redundant workaround.
Juri Linkov [Wed, 17 Apr 2024 17:55:45 +0000 (20:55 +0300)]
New keymap tab-line-mode-map and new tab order on tab-line (bug#69993)
* lisp/tab-line.el (tab-line-new-button-functions): New variable.
(tab-line-tabs-function): Change the default value from
'tab-line-tabs-window-buffers' to the new option
'tab-line-tabs-fixed-window-buffers'.
(tab-line-tabs-buffer-group-sort-function): Change the default
value from nil to 'tab-line-tabs-buffer-group-sort-by-name'.
(tab-line-tabs-buffer-group-sort-by-name): New function.
(tab-line-tabs-fixed-window-buffers): New function.
(tab-line-format-template): Use 'tab-line-new-button-functions'.
(tab-line-mode-map, tab-line-switch-repeat-map): New keymaps.
Stefan Monnier [Wed, 17 Apr 2024 01:57:05 +0000 (21:57 -0400)]
track-changes.el: Minor changes for version 1.0
Arrange for the library to be usable on older Emacsen, which
includes reducing the noise when `before/after-change-functions`
are badly paired or missing.
Also, since the signal function receives the distance (for `:disjoint`),
we don't need `track-changes--disjoint-threshold`: the signal
function can simply do nothing when the distance is smaller than
the threshold it wants to use.
* lisp/emacs-lisp/track-changes.el: Prepare header for ELPA.
(track-changes--tracker, track-changes--state): Don't use `:noinline`,
so as to be compatible with Emacs<27.
(track-changes-record-errors): New variable.
(track-changes--recover-from-error): Use it. Record only the last 20
keys and the last 50 stack frames in the error log.
(track-changes--disjoint-threshold): Delete variable.
(track-changes--before): Don't use it any more.
* lisp/progmodes/eglot.el (eglot--track-changes-signal):
Coalesce disjoint changes nearer than what used to be coalesced because of
`track-changes--disjoint-threshold`.
Stefan Monnier [Wed, 17 Apr 2024 01:17:47 +0000 (21:17 -0400)]
(cl-defstruct): Improve handling of unknown options
Until now `cl-defstruct` signaled an error when encountering an
unknown option. It's easy to code and it does the job, but it
doesn't give good location info in the compiler's output,
and it makes it more painful to use not-yet-supported options.
So just signal a warning instead.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Warn about unknown
options, instead of signaling an error.
Eric Abrahamsen [Tue, 16 Apr 2024 03:14:50 +0000 (20:14 -0700)]
; Improvements to PEG documentation (second attempt)
* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.
Juri Linkov [Tue, 16 Apr 2024 06:40:15 +0000 (09:40 +0300)]
Support prefix argument for switching tabs in tab-line-mode
* lisp/tab-line.el (tab-line-select-tab-buffer): Optimize.
(tab-line-switch-cycling): Enable by default like in tab-bar-mode.
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Add a prefix argument ARG and support it for switching tabs.
Improve docstring.