Jeff Walsh [Sun, 26 Sep 2021 14:20:57 +0000 (00:20 +1000)]
pgtk: Handle (child) frame focusing better
child frames on pgtk are gtk widgets inside the parent surface, rather
than subsurfaces (in wayland ters), and the edit widget is handled
separately from the parent window, so we need to handle signals more
correctly, rather than squinting and assuming an event for the window
is just an event for the edit widget.
* src/gtkutil.c (xg_set_no_accept_focus): set
focus on widget rather than request it on window
* src/pgtkterm.c (pgtk_focus_frame): focus frame on edit_widget
instead
(button_event): Implement focus calls to replace dead X calls
Po Lu [Sat, 13 Nov 2021 03:24:13 +0000 (11:24 +0800)]
Fix file chooser hangs inside xwidget-webkit
* src/xwidget.c (run_file_chooser_cb): New function that runs
a nested event loop instead of acting asynchronously.
(Fmake_xwidget): Attach file chooser signal.
Alan Mackenzie [Fri, 12 Nov 2021 18:43:22 +0000 (18:43 +0000)]
In insert_file_contents, always set windows' point markers.
This fixes bug #51776.
* src/fileio.c (restore_window_points): Restore a w->mpoint even when that
marker originally pointed into the unchanged area near BOB or EOB. This
prevents that window's point being moved a long way from its starting place
due to the removal of the central part of the buffer by insert_file_contents.
* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled): Don't check Emacs version.
(tramp-gvfs-handler-mounted-unmounted): Use `make-tramp-file-name'.
* lisp/net/tramp-integration.el (rfn-eshadow-overlay):
Remove declaration.
(top): Don't use `tramp-compat-funcall' for connection-local functions.
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
Use `tramp-rclone-handle-file-readable-p'.
(tramp-rclone-handle-file-readable-p): New defun.
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
Use `tramp-handle-file-readable-p'.
* lisp/net/tramp.el (tramp-temp-name-prefix, tramp-lookup-syntax):
Adapt docstring.
(tramp-set-connection-local-variables)
(tramp-set-connection-local-variables-for-buffer): Don't use
`tramp-compat-funcall' for connection-local functions.
(tramp-file-name-for-operation): Reorder list.
(tramp-handle-make-symbolic-link): Don't handle TARGET and
OK-IF-ALREADY-EXISTS.
(tramp-read-passwd): Don't use `read-passwd' any longer.
(top): Don't check for `interrupt-process-functions'.
* test/lisp/net/tramp-archive-tests.el (tramp-archive--test-emacs26-p):
Remove.
(tramp-archive-test02-file-name-dissect): Use `make-tramp-file-name'.
(all): Replace Emacs 26 compatibility functions with their
original name.
(tramp-archive-test46-auto-load)
(tramp-archive-test46-delay-load): Rename.
* test/lisp/net/tramp-tests.el (dired-aux, seq): Require them.
(dired-compress, connection-local-criteria-alist)
(connection-local-profile-alist, async-shell-command-width):
Don't declare.
(all): Replace Emacs 26 compatibility functions with their
original name.
(tramp-test04-substitute-in-file-name)
(tramp-test10-write-region, tramp-test11-copy-file)
(tramp-test12-rename-file, tramp-test15-copy-directory)
(tramp-test17-insert-directory)
(tramp-test17-dired-with-wildcards, tramp-test21-file-links)
(tramp-test31-interrupt-process)
(tramp-test34-connection-local-variables)
(tramp-test34-explicit-shell-file-name)
(tramp-test40-make-nearby-temp-file)
(tramp-test41-special-characters, tramp-test42-utf8)
(tramp-test46-delay-load, tramp-test46-remote-load-path)
(tramp-test47-unload): Don't check for Emacs 26 special features.
(tramp--test-emacs26-p): Remove.
(tramp--test-emacs29-p): New defun.
(tramp-test45-dired-compress-file)
(tramp-test45-dired-compress-dir): Use it.
(tramp-test44-asynchronous-requests): Use `seq-random-elt'.
Po Lu [Fri, 12 Nov 2021 09:48:56 +0000 (17:48 +0800)]
Add support for input methods to xwidget-webkit-edit-mode
* lisp/xwidget.el (xwidget-webkit--input-method-events): New
variable.
(xwidget-webkit-pass-command-event-with-input-method): New
function.
(xwidget-webkit-pass-command-event): Consult input method about
key events if input method is enabled.
Noam Postavsky [Fri, 12 Nov 2021 09:21:45 +0000 (10:21 +0100)]
Optimize admin/nt dependency computation
admin/nt/dist-build/build-dep-zips.py (immediate_deps)
(extract_deps): Gather package dependency info in batches, rather than
one at a time. This reduces the number of invocations of 'pacman -Si
...' to the depth of the dependency tree, rather than the number of
dependent packages.
(top-level): Don't call 'extract_deps' when given the '-l' option (bug#40628).
Po Lu [Fri, 12 Nov 2021 06:29:40 +0000 (14:29 +0800)]
Remove obsolete comment
The comment probably dated back to when xwidgets supported
many other GTK+ widgets with other data. In the current
implementation of xwidgets, everything that should be freed
is already freed in `kill_buffer_xwidgets'.
Stefan Kangas [Fri, 12 Nov 2021 06:17:11 +0000 (07:17 +0100)]
Merge from origin/emacs-28
a6905e90cc Fix problem with temp buffer killing in package-install-file 144ad77fda Fix Lisp Intro markup error 24b86cb4f7 Fix ACL errors with WebDAV volumes on MS-Windows
Po Lu [Fri, 12 Nov 2021 06:04:38 +0000 (14:04 +0800)]
Add input method support for xwidget webkit isearch
* lisp/xwidget.el (xwidget-webkit-isearch--read-string-buffer):
New variable.
(xwidget-webkit-isearch-printing-char-with-input-method)
(xwidget-webkit-isearch-with-input-method): New function.
(xwidget-webkit-isearch-printing-char): Add support for Emacs
input methods. (bug#51781)
Stefan Kangas [Fri, 12 Nov 2021 03:10:40 +0000 (04:10 +0100)]
image-dired: Revamp slideshow functionality
* lisp/image-dired.el
(image-dired-slideshow-delay): New defcustom.
(image-dired--slideshow-initial): New defvar.
(image-dired-slideshow-start): Don't show any prompts when starting a
slideshow, unless user gave a negative prefix argument. Use the value
of the above new defcustom as the default delay.
(image-dired-slideshow-stop): Don't count number of images. Instead,
continue the slideshow until the next command.
(image-dired-slideshow-step): Use the correct buffer.
(image-dired-slideshow-count, image-dired-slideshow-times): Make
obsolete.
(image-dired--slideshow-timer): Rename from
'image-dired-slideshow-timer'. Make the old name into an obsolete
variable alias.
(image-dired-display-image-mode-map)
(image-dired-thumbnail-mode-map): Bind 'image-dired-slideshow-start'
to "S".
(image-dired-thumbnail-mode-menu): Add 'image-dired-slideshow-start'.
Allow using /dev/stdin as a --script parameter again
* lisp/startup.el (command-line-1): Fix breakage with
(file-truename "/dev/stdin") => "/proc/227795/fd/pipe:[1381505]"
when using /dev/stdin as a --script parameter.
Po Lu [Fri, 12 Nov 2021 02:36:57 +0000 (10:36 +0800)]
Check for WebKit xwidgets inside all xwidget-webkit functions
This is done in preparation for the introduction of other
xwidgets, such as media xwidgets, even though there are
only WebKit widgets at present.
* src/xwidget.c (CHECK_WEBKIT_XWIDGET): New macro.
(WEBKIT_FN_INIT): Use CHECK_WEBKIT_XWIDGET.
(Fxwidget_webkit_search, Fxwidget_webkit_next_result)
(Fxwidget_webkit_previous_result)
(Fxwidget_webkit_finish_search)
(Fxwidget_webkit_load_html): Check that xwidget is a WebKit
widget.
Allow stopping animations automatically when the image disappears
* lisp/image.el (image-animate): Allow the animation to be stopped
automatically when the image is removed from the buffer.
(image-animate-timeout): Stop the animation if the image is
removed (and that has been requested).
* lisp/net/shr.el (shr-put-image): Stop animations if the image is
removed.
(syms_of_xwidget): Define new symbols and subrs and define
appropriate weakness of id_to_xwidget map.
(kill_buffer_xwidgets): Check live xwidgets instead of
killed xwidgets, set xwidget buffer to nil, and rely on GC to
free the hash table for us instead.
* src/xwidget.h (XWIDGET_LIVE_P, CHECK_LIVE_XWIDGET): New
macros.
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.