* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Make the previous
change work with relative file names, too.
Make all vc-*-responsible-p functions return a string
* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-dav.el (vc-dav-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Return a file name
instead of t when we get a match (which is what
vc-backend-for-registration expects) (bug#51800).
Kévin Le Gouguec [Sun, 14 Nov 2021 01:30:06 +0000 (02:30 +0100)]
Fix customization group of python-forward-sexp-function
* lisp/progmodes/python.el (python-forward-sexp-function): Move from
the "Flymake integration" subsection to the "Navigation" subsection,
so that the option is sorted into the 'python' group rather than the
'python-flymake' group (bug#51807).
Alan Mackenzie [Sat, 13 Nov 2021 18:33:17 +0000 (18:33 +0000)]
Fix follow-scroll-down in a small buffer which starts slightly scrolled
This fixes bug #51814.
* lisp/follow.el (follow-scroll-down): Do away with the optimization of doing
vertical-motion over only one window. Instead move over all windows, to
checck for being close to point-min, and setting point accordingly.
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.
Backported from commit a60053f8368e058229721f1bf1567c2b1676b239.
Unlike that commit, only define USABLE_POSIX_SPAWN on macOS, because
there posix_spawn is much faster than vfork.
Don't merge to master.
* 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.
Stephen Gildea [Sat, 13 Nov 2021 15:00:30 +0000 (07:00 -0800)]
MH-E threads code: use mh-scan variables correctly
* lisp/mh-e/mh-thread.el (mh-thread-current-indentation-level)
(mh-thread-find-children): Fix off-by-one error by using
'mh-scan-field-from-start-offset' directly, as
'mh-thread-parse-scan-line' does. Previously, these functions would
incorrectly consider the "date note" column as part of the thread
indenting. Since that column is almost always a Space character, that
almost always worked.
(mh-thread-ancestor): Update caller.
* test/lisp/mh-e/mh-thread-tests.el: New unit tests for affected code.
* lisp/mh-e/mh-scan.el (mh-msg-num-width-to-column): Fix doc string typo.
Alan Mackenzie [Sat, 13 Nov 2021 12:58:23 +0000 (12:58 +0000)]
Correct patch from 2021-11-12 on src/fileio.c
* src/fileio.c (restore_window_points): Reverse commit 974192413f8a81171b8fd28dfd5c081ce06d3dec and instead replace a < by a <=.
This ensures that if w->mpoint is at the top of the middle region being
replaced, it gets adjusted and stays at the top after the reinsertion.
Alan Mackenzie [Sat, 13 Nov 2021 11:58:26 +0000 (11:58 +0000)]
C++ Mode: Fix incoorect background fontification of <
Where c-record-found-types gets "bound" to itself, we postpone the calling of
c-fontify-new-type on possible new found types until these are confirmed by
the return from the function tentatively finding these types, for exmaple
c-forward-<>-arglist. We check this "binding" by testing the value of
c-record-found-types.
Correct the background fontification algorithm.
* lisp/progmodes/cc-engine.el (c-record-found-types): Move the definition to
earlier in the file.
(c-add-type-1): Check additionally c-record-found-types is nil before calling
c-fontify-new-found-type.
(c-forward-<>-arglist, c-forward-type): On return from a function which
collects found types in c-record-found-types, call c-fontify-new-found-types
for each such type.
* lisp/progmodes/c-fonts.el (c-force-redisplay): Actually fontify the new
found type.
(c-fontify-new-found-type): Test for font-lock-mode being enabled. Remove the
spurious condition on the `fontified' text property being nil before causing
c-force-redisplay to get called.
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"