Revert VC-related prefix user options to previous values
* lisp/vc/smerge-mode.el (smerge-command-prefix):
* lisp/vc/pcvs.el (cvs-minor-mode-prefix):
* lisp/vc/diff-mode.el (diff-minor-mode-prefix): Revert to
previous values, as external packages rely on those values.
Fix `narrow-to-defun' in "async function" in js-mode
* lisp/progmodes/js.el (js--plain-method-re):
(js--function-prologue-beginning):
(js--ensure-cache): Allow "async" before "function" (bug#51926).
This makes `narrow-to-defun' work as expected.
Miha Rihtaršič [Wed, 17 Nov 2021 08:12:21 +0000 (09:12 +0100)]
Don't ignore restriction in indent-region-line-by-line
* lisp/indent.el (indent-according-to-mode): Don't widen if the new
optional argument is non-nil.
(indent-region): Explicitly widen before calling
indent-region-line-by-line.
(indent-region-line-by-line): Don't widen (bug#51892).
Emacs convention is that low-level functions should respect restriction
so that their callers can set restriction according to their needs. For
example, 'c-indent-region' is a lower-level function which respects the
current restriction and 'indent-region' is a higher-level user command
which sets the restriction for lower-level functions, it calls
"(widen)".
'indent-region-line-by-line' is a low-level function on a similar level
as 'c-indent-region'. This patch makes it respect the current
restriction instead of having it call "(widen)".
This commit gives warnings on builds --without-x.
Problem pointed out by Glenn Morris <rgm@gnu.org> in:
https://lists.gnu.org/r/emacs-devel/2021-11/msg01278.html
Eli Zaretskii [Wed, 17 Nov 2021 18:33:40 +0000 (20:33 +0200)]
Fix recent changes related to USABLE_SIGIO
* src/process.c (wait_reading_process_output) [WINDOWSNT]:
* src/keyboard.c (handle_async_input) [DOS_NT]: Ifdef away the
code that is not needed on MS-Windows. (Bug#50403) (Bug#51820)
Ken Brown [Wed, 17 Nov 2021 18:02:44 +0000 (13:02 -0500)]
Make process_pending_signals useful on systems without SIGIO
* src/keyboard.c (handle_async_input): Call gobble_input
unconditionally, not just if USABLE_SIGIO is defined. This makes
process_pending_signals do something useful on systems that have
to poll for input. (Bug#51820)
Ken Brown [Wed, 17 Nov 2021 16:55:39 +0000 (11:55 -0500)]
Avoid delays waiting for input on systems without SIGIO
* src/process.c (wait_reading_process_output) [!USABLE_SIGIO]: If
we're waiting for input, don't use a timeout of more than 25 msec
in the call to select. (Bug#50043)
Po Lu [Wed, 17 Nov 2021 12:31:41 +0000 (20:31 +0800)]
Don't draw xwidgets that have just been resized
This serves to eliminate the huge black bar displayed when the
offscreen widget has been resized (and as such the damage event
signal is sent), but the X window hasn't.
* src/xwidget.c (xv_do_draw): Don't draw xwidgets that have
just been resized.
(x_draw_xwidget_glyph_string)
(xwidget_init_view): Clear just_resized.
(Fxwidget_resize): Set just_resized first, then queue allocate.
* lisp/keymap.el (keymap-substitute): Make the keymap the first
parameter for symmetry with the other functions.
* lisp/emacs-lisp/shortdoc.el (keymaps):
* lisp/emacs-lisp/bytecomp.el (lambda): Adjust.
Stefan Kangas [Wed, 17 Nov 2021 06:59:00 +0000 (07:59 +0100)]
Temporarily mark two failing tests as unstable
* test/lisp/mh-e/mh-utils-tests.el
(mh-folder-completion-function-08-plus-slash)
(mh-folder-completion-function-09-plus-slash-tmp): Temporarily
mark two failing tests as unstable.
* 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).