* lisp/net/tramp-sh.el (tramp-get-remote-arg-max): New defun.
(tramp-open-connection-setup-interactive-shell): Use it.
* lisp/net/tramp.el (tramp-multi-hop-p-hook): New defvar.
(tramp-multi-hop-p): Use it.
(tramp-handle-make-process): Set TERM environment.
Now that emacsclient can receive long lines without problems,
don’t bother splitting long lines when sending to it.
* lisp/server.el (server-msg-size): Now obsolete.
(server-reply-print): Send qtext without trying to break it
into pieces (Bug#80807#49).
Commit 6942d508f0 made js-mode-regexp-syntax-bug-25529 fail,
because it changes the moment and place in which
`syntax-propertize` gets called, uncovering a bug where
`js-jsx--detect-after-change` narrows the buffer, then calls
`re-search-forward` which calls `syntax-propertize`, so we end
up doing `syntax-propertize` while narrowed which can fail in
all kinds of ways.
* lisp/progmodes/js.el (js-jsx--detect-and-enable): Change optional arg
to BEG and END.
(js-jsx--detect-after-change): Use them to avoid narrowing.
* lisp/emacs-lisp/syntax.el (syntax-propertize): Emit a message
when called narrowed and the narrowing starts later than the
nearest already propertized position.
* lisp/emacs-lisp/package.el (package-install-file): Assume it
is OK to set the visited file name, since we are not actually
touching anything on disk, and prevent the modified flag from
preventing us to kill the temporary buffer. The flag is set by
tar-mode.
* lisp/emacs-lisp/package.el (package--review-git-diff-command):
Add new constant to avoid duplicating the exact command as the
default value and in the type of the user option.
(package-review-diff-command): Use git-diff(1) if Git is
installed, and fall back to regular diff(1) otherwise. The
previous default value has been moved to the user option, as a
suggested alternative.
(package-review): Support the ability to use symbols, that get
replaced and expanded into the list of switches.
(Bug#80684)
Co-Authored-By: Daniel Mendler <mail@daniel-mendler.de>
* lisp/vc/vc-hg.el (vc-hg--active-bookmark-internal): Make it
work when default-directory is not the repository root.
(vc-hg--checkin): Use vc-hg--active-bookmark-internal instead of
vc-hg--working-branch.
* lisp/dired.el (dired--ls-accept-b-switch-p): New function.
(dired-internal-noselect): Use it in the condition on displaying
warning about filenames with newlines.
(dired--set-auto-toggle-b-switch): Use it to conditionalize
calling 'dired--toggle-b-switch'.
(dired-auto-toggle-b-switch, dired--toggle-b-switch): Improve doc
string.
* test/lisp/dired-tests.el (dired-test-filename-with-newline-1)
(dired-test-filename-with-newline-2): Skip unless Dired uses an
'ls' that supports the '-b' switch.
* etc/NEWS: Adjust accordingly the announcements of the Dired
warning and the new user option for file names with newlines.
* doc/misc/tramp.texi (Extension packages): Use another format
char in example.
(New operations): Document different argument types. Extend example.
* lisp/net/tramp.el: Use consequently `eq', `assq', `memq'.
(tramp-file-name-for-operation-external): Extend docstring.
(tramp-file-name-for-operation): Make more use of
`tramp-file-name-for-operation-external'.
(tramp-add-external-operation): New optional argument `arg-type'.
* test/lisp/net/tramp-tests.el (tramp--handle-test-operation):
Rename from `tramp--handler-for-test-operation'.
(tramp--handle-process-id)
(tramp--test-operation-file-name-for-operation): New defuns.
(tramp-test49-external-backend-function): Extend test.
Problem reported by Zhengyi Fu (bug#80844).
* lisp/server.el (server--process-filter-1, server-return-error)
(server-edit-abort): Append newline to -error commands, too.
Otherwise emacsclient has no reliable way to find the end of the
error command’s argument, except to wait for EOF which is
undesirable since the Emacs server keeps the socket open
for a while, waiting for emacsclient to exit.
Also add more bindings to M-x eglot-list-connections
* lisp/progmodes/eglot.el (eglot-list-connections-mode-map): Add
bindings for e, w, RET.
(eglot-events-buffer-of-listed-connection)
(eglot-show-workspace-configuration-of-listed-connection)
(eglot-describe-listed-connection): New commands.
(eglot-describe-connection): New command.
* doc/misc/eglot.texi: Document new keys and eglot-describe-connection.
* etc/EGLOT-NEWS: Announce.
* lisp/vc/vc.el (vc-rename-file): Replace broken attempted use
of vc-dir-status-files with walking OLD using vc-file-tree-walk.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-directory):
Assert that the files are registered or not as appropriate. New
test case in which there are only registered files.
* lisp/emacs-lisp/ert-x.el (ert-play-keys): new defun.
* test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo)
(undo-test-point-after-forward-kill): Use new function
`ert-play-keys' and `(ert-with-test-buffer (:selected t) ...)'
rather (with-temp-buffer (switch-to-buffer (current-buffer) ...)'.
* test/lisp/erc/erc-scenarios-spelling.el
(erc-scenarios-spelling--auto-correct): Use new function
`ert-play-keys' and `(ert-with-buffer-selected ...)' rather than
`execute-kbd-macro' and `(with-current-buffer
... (set-window-buffer nil (current-buffer) ...)'.
* doc/misc/ert.texi (Helper Functions): Document ert-play-keys,
and differences between ert-simulate-command, ert-simulate-keys
& ert-play-keys.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-x-tests-play-keys)
(ert-x-tests-simulate-command, ert-x-tests-simulate-keys): New
tests.
* lisp/progmodes/eglot.el (eglot-list-connections-mode-map): New
defvar.
* lisp/progmodes/eglot.el (eglot--list-connections-entries): New
function, extracted from eglot-list-connections.
* lisp/progmodes/eglot.el (eglot--list-connections-cmd): New macro.
* lisp/progmodes/eglot.el (eglot-shutdown-listed-connection)
(eglot-reconnect-listed-connection): New commands.
* lisp/progmodes/eglot.el (eglot-list-connections): Use
eglot--list-connections-entries.
* doc/misc/eglot.texi: Document eglot-list-connections and new keys.
* etc/EGLOT-NEWS: Announce.
Some LSP servers prefer to canonicalize all document URIs to
their "true name", chasing all fs symbolic links. If the user
is visiting a project under a symlink, say ~/myprojects/foo
which points to /data/true/projects/foo. When visiting a
~/myprojects/foo/f.c and trying to jump to a nearby file f.h via
LSP 'xref-find-definitions', the path should probably be
~/myproject/foo/f.h, not /data/true/projects/foo/f.h.
Even though Emacs can recognize that the two files are the same,
'buffer-file-name' is not. This confuses tools like C-x C-f,
ibuffer, and ultimately the users themselves who probably
oblivious to the true place of the project. After all they
started Eglot under a syminked file.
* lisp/progmodes/eglot.el (eglot-lsp-server): Add trueroot slot.
(eglot-uri-to-path): Rework to consider trueroot and project root.
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Make leading '|'
optional when there are leading spaces (bug#80681).
* etc/compilation.txt (GNU style): New error with two leading
spaces.
* test/lisp/progmodes/compile-tests.el
(compile-test-error-regexps): Increment expected
compilation-num-errors-found.
(compile-tests--test-regexps-data): New error test case for
'gnu' with two leading spaces. Change expected match for
'cucumber' to match again 'gnu'.
Copyright-paperwork-exempt: yes
* lisp/vc/vc.el (vc-rename-file): Don't call into the backend if
moving a directory containing only untracked files.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-directory):
New test for this case.