Philipp Stephani [Wed, 30 Dec 2020 13:42:01 +0000 (14:42 +0100)]
Use posix_spawn if possible.
posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux. Use
it if we don't need to configure a pseudoterminal.
* configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
(HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New
configuration variables.
* src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro.
(emacs_posix_spawn_init_actions)
(emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New
helper functions.
(emacs_spawn): Use posix_spawn if possible.
Jim Porter [Thu, 11 Nov 2021 18:34:17 +0000 (19:34 +0100)]
Improve performance of 'file-name-case-insensitive-p' for Tramp files
Previously, each function in 'tramp-foreign-file-name-handler-alist'
would call 'tramp-dissect-file-name', resulting in it being called
several times whenever 'tramp-find-foreign-file-name-handler' was
called. Now, functions take the dissected file name to avoid this
duplicated effort. (Bug#51699)
* lisp/net/tramp.el (tramp-ensure-dissected-file-name): New function.
(tramp-find-foreign-file-name-handler): Pass dissected file name to
functions.
(tramp-connectable-p): Use 'tramp-ensure-dissected-file-name'.
Stefan Kangas [Thu, 11 Nov 2021 17:39:19 +0000 (18:39 +0100)]
erc: Don't announce broken functionality in /query docstring
* lisp/erc/erc.el (erc-cmd-QUERY): Be less enthusiastic about
announcing missing/broken functionality. The comment "except this is
broken right now" has been there since 2008, and it's not obvious to
me that we should ever re-add it.
Eli Zaretskii [Thu, 11 Nov 2021 14:55:11 +0000 (16:55 +0200)]
Fix 8-color PuTTY -nw sessions broken by a recent commit
* src/term.c (init_tty): Fix the change which introduced support
for the terminfo Tc flag. The code as installed broke colors in
PuTTY -nw sessions, because 'tigetflag' returned -1, which is
non-zero, so it was treated as the sign that true color is
supported. But if the value returned by 'tigetflag' is -1, it means
the capability is not a boolean one, so that's not to be used as a
valid support for 24-bit color. (Bug#44950)
Po Lu [Thu, 11 Nov 2021 10:45:52 +0000 (18:45 +0800)]
Add URI as a valid spec for xwidget-webkit-buffer-name-format
* lisp/xwidget.el (xwidget-webkit-buffer-name-format): Update
doc string.
(xwidget-webkit-callback): Add a format spec %U, which stands
for the current URI of the widget.
Stefan Kangas [Thu, 11 Nov 2021 06:17:56 +0000 (07:17 +0100)]
Merge from origin/emacs-28
2963de6540 * lisp/vc/vc-git.el (vc-git-mergebase): More meaningful er... a9148cdee5 ; Fix heading in etc/NEWS 9623342216 ; * etc/NEWS: Move a bookmark related item further down.
Gregory Heytings [Thu, 11 Nov 2021 05:43:10 +0000 (06:43 +0100)]
Options to automatically stop the Emacs server
* 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.
Miha Rihtaršič [Thu, 11 Nov 2021 05:16:52 +0000 (06:16 +0100)]
Set `minibuffer-completion-*` variables locally in more places
* lisp/calc/calc-store.el (calc-read-var-name):
* lisp/emacs-lisp/crm.el (completing-read-multiple):
* lisp/progmodes/cc-styles.el (c-read-offset):
* lisp/window.el (read-buffer-to-switch):
Set `minibuffer-completion-*` variables buffer-locally instead of
using a global let-binding (bug#48925).
Follow-up to commit
2021-05-01 "* lisp/minibuffer.el (completing-read-default): Fix bug#45474"
Re-fix charset issues when yanking non-plain-text elements
* lisp/select.el (gui-get-selection): Make (gui-get-selection
'CLIPBOARD 'text/html) get decoded correctly (bug#31149), but still
avoid the logic on Windows.
John Cummings [Thu, 11 Nov 2021 03:37:46 +0000 (04:37 +0100)]
Add tests for 'insert-directory'
* test/lisp/files-tests.el: Add 'insert-directory' tests.
* test/lisp/files-resources/insert-directory/: Create directories and files to
use for testing 'insert-directory'.
Add tests for 'insert-directory' base functionality and regression tests for
the issue where free space was reported for the current directory instead of
the target of 'list-directory' (Bug#50630).
Po Lu [Wed, 10 Nov 2021 13:01:40 +0000 (21:01 +0800)]
Add `xwidget-webkit-load-html'
* doc/lispref/display.texi (Xwidgets): Document new function.
* etc/NEWS: Announce new function.
* src/xwidget.c (Fxwidget_webkit_load_html): New function.
(syms_of_xwidget): Define new subr.
Eli Zaretskii [Wed, 10 Nov 2021 18:17:33 +0000 (20:17 +0200)]
Fix font weights on MS-Windows
* src/w32font.c (w32_decode_weight, w32_encode_weight)
(w32_to_fc_weight): Adjust weight translations to match those in
font.c and gtkutil.c:xg_weight_to_symbol. (Bug#51704)
Stefan Kangas [Wed, 10 Nov 2021 13:49:44 +0000 (14:49 +0100)]
Avoid spurious byte-compiler warnings in package-quickstart.el
* lisp/emacs-lisp/package.el (package-quickstart-refresh): Disable the
"`make-variable-buffer-local' not called at toplevel" byte-compiler
warnings. Given that we wrap it all in a let-form, these are mostly
false positives and not helpful.
Po Lu [Wed, 10 Nov 2021 01:22:38 +0000 (09:22 +0800)]
Set embedder correctly to fix menus appearing in the wrong location
* src/xwidget.c (record_osr_embedder, from_embedder, to_embedder): New
functions.
(Fmake_xwidget): Attach from-embedder and to-embedder signals.
(find_widget_for_offscreen_window): New function.
(xwidget_button, xwidget_motion_or_crossing): Set embedder on event.
(Fdelete_xwidget_view): Remove embedder status if applicable.
* src/xwidget.h (struct xwidget): New fields `embedder' and
`embedder-view'.
oldosfan [Mon, 1 Nov 2021 00:19:32 +0000 (08:19 +0800)]
Add support for event processing via XInput 2
* configure.ac: Add an option to use XInput 2 if available
* src/Makefile.in (XINPUT_LIBS, XINPUT_CFLAGS): New variables
(EMACS_CFLAGS): Add Xinput CFLAGS
(LIBES): Add XInput libs
* src/xmenu.c (popup_activated_flag): Expose flag if XInput 2 is
available
* src/xfns.c (x_window): Set XInput 2 event mask
* src/xterm.c (x_detect_focus_change): Handle XInput 2 GenericEvents
(handle_one_xevent): Handle XInput 2 events
(x_term_init): Ask the server for XInput 2 support and set xkb_desc if
available
(x_delete_terminal): Free XKB kb desc if it exists, and free XI2
devices if they exist
(x_free_xi_devices, x_init_master_valuators): New functions
(x_get_scroll_valuator_delta): New function
(init_xterm): Don't tell GTK to only use Core Input when built with
XInput 2 support
* src/xterm.h (struct x_display_info): Add fields for XKB and XI2
support
* src/gtkutil.c (xg_event_is_for_menubar): Handle XIDeviceEvents
(xg_is_menu_window): New function
(xg_event_is_for_scrollbar): Handle XIDeviceEvents
Stephen Gildea [Wed, 10 Nov 2021 04:09:22 +0000 (20:09 -0800)]
time-stamp: %F is "file name" not "pathname" + other doc
* lisp/time-stamp.el (time-stamp-format): doc 'file' instead of 'path'.
* test/lisp/time-stamp-tests.el (formatz, format-time-offset):
Clarify the difference and similarity between these two test helpers.
Tom Levy [Tue, 9 Nov 2021 12:25:24 +0000 (12:25 +0000)]
Remove spurious %S from 'define-error' messages
; The MESSAGE arg of 'define-error' does not support format specifiers
; (unlike the 'error' function). The signal data is automatically
; appended to the error message.
Po Lu [Tue, 9 Nov 2021 06:46:48 +0000 (07:46 +0100)]
Always set xwidget title if the event was "load-finished"
* lisp/xwidget.el (xwidget-webkit-callback): Always set title upon
load completion. This prevents loading pages such as "about:blank"
from not setting the buffer name (bug#51702).