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).
Optionally use use xwidgets to display <video> elements in shr
* doc/misc/eww.texi (Advanced): Document it.
* lisp/net/shr.el (shr-use-xwidgets-for-media): New user option.
(shr-tag-video): Use xwidgets to display <video> elements.
Feng Shu [Tue, 9 Nov 2021 03:52:59 +0000 (04:52 +0100)]
xwidget.el: limit buffer-name flicker in mode-line
* lisp/xwidget.el (xwidget-webkit): New customization group.
(xwidget-webkit-buffer-name-prefix): New user option.
(xwidget-webkit-callback): with-current-buffer only after get title,
which can limit buffer-name change in mode-line.
(xwidget-webkit-new-session, xwidget-webkit-import-widget): Use
current buffer to generate a temp xwidget-webkit buffer.
Fix local variables overwritten when diff-mode is set
* lisp/vc/diff-mode.el (diff-mode):
(diff-setup-buffer-type): Defun to initialize `diff-buffer-type'
* lisp/vc/vc.el (vc-diff-finish): Set `diff-buffer-type' after content
inserted
(vc-diff-internal): Restore `diff-mode' being set before local
variables (bug#51016).
Use word boundaries in the "Version Control" regexp to match mode names
"Log-Edit", "Log-View", "Git-Log-View", "Change Log", "VC dir",
but not "Verilog", "Prolog", "Rlogin" (bug#51337).