]> git.eshelyaron.com Git - emacs.git/log
emacs.git
12 months agoDon't nest date stamp insertions in erc-stamp
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)

(cherry picked from commit 86184cba2180a09b31e92f7366f9dd38de5b976a)

12 months agoImprove erc-fill-wrap-merge refilling and movement
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)

(cherry picked from commit 21b372a57bb0cab9ebdf93843090081eb4715030)

12 months agoSimplify option erc-merge-wrap-merge-indicator
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)

(cherry picked from commit c572c30fb121008e5b248688ebe319dd85633c72)

12 months ago; Improve erc-services and upgrade documentation
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.

(cherry picked from commit ff1d1f6df16a57acd699b18bdaa4baadff8269a1)

12 months agoMake publishDiagnostics faster by using cached variable
Theodor Thornhill [Fri, 19 Apr 2024 18:40:25 +0000 (20:40 +0200)]
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

(cherry picked from commit 49ef173b0287e17273e4476df16dca5f2196b11c)

12 months ago; * test/lisp/net/eww-tests.el (eww-test/display/html): Check for libxml.
Jim Porter [Fri, 19 Apr 2024 17:37:16 +0000 (10:37 -0700)]
; * test/lisp/net/eww-tests.el (eww-test/display/html): Check for libxml.

(cherry picked from commit 82775f21413681b09c888527b5d2fb15354f0793)

12 months agoNew user option tramp-inhibit-errors-if-setting-file-attributes-fail
Michael Albinus [Fri, 19 Apr 2024 10:15:47 +0000 (12:15 +0200)]
New user option tramp-inhibit-errors-if-setting-file-attributes-fail

* doc/misc/tramp.texi (Frequently Asked Questions):
Explain tramp-inhibit-errors-if-setting-file-attributes-fail.

* lisp/net/tramp.el
(tramp-inhibit-errors-if-setting-file-attributes-fail): New defcustom.
(tramp-skeleton-set-file-modes-times-uid-gid): Use it.

(cherry picked from commit 52d3ee46dbc6fb0fbcfbb8e446fb385aef189893)

12 months ago* java/INSTALL: Update instructions.
Po Lu [Fri, 19 Apr 2024 09:38:58 +0000 (17:38 +0800)]
* java/INSTALL: Update instructions.

(cherry picked from commit 2675c2824f77f46476831e637e4bc0fec692a0f1)

12 months ago(eglot--signal-textDocument/didChange): Fix tests
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.

(cherry picked from commit c833892140fbf4be45161bf85d4c1253c5503949)

12 months agoDrag tabs to reorder buffers on the tab line.
Juri Linkov [Thu, 18 Apr 2024 17:28:16 +0000 (20:28 +0300)]
Drag tabs to reorder buffers on the tab line.

* lisp/tab-line.el (tab-line-mouse-move-tab):
New command bound to [tab-line drag-mouse-1].

(cherry picked from commit a3f6d92714c31ccb87f56b13ee2606c05493c87d)

12 months agoBetter way to fix bug#70036
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.

(cherry picked from commit 3228c1222c99e672ca0cd7599c07ea1db852aa1a)

12 months agoRevert "Don't use file-truepath in Eglot (bug#70036)"
João Távora [Thu, 18 Apr 2024 08:55:17 +0000 (03:55 -0500)]
Revert "Don't use file-truepath in Eglot (bug#70036)"

This reverts commit 08c80c45ddea17df87fc768a39dff353ccc13d3b.

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.

* lisp/progmodes/eglot.el (eglot-lsp-server): Revert change.
(eglot-uri-to-path): Revert change.
(eglot--on-shutdown): Revert change.
(eglot--managed-mode): Revert change.
(eglot-handle-notification textDocument/publishDiagnostics): Revert change.

(cherry picked from commit 306feb7d967ecea9c916dd6e25b2e84a3f1c714e)

12 months ago; Alphabetize go-ts-mode's treesit-font-lock-feature-list
Randy Taylor [Thu, 18 Apr 2024 13:38:28 +0000 (09:38 -0400)]
; Alphabetize go-ts-mode's treesit-font-lock-feature-list

