summaryrefslogtreecommitdiff
path: root/lisp/server.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* Support emacsclient on Windows with server on GNU or Unix systemsEli Zaretskii2023-09-151-3/+6
| | | | | | | * 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)
* ; Clarify documentation of 'server-after-make-frame-hook'Eli Zaretskii2023-07-301-2/+4
| | | | | | | | * doc/lispref/frames.texi (Creating Frames): * lisp/server.el (server-after-make-frame-hook): Clarify documentation of 'server-after-make-frame-hook'. (Bug#64873) (cherry picked from commit e650a14f64b9ebea69615c19ca4466c14af35857)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Make emacsclient add abbreviated file names to file-name-historyEli Zaretskii2022-12-191-1/+1
| | | | | | * lisp/server.el (server-visit-files): Use 'file-name-history--add' to add the visited files to history. (Bug#60097)
* server-eval-at: Don't call server--file-nameSean Whitton2022-12-081-4/+5
| | | | | | * 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.
* Make killing a non-last client work the same no matter the auto-stop settingJim Porter2022-12-041-23/+37
| | | | | | | | | | | | | 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'.
* ; Don't emit a "Server stopped" message when restarting the Emacs serverJim Porter2022-11-271-10/+12
| | | | | | | | * 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.
* Improve robustness of server.el testsJim Porter2022-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | * 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.
* ; * lisp/server.el (server-start): Fix a typo in a warning message.Jim Porter2022-11-251-1/+1
|
* Don't explicitly delete client frames when killing Emacs anywayJim Porter2022-11-241-53/+77
| | | | | | | | | | | | | | | | 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.
* Fix encoding and display of messages sent by server to emacsclientEli Zaretskii2022-11-191-1/+4
| | | | | | | | | | * 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.
* Enable/disable 'server-mode' when starting/stopping the serverJim Porter2022-11-161-2/+10
| | | | | | | | | * 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).
* Don't prompt when killing an Emacs client if it's the last clientJim Porter2022-10-101-7/+12
| | | | | * lisp/server.el (server-kill-emacs-query-function): Ignore the current client (if any) when checking for live clients (bug#58404).
* Merge from origin/emacs-28Stefan Kangas2022-09-061-20/+21
|\ | | | | | | | | ecbdb3b0ad * lisp/server.el: Improve Commentary. ee5c591249 Explain how the font appearance can be fine-tuned in fbterm.
| * * lisp/server.el: Improve Commentary.Stefan Kangas2022-09-051-20/+21
| |
* | Make many seldom-used generalized variables obsoleteLars Ingebrigtsen2022-08-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Revert "Improve X event timestamp tracking"Po Lu2022-08-071-3/+1
| | | | | | | | | | | | | | This reverts commit 4b98a79a508ebdc719abfcf51ee6de32e46d0e1c. This change was installed without answering several important questions.
* | Improve X event timestamp trackingDaniel Colascione2022-08-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix typo in previous server.el changeLars Ingebrigtsen2022-06-301-1/+1
| | | | | | | | * lisp/server.el (server-process-filter): Fix typo in previous change.
* | Don't ignore emacsclient's --frame-parameters option when -tMichael Shields2022-06-301-1/+2
| | | | | | | | | | | | * 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.
* | Factor out *scratch* initializationSean Whitton2022-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Revert "server-execute: Initialize the *scratch* buffer"Sean Whitton2022-05-041-11/+4
| | | | | | | | | | | | This reverts commit f2d2fe6fc8ef0b6087c4a8a69d05a4e521b23047. To be replaced with factoring out *scratch* buffer initialization.
* | server-execute: Initialize the *scratch* bufferSean Whitton2022-05-031-4/+11
| | | | | | | | | | | | * 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.
* | Ensure local `default-directory' when calling `process-attributes'.Michael Albinus2022-04-081-1/+2
| | | | | | | | | | | | * lisp/server.el (server-running-p): * lisp/subr.el (memory-limit): Ensure local `default-directory' when calling `process-attributes'.
* | Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-11-131-21/+100
|\ \
| * | ; * lisp/server.el (server-stop-automatically): Doc fix.Eli Zaretskii2021-11-111-13/+15
| | |
| * | Options to automatically stop the Emacs serverGregory Heytings2021-11-111-21/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-11-111-20/+20
|\| |
| * | Be more efficient when checking for a matching client in server.elJim Porter2021-10-271-12/+12
| | | | | | | | | | | | | | | | | | | | | 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).
| * | Remove redundant #' before lambdaStefan Kangas2021-10-211-6/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/unidata/unidata-gen.el (unidata-gen-table) (unidata-gen-table-symbol, unidata-gen-table-integer) (unidata-gen-table-numeric, unidata-gen-table-word-list) (unidata-describe-decomposition): * lisp/apropos.el (apropos-user-option): * lisp/bookmark.el (bookmark-bmenu-search): * lisp/composite.el (unicode-category-table): * lisp/elec-pair.el (electric-pair--balance-info): * lisp/electric.el (electric-quote-chars): * lisp/emulation/cua-base.el (cua-rectangle-mark-key): * lisp/epa-hook.el (epa-file-encrypt-to): * lisp/faces.el (face-font-selection-order) (face-font-family-alternatives, face-font-registry-alternatives) (face-valid-attribute-values, tty-run-terminal-initialization): * lisp/files.el (recover-file, file-expand-wildcards): * lisp/frame.el (frames-on-display-list): * lisp/help-at-pt.el (help-at-pt-display-when-idle): * lisp/help-fns.el (help-fns--face-attributes): * lisp/ido.el (ido-mode, ido-unc-hosts): * lisp/isearch.el (isearch-highlight-regexp) (isearch-highlight-lines-matching-regexp): * lisp/language/indian.el (script-regexp-alist): * lisp/language/lao.el: * lisp/leim/quail/ipa.el (ipa-x-sampa-prepend-to-keymap-entry): * lisp/mh-e/mh-folder.el (mh-process-commands): * lisp/mh-e/mh-mime.el (mh-display-with-external-viewer): * lisp/ps-mule.el (ps-mule-end-job): * lisp/ps-print.el (ps-color-scale, ps-background-pages) (ps-background-text, ps-background-image, ps-background) (ps-begin-job, ps-print-translation-table): * lisp/recentf.el (recentf-sort-ascending) (recentf-sort-descending, recentf-sort-basenames-ascending) (recentf-sort-basenames-descending) (recentf-sort-directories-ascending) (recentf-sort-directories-descending): * lisp/replace.el (occur-engine-add-prefix): * lisp/select.el (xselect--encode-string): * lisp/server.el (server-use-tcp): * lisp/ses.el (ses-sort-column): * lisp/sort.el (sort-columns): * lisp/term/ns-win.el (window-system-initialization): * lisp/tree-widget.el (tree-widget-image-formats): * lisp/whitespace.el (whitespace-report-region): Remove redundant #' before lambda.
| * ; More minor stylistic fixes found by checkdocStefan Kangas2021-09-221-1/+1
| |
| * ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-1/+1
| |
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-07-041-1/+11
|\|
| * If the daemon’s TTY is our only frame, create a new framePeter Oliver2021-06-221-1/+11
| | | | | | | | | | * server.el (server-process-filter): If there won't be a current frame to use, fall back to trying to create a new one (bug#11033).
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-06-131-1/+14
|\|
| * Add a new `server-edit-abort' commandHarald Hanche-Olsen2021-06-041-1/+14
| | | | | | | | | | | | | | | | | | * doc/emacs/misc.texi (Invoking emacsclient): Document it (bug#11358). * lisp/server.el (server-edit): Mention it in the doc string. (server-edit-abort): New command. Copyright-paperwork-exempt: yes
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-05-191-1/+6
|\|
| * Don't delete socket on server exit if it was passed inLars Ingebrigtsen2021-05-081-1/+6
| | | | | | | | | | * lisp/server.el (server-sentinel): Don't delete the socket if it was passed in to Emacs (bug#47511).
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-02-061-4/+2
|\|
| * Prefer defvar-local in remaining librariesStefan Kangas2021-02-021-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/align.el (align-mode-rules-list) (align-mode-exclude-rules-list): * lisp/bookmark.el (bookmark-current-bookmark) (bookmark-annotation-name) (bookmark--annotation-from-bookmark-list): * lisp/calc/calc-embed.el (calc-embedded-all-active) (calc-embedded-some-active): * lisp/comint.el (comint-password-function): * lisp/completion.el (completion-syntax-table): * lisp/dframe.el (dframe-track-mouse-function) (dframe-help-echo-function, dframe-mouse-click-function) (dframe-mouse-position-function, dframe-timer) (dframe-attached-frame, dframe-controlled): * lisp/ehelp.el (electric-help-orig-major-mode): * lisp/eshell/esh-util.el (eshell-path-env): * lisp/expand.el (expand-pos, expand-index, expand-point): * lisp/face-remap.el (text-scale-mode-remapping) (text-scale-mode-lighter, text-scale-mode-amount) (text-scale-remap-header-line, buffer-face-mode-remapping): * lisp/ffap.el (ffap-menu-alist): * lisp/files-x.el (connection-local-variables-alist): * lisp/foldout.el (foldout-fold-list, foldout-mode-line-string): * lisp/follow.el (follow-start-end-invalid): * lisp/forms.el (forms--mode-setup): * lisp/gnus/message.el (message-cross-post-old-target) (message-options): * lisp/help-mode.el (help-xref-stack, help-xref-forward-stack) (help-xref-stack-item, help-xref-stack-forward-item): * lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay): * lisp/hilit-chg.el (hilit-chg-string): * lisp/ido.el (ido-eoinput): * lisp/imenu.el (imenu-generic-expression) (imenu-create-index-function, imenu-default-goto-function) (imenu-prev-index-position-function) (imenu-extract-index-name-function, imenu-name-lookup-function) (imenu-syntax-alist, imenu-case-fold-search): * lisp/jka-compr.el (jka-compr-really-do-compress): * lisp/language/ethio-util.el (ethio-prefer-ascii-space): * lisp/leim/quail/hangul.el (hangul-input-method-help-text): * lisp/leim/quail/japanese.el (quail-japanese-package-saved): * lisp/linum.el (linum-overlays, linum-available): * lisp/man.el (Man-original-frame, Man-arguments, Man--sections) (Man--refpages, Man-page-list, Man-current-page) (Man-page-mode-string): * lisp/pcomplete.el (pcomplete-current-completions) (pcomplete-last-completion-length) (pcomplete-last-completion-stub, pcomplete-last-completion-raw) (pcomplete-last-window-config, pcomplete-window-restore-timer): * lisp/reveal.el (reveal-open-spots, reveal-last-tick): * lisp/ruler-mode.el (ruler-mode): * lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save): * lisp/server.el (server-buffer-clients, server-existing-buffer): * lisp/tab-line.el (tab-line-exclude): * lisp/tar-mode.el (tar-data-buffer, tar-data-swapped): * lisp/thumbs.el (thumbs-current-tmp-filename) (thumbs-current-image-filename, thumbs-extra-images) (thumbs-image-num, thumbs-buffer, thumbs-marked-list): * lisp/tutorial.el (tutorial--point-before-chkeys) (tutorial--point-after-chkeys, tutorial--lang): * lisp/url/url-vars.el (url-current-object) (url-current-mime-headers, url-current-lastloc): * lisp/view.el (view-mode, view-old-buffer-read-only) (view-old-Helper-return-blurb, view-page-size) (view-half-page-size, view-last-regexp, view-return-to-alist) (view-exit-action, view-overlay): * lisp/wid-edit.el (widget-global-map, widget-field-new) (widget-field-list, widget-field-last, widget-field-was): * lisp/woman.el (woman-imenu-done): Prefer defvar-local.
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-01-031-1/+1
|\|
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2020-12-271-3/+3
|\|
| * Revert recent server.el frame-focus changesLars Ingebrigtsen2020-12-231-3/+3
| | | | | | | | | | | | | | * lisp/server.el (server-switch-buffer, server-execute): Revert 9cef8fc8cdb5e6e18c9cf617eed3808d67ca340e and c5f2eb56c0164e87abc881955552e0b718921186. This change led to regressions in non-new-frame circumstances.
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2020-12-211-2/+2
|\|
| * Fix previous frame-focus server.el changeLars Ingebrigtsen2020-12-181-2/+2
| | | | | | | | | | * lisp/server.el (server-execute): Always give Emacs focus, whether we open a new frame or not.
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2020-12-141-8/+18
|\|