* lisp/xwidget.el (xwidget-webkit-mode-map): Bind "H" to
xwidget-webkit-browse-history.
(xwidget-webkit-import-widget): Set last session buffer correctly.
(xwidget-webkit-browse-history): New command.
(xwidget-webkit-history--session): New variable.
(xwidget-webkit-history--insert-item)
(xwidget-webkit-history-select-item)
(xwidget-webkit-history-reload): New functions.
Gregory Heytings [Tue, 16 Nov 2021 08:00:24 +0000 (09:00 +0100)]
New X resource to control the border thickness of menus
* lwlib/xlwmenu.h (XtNborderThickness, XtCBorderThickness): New X
resource name.
* lwlib/xlwmenuP.h (XlwMenuPart): New border_thickness field.
* lwlib/xlwmenu.c (xlwMenuResources): Access the new resource.
(draw_shadow_rectangle): Use the new resource value.
* doc/emacs/xresources.texi (Lucid Resources): Document the new
resource (bug#51867).
Michael Herstine [Tue, 16 Nov 2021 07:48:24 +0000 (08:48 +0100)]
Make results details in ert-run-tests-batch configurable
* lisp/emacs-lisp/ert.el (ert-batch-print-length)
(ert-batch-print-level,.ert-batch-backtrace-line-length)
(ert-batch-test, ert-run-tests-interactively): Added the three
variables, bound them to these settings when formatting batch
test results including backtraces. Removed the optional
parameters output-buffer & message-fn from
ert-run-tests-interactively.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-interactively, ert-test-run-tests-batch): use
cl-letf to capture output, new tests resp.
* test/lisp/ert-x-tests.el (ert-test-run-tests-interactively-2):
Changed to use cl-letf to capture output instead of using
message-fn.
* lisp/emacs-lisp/backtrace.el (backtrace--line-length-or-nil)
(backtrace--print-func-and-args): Fixed a bug when setting
backtrace-line-length to nil by adding a new function to check
for that case & having backtrace--print-func-and-args use it.
* doc/misc/ert.texi: document the new variables & their usage
(bug#51037).
* lisp/keymap.el: New file with all the new keymap-* functions.
* lisp/loadup.el ("keymap"): Load.
* lisp/subr.el (kbd): Refactor out all the code to key-parse.
(define-key-after, keyboard-translate, global-set-key)
(local-set-key, global-unset-key, local-unset-key)
(local-key-binding, global-key-binding)
(substitute-key-definition): Note in doc strings that these are
legacy functions.
(define-keymap--define): Use keymap-set.
* lisp/emacs-lisp/byte-opt.el: Remove the optimizations for
defvar-keymap and define-keymap since the macros now only
understand the kbd syntax.
* lisp/emacs-lisp/bytecomp.el (byte-compile-define-keymap)
(byte-compile-define-keymap--define): Warn about invalid key
definitions in all keymap-* functions.
* lisp/emacs-lisp/shortdoc.el (keymaps): Add shortdocs form
keymap* functions.
* src/keymap.c (possibly_translate_key_sequence): Adjust callers
to key-valid-p and key-parse.
(syms_of_keymap): Adjust defs.
Stefan Kangas [Tue, 16 Nov 2021 06:18:19 +0000 (07:18 +0100)]
Merge from origin/emacs-28
e852822f3d Fix removal of fringe marks of deleted bookmarks b418aad85a * lisp/repeat.el (repeat-echo-message): Bind message-log-m... fe2ac7cb7c * lisp/repeat.el (describe-repeat-maps): Use help-fns--ana... c840bfe7e1 * lisp/repeat.el: Detect changes in the minibuffer state (... 5044151486 Avoid segfaults due to freed face cache 199e2468d3 Doc fix; change recommended file name of custom-file
Mike Kupfer [Tue, 16 Nov 2021 06:03:54 +0000 (22:03 -0800)]
Fix handling of folder "+/" in MH-E
* lisp/mh-e/mh-utils.el (mh-sub-folders): Fix handling of "+/".
* test/lisp/mh-e/mh-utils-tests.el
(mh-folder-completion-function-08-plus-slash)
(mh-folder-completion-function-09-plus-slash-tmp):
Fix errors made importing tests from mh-unit.el; remove declaration
that these tests are expected to fail.
Mike Kupfer [Tue, 16 Nov 2021 05:55:53 +0000 (21:55 -0800)]
Fix checkdoc complaints in MH-E
* lisp/mh-e/mh-compat.el (mh-flet): Rewrite most of the docstring.
(mh-write-file-functions): Remove trailing space.
* lisp/mh-e-mh-scan.el (mh-scan-cmd-note-width): Break up a
line that was too long.
Stefan Kangas [Tue, 16 Nov 2021 04:06:48 +0000 (05:06 +0100)]
Fix recently changed wdired test on MS-Windows
* test/lisp/wdired-tests.el (wdired-test-bug34915): Don't try to
create a local socket on MS-Windows, as it is not supported on that
platform. Problem reported by Robert Pluim <rpluim@gmail.com>.
Juri Linkov [Mon, 15 Nov 2021 17:39:37 +0000 (19:39 +0200)]
* lisp/repeat.el: Detect changes in the minibuffer state (bug#47566)
(repeat--prev-mb): New internal variable.
(repeat-post-hook): Check the property 'repeat-map' on the symbol
from 'this-command' in addition to 'real-this-command'. Don't allow
repeatable maps in the activated minibuffer or in the minibuffer
from another command. Set 'repeat--prev-mb' at the end.
Stefan Kangas [Mon, 15 Nov 2021 08:42:48 +0000 (09:42 +0100)]
Fix hanging wdired test
* test/lisp/wdired-tests.el (wdired-test-bug34915): Fix hanging
test. Don't start the Emacs Server just to create a socket; just
create the socket manually.
* lisp/tutorial.el (tutorial--find-changed-keys): Use keymapp to
detect prefix definitions rather than hard-coding them. A notable
omission from the hard-coded list was mode-specific-command-prefix,
whose subcommands are often rebound (bug#40725).
Ken Brown [Sun, 14 Nov 2021 15:30:44 +0000 (10:30 -0500)]
Prefer POSIX timers to timerfd timers
* src/atimer.c (set_alarm): Try to start a POSIX timer before
starting a timerfd timer. On Cygwin, return if the POSIX timer is
started successfully. (Bug#51734)
* 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).