* lisp/progmodes/go-ts-mode.el (go-ts-mode):
Rearrange features to keep alphabetical order.  (Bug#70362)

(cherry picked from commit c308f5687060423938a0a72ab39505451f223e8a)

12 months agoDon't error on tabbing to a widget at BOB (bug#69943)
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.

(cherry picked from commit 94dec95317994f36f1355b972850d9565b61c433)

12 months agoEnsure that specbind arg is always bare symbol, and drop check
Mattias Engdegård [Thu, 18 Apr 2024 10:59:35 +0000 (12:59 +0200)]
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.

(cherry picked from commit 0a57dfcff8d0abcf4427cfbfd886264bb3b8eaab)

12 months agoDrop unnecessary type check in varref and varset byte ops
Mattias Engdegård [Thu, 18 Apr 2024 10:26:10 +0000 (12:26 +0200)]
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.

(cherry picked from commit dba115d6bcbc955858526740254bd9a169830d7e)

12 months ago; * lisp/comint.el: Fix wording of last change.
Eli Zaretskii [Thu, 18 Apr 2024 10:45:22 +0000 (13:45 +0300)]
; * lisp/comint.el: Fix wording of last change.

(cherry picked from commit d29d4a1d7b07806291b95792a821f8937746a467)

12 months agoObsolete comint-osc symbols moved to ansi-osc.el
Augusto Stoffel [Sun, 14 Apr 2024 07:43:27 +0000 (09:43 +0200)]
Obsolete comint-osc symbols moved to ansi-osc.el

* lisp/comint.el (comint-osc-handlers)
(comint-osc-directory-tracker, comint-osc-hyperlink-handler)
(comint-osc-hyperlink, comint-osc-hyperlink-map): Mark as
obsolete.  (Bug#70375)

(cherry picked from commit 11b1610c72a09950140cdf2284e9960af0f4a574)

12 months agoAdd YANG LSP support to Eglot
Siddharth Sharma [Fri, 12 Apr 2024 16:11:58 +0000 (18:11 +0200)]
Add YANG LSP support to Eglot

* lisp/progmodes/eglot.el (eglot-server-programs): Add
'yang-language-server' and 'json-ts-mode'.  (Bug#70364)

Copyright-paperwork-exempt: yes
(cherry picked from commit f66820d8771ca857fb4edd7300823a2cea6120be)

12 months ago; Minor change in last commit
Eli Zaretskii [Thu, 18 Apr 2024 10:30:20 +0000 (13:30 +0300)]
; Minor change in last commit

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Rearrange features to keep alphabetical order.  (Bug#70362)

(cherry picked from commit c7bcda4ac54f31ae2724cdc3b3c884c37b667b22)

12 months agoAdd font-locking for Go built-in functions in go-ts-mode
Noah Peart [Sat, 13 Apr 2024 05:38:28 +0000 (22:38 -0700)]
Add font-locking for Go built-in functions in go-ts-mode

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Add font-locking for Go built-in functions to 'go-ts-mode'.
(Bug#70362)

(cherry picked from commit 9055dad65d722850eaec049acbce15829638fd61)

12 months ago; Fix last change
Eli Zaretskii [Thu, 18 Apr 2024 10:08:23 +0000 (13:08 +0300)]
; Fix last change

* lisp/url/url-util.el (url-build-query-string): Move to after the
definition of 'url-query-key-value-allowed-chars'.

(cherry picked from commit f6c20ed5d5c22ce95df752f482df03209c7c8c42)

12 months agoAvoid unnecessary escaping in 'url-build-query-string'
Dagfinn Ilmari Mannsåker [Tue, 9 Apr 2024 14:02:45 +0000 (15:02 +0100)]
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)

(cherry picked from commit 40629706b1ff1a2a596420dd2ac388b7e5fc656c)

12 months agoFlymake support for indicating errors in margin
Elias G. B. Perez [Sat, 6 Apr 2024 19:57:30 +0000 (13:57 -0600)]
Flymake support for indicating errors in margin

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.

(cherry picked from commit 3c4f6c78b4b2ae0b1efadf5e664fa180e663037e)

12 months agoFix sending input to SQL when point is not at EOB
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)

(cherry picked from commit bb9d81d5144ae497809c416eef91d126f8ac5df5)

12 months ago; * etc/NEWS: Reindent and refill recently added entries.
Eli Zaretskii [Thu, 18 Apr 2024 08:45:47 +0000 (11:45 +0300)]
; * etc/NEWS: Reindent and refill recently added entries.

(cherry picked from commit b993c1b2752dcfe8bf6c17e58430a90b3dda5952)

12 months ago* lisp/tab-line.el: Use the new keyword :key for 'sort'.
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.

(cherry picked from commit b585fb8171dd139f178c398c64c584565deacfb1)

12 months agoCorrectly verify availability of Android content URIs
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.

(cherry picked from commit c19b988c2967f13597b7a3ceafb7c3cd40d83458)

12 months agoPropagate 'lexical-binding' value to pp buffers
Augusto Stoffel [Sun, 14 Apr 2024 07:36:05 +0000 (09:36 +0200)]
Propagate 'lexical-binding' value to pp buffers

See bug#70137.

* lisp/emacs-lisp/pp.el (pp-display-expression): Set lexical-binding to
match the value in the calling buffer.

(cherry picked from commit 3cdd86b8affa6d58de8f6d07b4e117676fedd58c)

12 months agoDocument earlier change in eglot-report-progress
Theodor Thornhill [Wed, 17 Apr 2024 18:27:35 +0000 (20:27 +0200)]
Document earlier change in eglot-report-progress

* lisp/progmodes/eglot.el (eglot-report-progress): Document the changed
behavior.
* etc/EGLOT-NEWS (https): Mention the change.

(cherry picked from commit 0dbd9ed04660152276696e462359204a45ca933d)

12 months ago(conf-toml-recognize-section): Fix bug#70383
Stefan Monnier [Wed, 17 Apr 2024 18:30:10 +0000 (14:30 -0400)]
(conf-toml-recognize-section): Fix bug#70383

* lisp/textmodes/conf-mode.el (conf-toml-recognize-section): Move
point, like font-lock matchers are expected to do.

(cherry picked from commit c15c9f4de62b5bf06d6ccdb5bbada4f542108a38)

12 months agoeglot.el: Remove accidentally included debugging code
Stefan Monnier [Wed, 17 Apr 2024 17:58:40 +0000 (13:58 -0400)]
eglot.el: Remove accidentally included debugging code

* lisp/progmodes/eglot.el (eglot--signal-textDocument/didChange):
Remove leftover debug message.

(cherry picked from commit fcee1bf07bb807c568f0155f94ebd69636691de9)

12 months ago* lisp/emacs-lisp/icons.el (define-icon): Add 'doc-string' to 'declare'.
Juri Linkov [Wed, 17 Apr 2024 18:01:14 +0000 (21:01 +0300)]
* lisp/emacs-lisp/icons.el (define-icon): Add 'doc-string' to 'declare'.

(cherry picked from commit 4dd3288569c30414abf0be4fd357d66e4dfeb8fb)

12 months agoNew keymap tab-line-mode-map and new tab order on tab-line (bug#69993)
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.

(cherry picked from commit 230eecf12a688f87354ed2d360a7dfcd7e2dae6a)

12 months agoAllow tabbing between widgets to skip inactive widgets (bug#70413)
Stephen Berman [Wed, 17 Apr 2024 17:33:24 +0000 (19:33 +0200)]
Allow tabbing between widgets to skip inactive widgets (bug#70413)

* doc/misc/widget.texi (Widgets and the Buffer, Customization):
Document it.

* etc/NEWS: Announce it.

* lisp/wid-edit.el (widget-skip-inactive): New user option.
(widget-tabable-at): Use it.

(cherry picked from commit 91333dacfa1b9f1041ceeebb3d46e8e04048c4c9)

12 months ago* lisp/emacs-lisp/track-changes.el: Fix trailer
Stefan Monnier [Wed, 17 Apr 2024 14:57:11 +0000 (10:57 -0400)]
* lisp/emacs-lisp/track-changes.el: Fix trailer

(cherry picked from commit 523aca13a45159711d7d9d7561e69d38acdac12a)

12 months agotrack-changes.el: Fix last change for early use
Stefan Monnier [Wed, 17 Apr 2024 13:04:12 +0000 (09:04 -0400)]
track-changes.el: Fix last change for early use

* lisp/emacs-lisp/track-changes.el (track-changes--recover-from-error):
Don't burp if there have been fewer than 20 keystrokes since Emacs start.

(cherry picked from commit 3660c51736072816b65265e60e0b7475375e2a73)

12 months agoAnother fix for bug#70385
Eli Zaretskii [Wed, 17 Apr 2024 11:50:38 +0000 (14:50 +0300)]
Another fix for bug#70385

* src/xdisp.c (note_fringe_highlight): Check value of x_y_to_hpos_vpos.

(cherry picked from commit 42b3024ca8e2d844084d2e8c78f58f530e1b18b3)

12 months ago; * src/xdisp.c (redisplay_internal): Typo fix in comment
Robert Pluim [Wed, 17 Apr 2024 07:04:18 +0000 (09:04 +0200)]
; * src/xdisp.c (redisplay_internal): Typo fix in comment

(cherry picked from commit 1606e14c6f1fb5c524dd21ac1b1187b5230f683e)

12 months ago* lisp/emacs-lisp/lisp.el (forward-sexp-function): Set back to nil.
Juri Linkov [Wed, 17 Apr 2024 06:53:02 +0000 (09:53 +0300)]
* lisp/emacs-lisp/lisp.el (forward-sexp-function): Set back to nil.

(forward-sexp): Revert back to checking 'forward-sexp-function'
for nil (bug#70426).

(cherry picked from commit ada429c375235c4d8bd3bf5e6bb2507fb44f63dd)

12 months agotrack-changes.el: Minor changes for version 1.0
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`.

(cherry picked from commit a33ab7565e20d9c04731491f6ae38a8d35be729f)

12 months ago(cl-defstruct): Improve handling of unknown options
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.

(cherry picked from commit 484b0979099d91e286c248e32b2f693111fac2ad)

12 months ago; Improvements to PEG documentation (second attempt)
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.

(cherry picked from commit 2141caca30860ee04cad44ae2ad32744c1c11987)

12 months ago* src/xdisp.c (note_fringe_highlight): Another attempt to fix bug#70385.
Eli Zaretskii [Tue, 16 Apr 2024 18:23:37 +0000 (21:23 +0300)]
* src/xdisp.c (note_fringe_highlight): Another attempt to fix bug#70385.

(cherry picked from commit d39f0a165a7f87336990e3304f1a8fa455a61600)

12 months agoMinor fix in detecting recursive redisplay invocations
Eli Zaretskii [Tue, 16 Apr 2024 12:12:42 +0000 (15:12 +0300)]
Minor fix in detecting recursive redisplay invocations

* src/xdisp.c (redisplay_internal): Detect recursive invocations
earlier.  (Bug#66416)

(cherry picked from commit 1be21dd95388037cfb71474a1fbd2a7d3583a80a)

12 months agoRevert "; Improvements to PEG documentation"
Mattias Engdegård [Tue, 16 Apr 2024 09:59:20 +0000 (11:59 +0200)]
Revert "; Improvements to PEG documentation"

This reverts commit 930c578c1042e6372e5433e31b2ea801315c01c9.
Looks like an editing mistake ate a large part of the text.

(cherry picked from commit 9a673c6914d4ab39139a91e892089dac70206cd2)

12 months agoAdapt tree-sitter job on EMBA
Michael Albinus [Tue, 16 Apr 2024 08:55:37 +0000 (10:55 +0200)]
Adapt tree-sitter job on EMBA

* test/infra/gitlab-ci.yml (.tree-sitter-template)
(test-tree-sitter): Adapt tree-sitter job.

(cherry picked from commit b47b8159d88a9bef5a6bfd72e5c81ba2f6df95b5)

12 months agoFix touch screen hscroll when initiated from widgets
Po Lu [Tue, 16 Apr 2024 07:38:53 +0000 (15:38 +0800)]
Fix touch screen hscroll when initiated from widgets

* lisp/wid-edit.el (widget-button--check-and-call-button):
Return to the position of point during the tracking loop if a
touch event is canceled.

(cherry picked from commit f5e0fb11dbf4d2cc5d7ceabcec7600556fb12843)

12 months agoAnother fix for bug#70385
Po Lu [Tue, 16 Apr 2024 06:54:32 +0000 (14:54 +0800)]
Another fix for bug#70385

* src/xdisp.c (note_fringe_highlight): Test that vpos falls
within W->current_matrix.  (bug#70385)

(cherry picked from commit c59e67a41c512467a54cc92ed0fdb6c3b9e9ace8)

12 months agoSupport prefix argument for switching tabs in tab-line-mode
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.

(cherry picked from commit cdd37ba4e853dcb31d8a85e12526b509720b37cd)

12 months agoAdd font-locking for operators in go-ts-mode (bug#70361)
Noah Peart [Sat, 13 Apr 2024 05:09:17 +0000 (22:09 -0700)]
Add font-locking for operators in go-ts-mode (bug#70361)

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Add
font-locking rule for Go operators.

(cherry picked from commit b33fb3b69cb9d4bce3a8cd12771649b3c3945fb0)

12 months ago; Improvements to PEG documentation
Eric Abrahamsen [Tue, 16 Apr 2024 03:14:50 +0000 (20:14 -0700)]
; Improvements to PEG documentation

* 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.

(cherry picked from commit 930c578c1042e6372e5433e31b2ea801315c01c9)

12 months ago; Fix last change to secrets-tests.el.
Basil L. Contovounesios [Mon, 15 Apr 2024 21:56:00 +0000 (23:56 +0200)]
; Fix last change to secrets-tests.el.

(cherry picked from commit 98b90fc853f05e3d94545c48851e59ace33b50cb)

12 months ago(track-changes-fetch): Fix nested use case
Stefan Monnier [Mon, 15 Apr 2024 20:06:54 +0000 (16:06 -0400)]
(track-changes-fetch): Fix nested use case

* lisp/emacs-lisp/track-changes.el (track-changes-fetch):
Don't presume that if there's nothing to do we're on
`track-changes--clean-trackers`.

(cherry picked from commit 3ac1a7b6fe6d324339ca5c36ffdce3985f6c55a1)

12 months ago(track-changes--before): Fix bug#70396
Stefan Monnier [Mon, 15 Apr 2024 19:53:48 +0000 (15:53 -0400)]
(track-changes--before): Fix bug#70396

* lisp/emacs-lisp/track-changes.el (track-changes--before):
Widen the buffer before accessing it with positions
potentially outside the beg..end region.

(cherry picked from commit 5fda398fb3bbda43dab37a0c187c90ad4bc4d1b0)

12 months agoFix resetting the frame's 'frozen_window_starts' flag
Eli Zaretskii [Mon, 15 Apr 2024 13:50:59 +0000 (16:50 +0300)]
Fix resetting the frame's 'frozen_window_starts' flag

* src/window.c (grow_mini_window, shrink_mini_window): Reimplement
how the frame's 'frozen_window_starts' flag is set and reset, to
make sure it is always reset when the mini-window gets to its
normal one-line height.  Patch by Martin Rudalics
<rudalics@gmx.at> (Bug#70038)

(cherry picked from commit 9b755244bf0b9cd5f820ae45a4db14913a587c7b)

12 months agoFix display of @xref documentation in Info
Eli Zaretskii [Mon, 15 Apr 2024 12:47:39 +0000 (15:47 +0300)]
Fix display of @xref documentation in Info

* lisp/info.el (Info--dont-hide-references): New variable.
(Info-fontify-node): Use 'Info--dont-hide-references' to disable
hiding "*Note" or showing "See" instead of it in select nodes.
(Bug#70382)

(cherry picked from commit a80a5d42d3a5f095c9d52ef5f5fe18d2e500d875)

12 months agoRewrite Android description of Android window management
Po Lu [Mon, 15 Apr 2024 11:54:20 +0000 (19:54 +0800)]
Rewrite Android description of Android window management

* doc/emacs/android.texi (Android Environment): Rewrite several
paragraphs to better reflect recent changes and emphasize
behavior on modern OS releases.

(cherry picked from commit deef12c15d8c9444a583fffa9254cc4fc44ebfa3)

12 months agoMake 'buffer-last-name' work better after 'find-alternate-file' (Bug#68235)
Martin Rudalics [Mon, 15 Apr 2024 09:17:51 +0000 (11:17 +0200)]
Make 'buffer-last-name' work better after 'find-alternate-file' (Bug#68235)

* lisp/files.el (find-alternate-file): Before killing the previous
buffer, try to restore its name and filenames (Bug#68235).

(cherry picked from commit 9a79db506e39c02daa81629f0b224a86fad2b3c6)

12 months ago; Capitalize 'project' in project-name's docstring
Dmitry Gutov [Sun, 14 Apr 2024 01:22:14 +0000 (04:22 +0300)]
; Capitalize 'project' in project-name's docstring

(cherry picked from commit 55a200d7071320311365787b60f311c7c91922d8)

12 months agoFix bug#70385
Po Lu [Mon, 15 Apr 2024 01:21:17 +0000 (09:21 +0800)]
Fix bug#70385

* src/xdisp.c (note_fringe_highlight): Don't proceed if
popup_activated, window is outdated, or when row beneath pointer
does not display text.  (bug#70385)

(cherry picked from commit e8c6e3fa477e69b4cecfee354af313ccb60e8c97)

12 months ago; (pp-display-expression): Enable undo in output buffer
Eshel Yaron [Mon, 15 Apr 2024 08:57:56 +0000 (10:57 +0200)]
; (pp-display-expression): Enable undo in output buffer

* lisp/emacs-lisp/pp.el (pp-display-expression): Enable undo.

12 months agoGC-mark temporary key values created when sorting (bug#69709)
Mattias Engdegård [Sun, 14 Apr 2024 16:20:47 +0000 (18:20 +0200)]
GC-mark temporary key values created when sorting (bug#69709)

Bug reported and fix proposed by Aris Spathis.

* src/sort.c (merge_markmem): Mark heap-allocated temporary key values.
(tim_sort): Delay key function calls to after marking function has been
registered.
* test/src/fns-tests.el (fns-tests-sort-gc): New test.

(cherry picked from commit 3d3602055264ca3095b7f28ca7e27a6f2782649a)

12 months agoAdd 'forward-sexp-default-function' to be used by 'treesit-forward-sexp'
Juri Linkov [Sun, 14 Apr 2024 16:18:31 +0000 (19:18 +0300)]
Add 'forward-sexp-default-function' to be used by 'treesit-forward-sexp'

* lisp/emacs-lisp/lisp.el (forward-sexp-default-function):
New function with body from 'forward-sexp' (bug#68993).
(forward-sexp-function): Change the default value from nil to
'forward-sexp-default-function'.
(forward-sexp): Use either 'forward-sexp-function' or
'forward-sexp-default-function'.

* lisp/treesit.el (treesit-forward-sexp): In nodes of type 'text'
fall back to 'forward-sexp-default-function'.  Improve docstring.

* doc/lispref/positions.texi (List Motion): Fix pxref.

(cherry picked from commit 568c1741352a4932508fbbd474b9fd9ebe90ddfb)

12 months agotext.texi (Tracking changes): Fix warning
Stefan Monnier [Sun, 14 Apr 2024 16:07:23 +0000 (12:07 -0400)]
text.texi (Tracking changes): Fix warning

* doc/lispref/text.texi (Change Hooks): Add a menu to silence warnings.
(Tracking changes): Improve the title.

(cherry picked from commit cd113d8c45ccf3bfa8b687c06a5d03618adf7a2c)

12 months ago; * src/eval.c (funcall_lambda): Sink specpdl load out of fast path.
Mattias Engdegård [Sun, 14 Apr 2024 10:47:43 +0000 (12:47 +0200)]
; * src/eval.c (funcall_lambda): Sink specpdl load out of fast path.

(cherry picked from commit 85ece8b494429b5ae36e79d7b4ad85a993f73543)

12 months ago; * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): less consing
Mattias Engdegård [Sat, 13 Apr 2024 15:43:34 +0000 (17:43 +0200)]
; * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): less consing

(cherry picked from commit 616af565796f8c690dd9c7d1b2fa7607f2e2fa1e)

12 months agoAdd command 'list-keyboard-macros' that works like 'list-buffers'.
Earl Hyatt [Sun, 24 Mar 2024 15:49:21 +0000 (11:49 -0400)]
Add command 'list-keyboard-macros' that works like 'list-buffers'.

The command 'list-keyboard-macros' allows editing and re-arranging
macros using 'tabulated-list-mode'.  Existing keyboard macros can be
duplicated or deleted.  Macro counters and counter formats can take new
values read from the minibuffer.  Macro keys can be edited using
'edit-kbd-macro'.

* doc/emacs/kmacro.texi (Kmacro Menu): Document the new command
and the menu's commands.
* etc/NEWS (Kmacro Menu Mode): Mention the new mode and command.
* lisp/kmacro.el (kmacro-menu-mark, kmacro-menu-marked)
(kmacro-menu-flagged): Add faces for marks and flags.
* lisp/kmacro.el (kmacro-menu-mode-map, kmacro-menu-mode): Add mode
and map.
* lisp/kmacro.el (list-keyboard-macros, kmacro-menu): Add command.
* lisp/kmacro.el (kmacro-menu--deletion-flags, kmacro-menu--marks)
(kmacro-menu--id-kmacro, kmacro-menu--id-position, kmacro-menu--kmacros)
(kmacro-menu--refresh, kmacro-menu--map-ids, kmacro-menu--replace-all)
(kmacro-menu--replace-at, kmacro-menu--query-revert, kmacro-menu--assert-row)
(kmacro-menu--propertize-keys, kmacro-menu--do-region)
(kmacro-menu--marks-exist-p): Add utility functions of mode
and commands.
* lisp/kmacro.el (kmacro-menu-mark, kmacro-menu-flag-for-deletion)
(kmacro-menu-unmark, kmacro-menu-unmark-backward)
(kmacro-menu-unmark-all): Add commands for marks and flags.
* lisp/kmacro.el (kmacro-menu-do-flagged-delete, kmacro-menu-do-copy)
(kmacro-menu-do-delete): Add commands that modify the ring.
* lisp/kmacro.el (kmacro-menu-edit-position, kmacro-menu-transpose)
(kmacro-menu-edit-format, kmacro-menu-edit-counter)
(kmacro-menu-edit-keys, kmacro-menu-edit-column): Add commands that
modify a keyboard macro.

(cherry picked from commit 7add47337b62064998a5b80f357acc39b1253e98)

12 months agoCC Mode: Don't start fontifying in the middle of an identifier
Alan Mackenzie [Sun, 14 Apr 2024 08:21:56 +0000 (08:21 +0000)]
CC Mode: Don't start fontifying in the middle of an identifier

This fixes bug#70367.

* lisp/progmodes/cc-mode.el (c-fl-decl-start): After searching
backwards for the end of the previous statement, check whether
or not we found it.

(cherry picked from commit b2842b25bf7fc934cf86b82d1053db55fd55c00b)

12 months agoRemove leftover tasks from previous Emacs sessions on startup
Po Lu [Sun, 14 Apr 2024 02:36:50 +0000 (10:36 +0800)]
Remove leftover tasks from previous Emacs sessions on startup

* java/org/gnu/emacs/EmacsService.java (onCreate): Call
removeOldTasks.

* java/org/gnu/emacs/EmacsWindowManager.java (removeOldTasks):
New function.

* java/proguard.conf: Optimize optimizer configuration.

(cherry picked from commit 2823eae0b7cb3bd3f2472fde9e13016a8d406a9a)

12 months agoRecognize multicite macros from biblatex
Arash Esbati [Sat, 13 Apr 2024 20:31:25 +0000 (22:31 +0200)]
Recognize multicite macros from biblatex

* lisp/textmodes/reftex-cite.el (reftex-all-used-citation-keys):
Match the citation keys used with multicite macros provided by
biblatex.  (bug#38249)

* test/lisp/textmodes/reftex-tests.el
(reftex-all-used-citation-keys): Adjust test accordingly.

(cherry picked from commit 845246093f8ae88db1061a9beaff04184685f8f4)

12 months agopeg-tests.el: Fix test failures
Stefan Monnier [Sat, 13 Apr 2024 19:35:46 +0000 (15:35 -0400)]
peg-tests.el: Fix test failures

* lisp/progmodes/peg.el (peg-parse): Refine heuristic since unknown
terminals are resolved at run-time rather than compile-time now.
(peg--macroexpand) <stack-action>: Avoid generating a `let` with an
empty body.
(peg--translate-rule-body): Adjust to name change of
`macroexp-warn-and-return` and the fact that it's always available.

* test/lisp/progmodes/peg-tests.el (peg-parse-string):
Add `indent` declaration.
(peg-test): Check that the compiler emits the warnings we expect.

(cherry picked from commit 7b94c6b00b287d2b69d466380a05de7e0ec21ee9)

12 months ago(define-globalized-minor-mode): Require the use of `run-mode-hooks`
Stefan Monnier [Sat, 13 Apr 2024 14:31:28 +0000 (10:31 -0400)]
(define-globalized-minor-mode): Require the use of `run-mode-hooks`

When `define-globalized-minor-mode` was introduced (Emacs-22),
`run-mode-hooks` was brand new, so we could not expect all major
modes to use it and we had to rely on brittle workarounds to try
and approximate `after-change-major-mode-hook`.

These workarounds have undesirable side effects, and (we hope)
they're not needed any more now that virtually all major modes
have been changed to use `run-mode-hooks` (or
`define-derived-mode`).

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Rely only on `after-change-major-mode-hook`, remove the "cmhh"
[typo for the intended "cmmh", BTW] workaround.

* doc/lispref/modes.texi (Mode Hooks): Clarify the importance of
`after-change-major-mode-hook` w.r.t `define-globalized-minor-mode`.
(Defining Minor Modes): Rewrite the explanation of which buffers
are affected, including adjusting it to the fact that
`fundamental-mode` has used run `run-mode-hooks` for last 10 years.

(cherry picked from commit 17e26cf57e18c5df2172a7049591d89fc53b3fb6)

12 months ago(define-globalized-minor-mode): Fix bug#58888
Stefan Monnier [Sat, 13 Apr 2024 14:10:19 +0000 (10:10 -0400)]
(define-globalized-minor-mode): Fix bug#58888

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode) <MODE-cmhh>:
Try and detect well-behaved modes so they're not affected by
those which require the cmhh hack.

(cherry picked from commit 3f7e26e2bed4ee7adab3a5d2bfa289517499e4c8)

12 months agolisp/emacs-lisp/track-changes.el: New file (bug#70077)
Stefan Monnier [Fri, 5 Apr 2024 21:37:32 +0000 (17:37 -0400)]
lisp/emacs-lisp/track-changes.el: New file (bug#70077)

This new package provides an API that is easier to use right than
our `*-change-functions` hooks.

The patch includes changes to `diff-mode.el` and `eglot.el` to
make use of this new package.

* lisp/emacs-lisp/track-changes.el: New file.
* test/lisp/emacs-lisp/track-changes-tests.el: New file.
* doc/lispref/text.texi (Tracking changes): New subsection.

* lisp/progmodes/eglot.el: Require `track-changes`.
(eglot--virtual-pos-to-lsp-position): New function.
(eglot--track-changes): New var.
(eglot--managed-mode): Use `track-changes-register` i.s.o
`after/before-change-functions` when available.
(eglot--track-changes-signal): New function, partly extracted from
`eglot--after-change`.
(eglot--after-change): Use it.
(eglot--track-changes-fetch): New function.
(eglot--signal-textDocument/didChange): Use it.

* lisp/vc/diff-mode.el: Require `track-changes`.
Also require `easy-mmode` before the `eval-when-compile`s.
(diff-unhandled-changes): Delete variable.
(diff-after-change-function): Delete function.
(diff--track-changes-function): Rename from `diff-post-command-hook`
and adjust to new calling convention.
(diff--track-changes): New variable.
(diff--track-changes-signal): New function.
(diff-mode, diff-minor-mode): Use it with `track-changes-register`.

(cherry picked from commit d7a83e23d47ca9e3e6ca70078e956e31301e5e6d)

12 months ago; Additional fixup for truncation of long lines in compilation buffers
Phil Sainty [Sat, 13 Apr 2024 12:49:56 +0000 (00:49 +1200)]
; Additional fixup for truncation of long lines in compilation buffers

* lisp/progmodes/compile.el
(compilation--insert-abbreviated-line): Handle long lines that end
in a newline.  (Bug#70236)

The fix in commit 8f93cba324e4d4022a9422b8c56186213ba2de8d resulted in
the previous "Don't hide the final newline" code causing an off-by-one
error.  With the new code the value of point is what is wanted in both
cases.

(cherry picked from commit f950621e6a177fc3110f3dec7c92b7d499fd25d6)

12 months ago; Fix coding style of last change to xdisp.c
Po Lu [Sat, 13 Apr 2024 12:07:17 +0000 (20:07 +0800)]
; Fix coding style of last change to xdisp.c

* src/xdisp.c (note_fringe_highlight): Stylistic edits.

(cherry picked from commit 66c44c3cd7b37712d5a923966f71a06bbf1fcdb8)

12 months ago; * src/window.c (shrink_mini_window): Revert inadvertent change.
Eli Zaretskii [Sat, 13 Apr 2024 11:45:15 +0000 (14:45 +0300)]
; * src/window.c (shrink_mini_window): Revert inadvertent change.

(cherry picked from commit 199351125a4b17081c5ae8056e61aeb3c33650d2)

12 months agoFix crash upon call to Fset_fontset_font after X server disconnect
Po Lu [Sat, 13 Apr 2024 11:43:40 +0000 (19:43 +0800)]
Fix crash upon call to Fset_fontset_font after X server disconnect

* src/image.c (free_image):

* src/xfaces.c (free_realized_face): Handle scenarios where
free_frame_faces is called with the display connection cut.

* src/xterm.c (x_free_frame_resources): Call free_frame_faces
unconditionally, lest fontsets for this dead frame contaminate
Vfontset_list and produce crashes afterwards.  (bug#66151)

(cherry picked from commit 9fc698479feef6fa660ff13e21619ea50bd404df)

12 months ago; Fix documentation of last change.
Eli Zaretskii [Sat, 13 Apr 2024 11:20:16 +0000 (14:20 +0300)]
; Fix documentation of last change.

* etc/NEWS:
* doc/lispref/display.texi (Other Display Specs):
* doc/lispref/text.texi (Special Properties): Fix last changes.

(cherry picked from commit 952f20fabe76c087aa96645389cfd4786fc95380)

12 months agoSupport tooltips for fringe indicators
Vladimir Kazanov [Sun, 24 Dec 2023 11:13:10 +0000 (11:13 +0000)]
Support tooltips for fringe indicators

* src/xdisp.c (note_fringe_highlight): New function.
(note_mouse_highlight): Call it when the mouse is on the fringes.
* src/frame.c (syms_of_frame) <left-fringe-help>
<right-fringe-help>: DEFSYM them.

* etc/NEWS:
* doc/lispref/text.texi (Special Properties):
* doc/lispref/display.texi (Other Display Specs): Document the new
properties.
* etc/TODO: Remove the todo item about this.

(cherry picked from commit 5734047b812639c06c90eb3baf82ff502db59fb5)

12 months ago; Improve documentation of tree-sitter "things"
Eli Zaretskii [Sat, 13 Apr 2024 08:52:57 +0000 (11:52 +0300)]
; Improve documentation of tree-sitter "things"

* doc/lispref/parsing.texi (User-defined Things): Fix text,
punctuation, and markup.
(Tree-sitter Major Modes): Add the missing "things" reference.

* etc/NEWS: Fix "thing"-related entries.

(cherry picked from commit 8b210a636fe426f47bccdb111af61d6310755dde)

12 months ago; Tweak "(emacs)Bug Reference" formatting/wording.
Basil L. Contovounesios [Sat, 13 Apr 2024 08:36:50 +0000 (10:36 +0200)]
; Tweak "(emacs)Bug Reference" formatting/wording.

(cherry picked from commit f0300fb0597225762ac6e62eeec4e223a7ad1df9)

12 months agoAllow 'help-quick' to use a non-global keymap
Philip Kaludercic [Thu, 11 Apr 2024 07:00:50 +0000 (09:00 +0200)]
Allow 'help-quick' to use a non-global keymap

* lisp/help.el (help-quick-sections): Mention
'help-quick-use-map' in docstring.
(help-quick-use-map): Add new variable, defaulting to the
global-map.
(help-quick): Use new variable.

(cherry picked from commit 6c721af9c8ee2229af57491cc2833f6743c8ddab)

12 months ago; Fix typo in 'help-quick-sections' docstring
Philip Kaludercic [Thu, 11 Apr 2024 06:44:46 +0000 (08:44 +0200)]
; Fix typo in 'help-quick-sections' docstring

(cherry picked from commit 5f6834ab9765943be07dfab6454c37375729f778)

12 months ago; * src/alloc.c (process_mark_stack): Fix commentary.
Eli Zaretskii [Sat, 13 Apr 2024 08:15:18 +0000 (11:15 +0300)]
; * src/alloc.c (process_mark_stack): Fix commentary.

(cherry picked from commit 02e795738b8877f6cf07f5ad2105449d7eb41000)

12 months agoMark Flymake regions more accurately in 'lua-ts-mode'
john muhl [Wed, 13 Mar 2024 13:35:08 +0000 (08:35 -0500)]
Mark Flymake regions more accurately in 'lua-ts-mode'

* lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use
the end position provided by Luacheck rather than relying on
'thing-at-point' to guess where the end should be.  (Bug#70167)

(cherry picked from commit d5d61618c89899bd082cd29fd81dfb7cd88ea8b8)

12 months agoFix Icalendar export with ISO dates
Eli Zaretskii [Sat, 13 Apr 2024 07:52:55 +0000 (10:52 +0300)]
Fix Icalendar export with ISO dates

* lisp/calendar/icalendar.el (icalendar--datestring-to-isodate):
Accept dashes in ISO-style numeric dates.  Patch by Erwan Hingant
<erwan.hingant@mailo.com>. (Bug#69894)

* test/lisp/calendar/icalendar-tests.el
(icalendar--datestring-to-isodate): Add a test for dashes in
ISO-style numeric dates.

(cherry picked from commit 71f8b2c3242b9b9455e9c6f25ad99ea900a1422f)

12 months agoFix task-switching failures on Android 2.3
Po Lu [Sat, 13 Apr 2024 03:28:23 +0000 (11:28 +0800)]
Fix task-switching failures on Android 2.3

* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
Don't specify F_A_MULTIPLE_TASK on Android 4.4 and earlier.

(cherry picked from commit 4fc37710788cdab9ebf4264636999ba999a59547)

12 months ago(elisp-tests-syntax-propertize): New test for bug#24542
Stefan Monnier [Sat, 13 Apr 2024 01:54:53 +0000 (21:54 -0400)]
(elisp-tests-syntax-propertize): New test for bug#24542

* test/lisp/progmodes/elisp-mode-tests.el (elisp-tests-syntax-propertize):
New test.

(cherry picked from commit e8adb8cf5a51ef172fb07786b71e3140b9358764)

12 months agorcs2log now groks add-log-time-zone rule
Paul Eggert [Fri, 12 Apr 2024 20:14:29 +0000 (13:14 -0700)]
rcs2log now groks add-log-time-zone rule

* lib-src/rcs2log (extractTZ): Adjust to renaming of
change-log-time-zone-rule to add-log-time-zone rule, by allowing
either spelling.

(cherry picked from commit c26261c027ef7594427d477208b8126d6e4982bd)

12 months ago(emacs-lisp-mode-syntax-table): Fix bug#24542
Stefan Monnier [Fri, 12 Apr 2024 17:28:45 +0000 (13:28 -0400)]
(emacs-lisp-mode-syntax-table): Fix bug#24542

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table):
Remove `p` from the flags of `@`.

(cherry picked from commit 648b7bf7e22577c2f917e389694a76ce1f42dc0e)

12 months ago* lisp/buff-menu.el: Improve 'Buffer-menu-group-by-mode' (bug#70150).
Juri Linkov [Fri, 12 Apr 2024 16:39:49 +0000 (19:39 +0300)]
* lisp/buff-menu.el: Improve 'Buffer-menu-group-by-mode' (bug#70150).

(Buffer-menu-group-by): Replace function-item with const
better suitable for Customization UI.
(Buffer-menu-group-by-mode): Use 'mouse-buffer-menu-mode-groups'
to group buffers by mode.

(cherry picked from commit 5bd4d458676c458d6b534ea1c74cf6f0c1899ea6)

12 months agoNew user option 'tab-line-tabs-buffer-group-function'
Juri Linkov [Fri, 12 Apr 2024 16:35:55 +0000 (19:35 +0300)]
New user option 'tab-line-tabs-buffer-group-function'

* lisp/tab-line.el (tab-line-tabs-buffer-group-function):
Turn defvar into defcustom with the default value
'tab-line-tabs-buffer-group-by-mode'.
(tab-line-tabs-buffer-group-by-mode): New function with body from
'tab-line-tabs-buffer-group-name'.
(tab-line-tabs-buffer-group-by-project): New function.
(tab-line-tabs-buffer-groups): Use fallback name "No group" instead of "All".

(cherry picked from commit 414f8d02c1a361fa780e55fcf0f260fe00a9a62d)

12 months ago; * etc/NEWS: Fix typo.
Michael Albinus [Fri, 12 Apr 2024 13:51:26 +0000 (15:51 +0200)]
; * etc/NEWS: Fix typo.

(cherry picked from commit 2fc7e21f5e75ea6b00d6f7344335f44f5663d955)

12 months ago; Fix documentation of a recent change in dbus.el (bug#70301)
Eli Zaretskii [Fri, 12 Apr 2024 11:26:27 +0000 (14:26 +0300)]
; Fix documentation of a recent change in dbus.el (bug#70301)

* lisp/net/dbus.el (dbus-string-to-byte-array)
(dbus-byte-array-to-string):
* etc/NEWS:
* doc/misc/dbus.texi (Type Conversion): Fix documentation of these
two D-Bus functions.

(cherry picked from commit f93df59e8c9038a10992b71bfd6beeda70f806dd)

12 months ago; Skip commit 4ff852a5582be8d0ba16e598371ce359ba3d3cc6
Eshel Yaron [Sun, 14 Apr 2024 17:09:08 +0000 (19:09 +0200)]
; Skip commit 4ff852a5582be8d0ba16e598371ce359ba3d3cc6

12 months agoImprove D-Bus byte-array conversion
Michael Albinus [Fri, 12 Apr 2024 08:09:45 +0000 (10:09 +0200)]
Improve D-Bus byte-array conversion

* doc/misc/dbus.texi (Type Conversion): Adapt dbus-byte-array-to-string.

* etc/NEWS: D-Bus byte array conversion works over raw UTF-8 bytes.
Fix typos.

* lisp/net/dbus.el (dbus-string-to-byte-array)
(dbus-byte-array-to-string): BYTE-ARRAY must be an UTF-8 raw bytes
sequence.  Make optional argument MULTIBYTE obsolete.  (Bug#70301)
(dbus-call-method-handler, dbus-register-signal)
(dbus-escape-as-identifier): Use `length=' and `length>'.

* test/lisp/net/dbus-tests.el (dbus--test-method-handler)
(dbus-test09-get-managed-objects): Use `length='.
(dbus-test01-type-conversion): Extend test.

* test/lisp/net/secrets-tests.el (secrets-test03-items): Extend test.

(cherry picked from commit a69890eea946beb0858273a20d260a170485b79a)

12 months agoDisplay Info buffer after ensuring it contains text
Joseph Turner [Sat, 6 Apr 2024 01:32:36 +0000 (18:32 -0700)]
Display Info buffer after ensuring it contains text

* lisp/info.el (info-pop-to-buffer): Move display of Info buffer
to a later stage after its text contents is ready to display.
This helps to use fit-window-to-buffer in display-buffer-alist (bug#70213).

(cherry picked from commit 21775a936bd3838adaae38bd5c5ec776434736c1)

12 months ago; Improve documentation of completion commands
Eli Zaretskii [Thu, 11 Apr 2024 18:48:47 +0000 (21:48 +0300)]
; Improve documentation of completion commands

* doc/emacs/mini.texi (Completion Commands): Mention that '?' also
shows a couple of commands.

(cherry picked from commit 0fab2649e288c7a350018293443e709eba6b0fe2)