Juri Linkov [Mon, 22 Apr 2024 06:45:40 +0000 (09:45 +0300)]
* lisp/files.el (find-alternate-file): Fix the order of restoring buffer.
Swap the order of restoring original buffer's file names and
restoring original's buffer name with 'rename-buffer' (bug#68235).
Po Lu [Mon, 22 Apr 2024 05:31:57 +0000 (13:31 +0800)]
Fix load order of certain Android shared libraries
* java/org/gnu/emacs/EmacsNative.java (libraryDeps): Move
dependencies of selinux and gnutls before their respective
dependents.
Noah Peart [Fri, 19 Apr 2024 17:27:10 +0000 (10:27 -0700)]
Add rust-ts-mode font-locking tests (bug#70464)
* 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).
Noah Peart [Fri, 19 Apr 2024 01:22:05 +0000 (18:22 -0700)]
Add font-locking for Rust macros (bug#70464)
* 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 /**.
Yuan Fu [Mon, 22 Apr 2024 04:25:19 +0000 (21:25 -0700)]
Add tree-sitter comment-indent-new-line (bug#70074)
* 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.
Noah Peart [Fri, 19 Apr 2024 01:52:06 +0000 (18:52 -0700)]
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'.
Yuan Fu [Sat, 20 Apr 2024 07:42:25 +0000 (00:42 -0700)]
Add treesit-add-font-lock-rules
This function should help users customize font-lock rules.
* lisp/treesit.el (treesit-add-font-lock-rules): New function.
Po Lu [Sun, 21 Apr 2024 13:11:22 +0000 (21:11 +0800)]
Better verify arguments to android-relinquish-directory-access
* src/androidvfs.c (Fandroid_relinquish_directory_access):
Provide for NULL values from android_name_file and remote files.
* src/xdisp.c (decode_mode_spec): Don't intern file-remote-p.
(syms_of_xdisp) <Qfile_remote_p>: New defsym.
Michael Albinus [Sun, 21 Apr 2024 10:54:17 +0000 (12:54 +0200)]
Fix use of "dired" in Tramp
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Do not
use "--dired" when long format output isn't requested.
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'.
Michael Albinus [Sat, 20 Apr 2024 15:49:28 +0000 (17:49 +0200)]
gitlab-ci.yml adaptions
* test/infra/gitlab-ci.yml (test-filenotify-gio, test-eglot):
Add TEST_HOME.
(test-tree-sitter): Extend SELECTOR.
Stefan Monnier [Sat, 20 Apr 2024 15:23:58 +0000 (11:23 -0400)]
(backtrace--print-func-and-args): Fix (part of) bug#70436
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.
Stefan Monnier [Sat, 20 Apr 2024 15:17:39 +0000 (11:17 -0400)]
(cl-print-object): Fix indirect cause of bug#70436
* lisp/emacs-lisp/cl-print.el (cl-print-object): Fix specializer
for the byte-code case.
Po Lu [Sat, 20 Apr 2024 12:44:30 +0000 (20:44 +0800)]
Eliminate minor wart in EmacsService.java
* java/org/gnu/emacs/EmacsService.java (openContentUri): Replace
arg BYTES with URI and change its type to String.
* src/android.c (android_init_emacs_service):
* src/androidvfs.c (android_authority_name)
(android_authority_open): Adjust commentary and code to match.
Eli Zaretskii [Sat, 20 Apr 2024 11:36:02 +0000 (07:36 -0400)]
Merge from origin/emacs-29
ecb80e0e8aa ; Improve wording in documentation of 'not and 'null'
5971aa1fd32 * lisp/dnd.el (dnd-handle-movement): Avoid errors (bug#70...
bbc5204a0f3 * doc/misc/calc.texi: Improve indexing.
Eshel Yaron [Fri, 12 Apr 2024 20:41:10 +0000 (22:41 +0200)]
New command 'completion-preview-complete'
This command completes the symbol at point up to the longest
common prefix of all completions candidates. We also add an
indication of the longest common prefix in the completion
preview by highlighting that part of the preview with the
'completion-preview-exact' face. To facilitate these features
we change the way we store the completion candidates while the
preview is visible, to explicitly keep the common prefix along
with a list of its suffixes.
* lisp/completion-preview.el (completion-preview--try-table):
Return longest common prefix and list of suffixes instead of
list of full candidates. Add illustrative comment.
(completion-preview--capf-wrapper, completion-preview--update)
(completion-preview--show, completion-preview-insert)
(completion-preview-next-candidate): Adjust.
(completion-preview-common): New face.
(completion-preview-exact): Tweak to distinguish it from
'completion-preview-common'.
(completion-preview-complete): New command.
(completion-preview-active-mode-map): Bind it.
(completion-preview-mode): Mention it in docstring.
(completion-preview-commands): Add 'completion-preview-complete'.
(completion-preview--make-overlay): Simplify.
(completion-preview--internal-command-p): Remove.
(completion-preview-require-certain-commands): Update.
(completion-preview--inhibit-update): New inline function.
(completion-preview--inhibit-update-p): New local variable.
(completion-preview--post-command, completion-preview-hide):
Reset it to nil.
* test/lisp/completion-preview-tests.el
(completion-preview-tests--check-preview): Check the 'face'
property of both the first and last character. Update callers.
(completion-preview-insert-calls-exit-function)
(completion-preview-complete): New tests. (Bug#70381)
Eli Zaretskii [Sat, 20 Apr 2024 11:30:50 +0000 (14:30 +0300)]
; * lisp/treesit.el (treesit-parser-changed-ranges): Declare.
Mattias Engdegård [Sat, 20 Apr 2024 11:08:20 +0000 (13:08 +0200)]
Kill process in files-tests before exiting
* test/lisp/files-tests.el
(files-tests-file-name-non-special-start-file-process):
Make sure that the subprocess is killed before the test concludes.
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)
Mattias Engdegård [Sat, 20 Apr 2024 08:41:59 +0000 (10:41 +0200)]
Update gravatar-tests after URL escaping change (bug#70312)
* test/lisp/image/gravatar-tests.el (gravatar-default-image):
It seems we now escape less.
Eli Zaretskii [Sat, 20 Apr 2024 08:31:02 +0000 (11:31 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
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)
Michael Albinus [Sat, 20 Apr 2024 08:05:37 +0000 (10:05 +0200)]
* test/infra/Dockerfile.emba: Add libxml2-dev.
Michael Albinus [Sat, 20 Apr 2024 07:43:30 +0000 (09:43 +0200)]
Complete fix for eww-tests.el
* test/lisp/net/eww-tests.el (eww-test/readable/toggle-display)
(eww-test/readable/default-readable): Check for libxml. (Bug#70472)
Eli Zaretskii [Sat, 20 Apr 2024 07:32:34 +0000 (10:32 +0300)]
; * lisp/progmodes/eglot.el (eglot-path-to-uri): Add comment.
Eli Zaretskii [Sat, 20 Apr 2024 07:25:12 +0000 (10:25 +0300)]
; On MS-Windows, skip eglot test that creates symlinks
* test/lisp/progmodes/eglot-tests.el (eglot-test-basic-symlink):
Skip this test on MS-Windows.
Eli Zaretskii [Sat, 20 Apr 2024 06:53:35 +0000 (09:53 +0300)]
; Fix documentation of recent commits related to treesit
* src/treesit.c (Ftreesit_parser_changed_ranges):
* doc/lispref/parsing.texi (Using Parser): Fix wording.
Stefan Monnier [Sat, 20 Apr 2024 02:19:00 +0000 (22:19 -0400)]
(track-changes--call-signal): Silence late signals
* lisp/emacs-lisp/track-changes.el (track-changes--call-signal):
Skip the call if the tracker was unregistered.
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.
Yuan Fu [Tue, 16 Apr 2024 06:13:20 +0000 (23:13 -0700)]
; Minor fix in tree-sitter manual section
* doc/lispref/parsing.texi (User-defined Things): Mention
treesit-defun-type-regexp.
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.
* test/lisp/progmodes/eglot-tests.el (eglot-test-basic-symlink):
Address compilation warning. Tweak comment slightly.
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.
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
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.
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.
Po Lu [Fri, 19 Apr 2024 09:38:58 +0000 (17:38 +0800)]
* java/INSTALL: Update instructions.
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.
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].
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.
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.
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)
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.
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.
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.
Eli Zaretskii [Thu, 18 Apr 2024 10:45:22 +0000 (13:45 +0300)]
; * lisp/comint.el: Fix wording of last change.
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)
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
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)
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)
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'.
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)
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.
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)
Eli Zaretskii [Thu, 18 Apr 2024 08:45:47 +0000 (11:45 +0300)]
; * etc/NEWS: Reindent and refill recently added entries.
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.
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.
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.
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.
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.
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'.
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.
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.
Stefan Monnier [Wed, 17 Apr 2024 14:57:11 +0000 (10:57 -0400)]
* lisp/emacs-lisp/track-changes.el: Fix trailer
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.
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.
Robert Pluim [Wed, 17 Apr 2024 07:04:18 +0000 (09:04 +0200)]
; * src/xdisp.c (redisplay_internal): Typo fix in comment
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).
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.
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.
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)
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.
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.
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.
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)
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.
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.
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.
Basil L. Contovounesios [Mon, 15 Apr 2024 21:56:00 +0000 (23:56 +0200)]
; Fix last change to secrets-tests.el.
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`.
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.
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)
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)
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.
Eli Zaretskii [Mon, 15 Apr 2024 11:52:03 +0000 (14:52 +0300)]
; Improve wording in documentation of 'not and 'null'
* doc/lispref/control.texi (Combining Conditions):
* doc/lispref/lists.texi (List-related Predicates): Clarify
wording of 'not' vs 'null'. (Bug#70392)
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).
Dmitry Gutov [Sun, 14 Apr 2024 01:22:14 +0000 (04:22 +0300)]
; Capitalize 'project' in project-name's docstring
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)
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.
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.