Passing arbitrary arguments to functions through
"emacsclient --eval" sometimes requires complicated escaping
to avoid them being parsed as Lisp (as seen in
emacsclient-mail.desktop before this change).
The new variable 'server-eval-args-left' allows access to the
arguments before they are parsed as Lisp. By removing
arguments from the variable before they're parsed, a snippet
of Lisp can consume arguments, as in emacsclient-mail.desktop.
org-protocol might be able to use this as well, which might allow it
to drop its current advice on server-visit-files.
* etc/emacsclient-mail.desktop: Use 'server-eval-args-left'.
* lisp/server.el (server-eval-args-left): New variable.
(server-process-filter, server-execute): Make '-eval' arguments
available through 'server-eval-args-left'.
* lisp/startup.el (argv): Mention 'server-eval-args-left' in
docstring.
* etc/NEWS: Announce 'server-eval-args-left'.
* doc/emacs/misc.texi (emacsclient Options): Document
'server-eval-args-left'. (Bug#65902)
755ae813a6 ; Declare some treesit.c functions in typescript-ts-mode.el.
89fa204b70 Fix loss of encrypted data in plstore.el
d9a1175a61 Close SQL database when corresponding 'sqlite-mode' buffe...
cbd8fac283 Fix Unicode normalization of characters
825be05b37 Support one-time passwords in Tramp
f880b94e64 Fix the 'C' and 'c' categories of characters
58fd212d8a Fix Emoji zooming commands
8970cdd009 ; Fix last change.
ba924be452 ; * etc/DEBUG: Improve the redisplay section.
e110312ad9 ; * doc/lispref/minibuf.texi (Text from Minibuffer): Ment...
65f4810003 tsx-ts-mode--font-lock-compatibility-bb1f97b: Improve
6fe11b88ed Avoid using --display in emacsclient to reuse frames on PGTK
2fc7463c0e ; * INSTALL: Don't advertise -O3. (Bug#65988)
29055412f2 ; Fix doc string of 'lsh'
738d854333 Support emacsclient on Windows with server on GNU or Unix...
f0a89fa1d0 ; * lisp/saveplace.el (save-place-ignore-files-regexp): F...
c9cb8ee0fc Fix defcustom in saveplace.el (Bug#65977)
5ec8be1d58 ; * lisp/subr.el (string-suffix-p, string-prefix-p): Doc ...
809305e6d8 Fix 'window-text-pixel-size' when there are several image...
ea14b0dcc2 : Doc fix.
01e8a0c6cb Doc fix for prettify-symbols-unprettify-at-point
0065621d0d (report_overlay_modification): Fix bug#65929
6cc6455e93 Fix SVG colors (bug#56182)
9396d73942 * doc/emacs/text.texi (Outline Minor Mode): Add a note ab...
a65d1a5a16 Improve documentation of 'list-abbrevs'
5dcc4b7eab Tweak s-p-f for js-ts-mode
1fb2fb501f typescript-ts-mode, tsx-ts-mode: Fix syntax properties fo...
946b395e7e * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Provide (bug...
33ee3e588f Fix regression of treesit_cursor_helper_1
d11d81dfcc ; Fix doc typos (Bug#65868)
6554ec2246 Update docs for passing of Thien-Thi Nguyen
5ab2792d5c Update defvar usage tips example in manual
35d88c657e Document using Flymake together with Eglot
3f04efe9e7 ; * src/font.h (struct font): Comment about use of averag...
459b5f6b6d ; * admin/authors.el (authors-aliases): Update.
0c029ae8bc ; tweak etc/TODO item
# Conflicts:
# admin/authors.el
# lisp/subr.el
* lisp/server.el (server-process-filter): If 'tty-name' is literally
"CONOUT$", assume the client runs on MS-Windows and force the
frame type to GUI. This allows to run emacsclient on MS-Windows
when the server runs on a Posix host. (Bug#65812)
* lisp/files.el (find-alternate-file-dont-kill-client): New var.
(find-alternate-file): Bind it to a special value when invoking
kill-buffer-hook.
* lisp/server.el (server-delete-client): If NOFRAME is
'dont-kill-client', don't kill the client and its terminals.
(server-buffer-done): Pass 'find-alternate-file-dont-kill-client'
to 'server-delete-client'. (Bug#65277)
* lisp/server.el (server-process-filter, server-return-error):
Display the error message to be sent to the client as a regular
message, to give the user the opportunity to see it. Delete the
terminal immediately after sending the error message to the
client, to make sure the terminal's modes are restored.
(Bug#63629)
cae528457c ; Add 2023 to copyright years.
b394359261 Improve documentation of 'isearch-open-overlay-temporary'
ab3210e709 Document 'use-package' in the 2 main manuals
# Conflicts:
# etc/refcards/ru-refcard.tex
# lib/explicit_bzero.c
# m4/explicit_bzero.m4
* lisp/server.el (server-eval-at): Revert to old code for determining
the server file. The recent change to call server--file-name meant
that the SERVER argument to server-eval-at was ignored.
This changes the meaning of the (formerly internal) variable
'server-stop-automatically': it now always holds the requested
configuration, even when Emacs was not started as a daemon
(bug#59668).
* lisp/server.el (server-stop-automatically): Convert the variable to
a defcustom, and make the function simply set the defcustom.
(server-stop-automatically--timer): New variable.
(server-apply-stop-automatically): New function...
(server-stop, server-start): ... call it.
(server-save-buffers-kill-terminal): Adjust the conditions for
stopping automatically to account for the change of meaning for
'server-stop-automatically'.
(server-stop-automatically--handle-delete-frame): Remove unnecessary
test of the 'server-stop-automatically' option; this hook is only set
when it should do its job.
(server-stop-automatically--maybe-kill-emacs): Update docstring.
* doc/emacs/misc.texi (Emacs Server): Update documentation.
* lisp/server.el (server-stop-automatically--handle-delete-frame):
Since 'this-command' is never 'save-buffers-kill-terminal' in this
function, we can remove the second 'if' block and it's then-form,
leaving only the else-form. Additionally, remove the 'delete-frame'
call; it's not necessary, since we just killed Emacs on the prior
line.
Previously, if 'server-stop-automatically' was configured for
'kill-terminal' or 'delete-frame', killing a client via
'save-buffers-kill-terminal' wouldn't prompt about the saving files in
the client's buffer list (as it does when not using those settings).
This change ensures that those settings only apply when killing the
last client, as described in the manual (bug#51993).
* lisp/server.el (server-save-buffers-kill-terminal): Handle
'server-stop-automatically' behavior in this function, rather than
calling 'server-stop-automatically--handle-delete-frame'.
* lisp/server.el (server-stop): Return non-nil when we actually stop
the server. Don't message about stopping the server here (but do log
it).
(server-start): Emit the appropriate message about stopping or
restarting the server.
* lisp/emacs-lisp/ert.el (ert--insert-infos): Allow 'message' to be a
function that is called when inserting the info.
(ert-info): Update docstring to describe using a function for
MESSAGE-FORM.
* lisp/server.el (server-start): Log when the server is starting.
* test/lisp/server-tests.el (server-tests/can-create-frames-p): New
constant. Use it to skip tests that need to create frames.
(server-tests/start-emacsclient): Rename to...
(server-tests/start-client): ... this, and set the process's buffer.
(server-tests/with-server): Put the server file in a temporary
directory so we don't conflict with real Emacs servers.
(server-tests/with-client): New macro...
(server-tests/server-start/stop-prompt-with-client)
(server-tests/emacsclient/server-edit)
(server-tests/emacsclient/create-frame)
(server-tests/emacsclient/create-frame): ... use it.
(server-tests/server-start/stop-prompt-with-client): Simplify.
This eliminates a useless error prompt when killing Emacs from a
client frame when there are no other frames (bug#58877).
* lisp/server.el (server-running-external): New error.
(server--file-name): New function...
(server-eval-at): ... use it.
(server-start): Factor out server stopping code into...
(server-stop): ... here.
(server-force-stop): Use 'server-stop', and tell it not to delete
frames.
* test/lisp/server-tests.el
(server-tests/server-force-stop/keeps-frames): New test.
* lisp/server.el (server-start): Use 'locale-coding-system' to
encode messages sent back to the client.
* lib-src/emacsclient.c (main): Print '-error' messages via
'message', not directly via 'fprintf'. This shows the error on
MS-Windows when the client is invoked as 'emacsclientw', since
stderr goes to the bit bucket in that case.
* lisp/server.el (server-mode-map): New keymap...
(server-mode): ... use it.
(server-start): Update the 'server-mode' variable (and sync to
'global-minor-modes') when starting/stopping the server.
* test/lisp/server-tests.el: New file (bug#58909).
The vast majority of these are unused in-tree, and many of them
perform actions that aren't obvious when reading the code.
* lisp/server.el (server-ensure-safe-dir): Prefer with-file-modes
over letf-ing default-file-modes.
(server-start): Ditto.
* lisp/winner.el (winner-set-conf): Don't use generalized variable
window-height.
* lisp/emacs-lisp/gv.el: Make most little-used generalized
variables obsolete.
* lisp/org/oc-basic.el (org-cite-basic--set-keymap): Adjust
buffer-substring generalized variable usage.
Fix two problems with our handling of X timestamps
1) We're not properly updating the X interaction timestamp after
receiving certain input events, and
2) X events sent in response to emacsclient commands get stale
timestamps because the timestamp tracking doesn't take into account
that interactions with the user can occur outside the X input
event channel.
* src/xterm.c:
(x_display_set_last_user_time_1): New function.
(x_display_set_last_user_time): Call it.
(x_ewmh_activate_frame): Refactor.
(x_focus_frame): Don't call XSetInputFocus if we can use EWMH activation.
(server_timestamp_predicate): New function.
(x_get_server_time): New function.
(x_note_oob_interaction): New function.
(x_create_terminal): Register new function as terminal hook.
* src/termhooks.h: New hook: note_oob_interaction_hook.
* src/gtkutil.h:
(xg_set_user_timestamp): Declare.
* src/gtkutil.c:
(xg_set_user_timestamp): New function.
* src/frame.c:
(Fframe_note_oob_interaction): New function.
(syms_of_frame): Register it.
* lisp/server.el:
(server-switch-buffer): Call frame-note-oob-interaction when user
requests frame be raised.
* lisp/server.el (server-process-filter): Add part of patch that
was mistakenly missed when the patch was applied (bug#24147).
This also fixes bug#56309.
* lisp/simple.el (get-scratch-buffer-create): New function, factored
out of scratch-buffer, and additionally clearing the modification flag
and calling substitute-command-keys (bug#55257).
(scratch-buffer):
* lisp/server.el (server-execute):
* lisp/startup.el (normal-no-mouse-startup-screen, command-line-1):
* lisp/window.el (last-buffer, window-normalize-buffer-to-switch-to):
* src/buffer.c (Fother_buffer, other_buffer_safely): Use it.
(syms_of_buffer): Add Qget_scratch_buffer_create.
* lisp/startup.el (startup--get-buffer-create-scratch): Delete
now-unused function.
* doc/lispref/os.texi (Summary: Sequence of Actions at Startup):
* NEWS (Incompatible changes in Emacs 29.1): Document the change.
* lisp/server.el: Require subr-x when compiling.
(server-execute): Initialize the *scratch* buffer in the same way that
the scratch-buffer command does, for consistency.
* doc/emacs/misc.texi (Emacs Server): Document the new function.
Also mention that an Emacs server can be started with emacsclient.
* etc/NEWS: Describe the new function (bug#51377).
* lisp/server.el (server-stop-automatically): New function.
(server-stop-automatically): New auxiliary variable.
(server-stop-automatically--maybe-kill-emacs)
(server-stop-automatically--handle-delete-frame): New auxiliary
functions.
(server-save-buffers-kill-terminal): Call the new auxiliary
function when necessary.
lisp/server.el (server-handle-delete-frame): Use 'seq-some' to
determine if another frame for the current client exists.
(server-kill-emacs-query-function): Use 'seq-some' to determine if
another live client exists (bug#51420).