Eli Zaretskii [Tue, 13 Sep 2022 13:49:02 +0000 (16:49 +0300)]
; Add commentary to comp-tests.el
Sigh... why do people insist on removing useful comments and leave
their tricky code more obfuscated than it must be??
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a
comment explaining why the expressions are quoted. (Bug#51104)
Stefan Monnier [Tue, 13 Sep 2022 13:36:21 +0000 (09:36 -0400)]
comp-tests.el: Enable compilation again
Rather than disable byte-compilation to circumvent bug#51104,
change the ELisp code so that `most-positive/negative-fixnum` does
not end up hardcoded in the `.elc` file.
* test/src/comp-tests.el (comp-tests-define-type-spec-test):
Don't quote the type expressions.
(comp-tests-type-spec-tests): Quote them here instead.
Eli Zaretskii [Tue, 13 Sep 2022 13:26:50 +0000 (16:26 +0300)]
Fix last change in image.c
* src/image.c (svg_load_image): Don't call Lisp to remove trailing
whitespace from librsvg error messages, do it in C instead; this
reduces consing and is much cleaner. Don't display empty error
reason if librsvg happens to return an empty message text.
(syms_of_image): Don't DEFSYM string-trim-right. (Bug#57755)
* lisp/net/eww.el (eww-render): Enable undo after rendering. This
allows using `undo' in text input boxes.
(eww-setup-buffer): Disable undo before rendering (bug#57750).
* doc/emacs/buffers.texi (Indirect Buffers): There's no point in
mentioning both clone-indirect-buffer and
clone-indirect-buffer-other-window here since they do the pretty
much the same (bug#57753).
* src/image.c (svg_load_image): Use g_error_free directly instead
of the helder g_clear_error (since we're only calling it with
non-nil values).
(svg_load_image): Avoid segfault and double reporting errors.
* test/manual/image-tests.el (image-tests-load-image/svg-too-big)
(image-tests-load-image/svg-invalid): Test it (bug#57755).
Juri Linkov [Mon, 12 Sep 2022 19:12:50 +0000 (22:12 +0300)]
Document the recently added branch commands (bug#50344)
* doc/emacs/maintaining.texi (VC Directory Commands): Change the
prefix key from "B" to "b". Replace vc-create-tag with vc-create-branch,
and vc-retrieve-tag with vc-switch-branch.
(Switching Branches): Mention vc-switch-branch bound to 'C-x v b s'.
(Creating Branches): Mention vc-create-branch bound to 'C-x v b c'.
* lisp/vc/vc-dir.el (vc-dir-mode-map): In branch keymap 'b' rebind
"c" from vc-create-tag to vc-create-branch, and "s" from
vc-retrieve-tag to vc-switch-branch.
Juri Linkov [Mon, 12 Sep 2022 18:07:05 +0000 (21:07 +0300)]
'C-x v b' prefix key is used for branch commands to create/switch/print branch
* lisp/vc/vc.el (vc-create-branch): New command.
(vc-retrieve-tag): Add new optional arg 'branchp'.
(vc-switch-branch): New command (bug#50344).
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind "b c" to vc-create-branch,
"b l" to vc-print-branch-log, "b s" to vc-switch-branch. Remove obsolete
and suppressed "b" from vc-switch-backend.
* lisp/vc/vc-dir.el (vc-dir-mode-map): Rebind 'branch-map' from "B" to "b"
for consistency with 'vc-prefix-map'.
* lisp/vc/vc-git.el (vc-git-create-tag): For a new branch read
its start-point. Ask a confirmation if modified files exist.
Stefan Kangas [Mon, 12 Sep 2022 13:14:42 +0000 (15:14 +0200)]
Skip manual GIF metadata test on MS-Windows
* test/manual/image-tests.el
(image-skip-unless): Add new arg CONDITION.
(image-tests-image-metadata/gif): Skip test on MS-Windows when
using native image API. (Bug#57691)
Don't overwrite error message in `x' in package.el
* lisp/emacs-lisp/package.el (package-menu--perform-transaction):
Return whether there were errors.
(package-menu-execute): Don't overwrite the error message(s) with
a success message (bug#51201).
* doc/lispref/keymaps.texi (Tool Bar): Document what :vert-only
does (bug#51049). This is not what it was intended to do -- but
what it intended to do didn't really make that much sense either,
so perhaps the prop should just be renamed :image-only?
Arthur Miller [Mon, 12 Sep 2022 10:38:09 +0000 (12:38 +0200)]
Remove edebug props in edebug-remove-instrumentation
* lisp/emacs-lisp/edebug.el (edebug--strip-plist): New function
(bug#51026).
(edebug-remove-instrumentation): Use it to remove pros added while
running edebug.
* lisp/textmodes/reftex-global.el (reftex-translate): Recognize
key=val labels given in the optional or mandatory argument of
environments (AUCTeX bug#57720).
* test/lisp/textmodes/reftex-tests.el
(reftex-renumber-simple-labels): New Test.
Restrict replace-*-in-region to the bounds defined by caller
* lisp/subr.el (replace-string-in-region, replace-regexp-in-region):
Narrow to region before iterating over matches, instead of giving a
bound to the search functions.
* test/lisp/subr-tests.el (test-replace-string-in-region): Add
regression tests (bug#57733).
Richard Hansen [Tue, 28 Jun 2022 20:25:43 +0000 (16:25 -0400)]
whitespace: Redo BoB/EoB empty line highlighting
* lisp/whitespace.el (whitespace--empty-at-bob-matcher,
whitespace--empty-at-eob-matcher, whitespace--update-bob-eob,
whitespace-color-off, whitespace-color-on,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-looking-back, whitespace-post-command-hook): Redo the
`empty' line highlighting logic to ensure that a buffer change causes
all affected `empty' lines to become (un)highlighted (bug#37467).
Also, for improved UX, don't highlight BoB empty lines at or below
point (not just when point is at 1), or EoB empty lines at or above
point (not just when point is `eobp').
(whitespace-bob-marker, whitespace-eob-marker): Clarify documentation.
* test/lisp/whitespace-tests.el (whitespace--with-test-buffer,
whitespace--fu, whitespace-tests--empty-bob,
whitespace-tests--empty-eob): Add tests.
Richard Hansen [Tue, 28 Jun 2022 19:05:04 +0000 (15:05 -0400)]
whitespace: Include empty final line in BoB empty match
* lisp/whitespace.el (whitespace-empty-at-bob-regexp): Include any
last line trailing whitespace in the BoB empty line match to ensure
that those characters get highlighted.
Richard Hansen [Tue, 28 Jun 2022 05:10:48 +0000 (01:10 -0400)]
ert-x: New `ert-with-test-buffer-selected' convenience macro
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): New
convenience macro that extends `ert-with-test-buffer' by displaying
the test buffer in a temporary selected window. This makes it easier
to simulate user input in the body via `execute-kbd-macro'.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-test-test-buffer-selected/*): Add tests.
Po Lu [Sun, 11 Sep 2022 08:50:16 +0000 (16:50 +0800)]
Make it easier to clear the Motif drag window for debugging
* src/xterm.c (xm_get_drag_window_1): Add comment explaining
side effect of x_special_window_exists_p.
(handle_one_xevent): Clear Motif drag window upon DestroyNotify.
In addition to debugging, it also reduces syncs necessary to
communicate via the Motif protocol after a defective/old client
sets the drag window without setting the disconnect mode.
Po Lu [Sat, 10 Sep 2022 10:49:53 +0000 (18:49 +0800)]
Fix compliance with the XDND specification when dropping on a proxy
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_dnd_do_drop): New
parameter `toplevel'. Use it as the window in sent client
messages.
(x_dnd_cancel_dnd_early, x_dnd_cleanup_drag_and_drop)
(x_dnd_process_quit, x_dnd_update_state, handle_one_xevent)
(x_connection_closed): Give the right toplevel to the client
message sending functions.
Make `format-prompt' use `substitute-command-keys'
* doc/lispref/minibuf.texi (Text from Minibuffer): Mention it.
* lisp/minibuffer.el (format-prompt): Run through
`substitute-command-keys' (bug#51040).
Stefan Kangas [Sat, 10 Sep 2022 05:29:48 +0000 (07:29 +0200)]
Doc fixes for 'text-quoting-style'
* doc/lispref/help.texi (Keys in Documentation): Remove duplicate
entry for 'text-quoting-style'. Document the function with the same
name instead.
* src/doc.c (Ftext_quoting_style): Doc fix: clarify the return values.
(syms_of_doc) <Vtext_quoting_style>: Doc fix: clarify that you should
not read the value of this variable directly; use Ftext_quoting_style
instead (bug#51040).
Po Lu [Sat, 10 Sep 2022 01:35:49 +0000 (09:35 +0800)]
Fix several printfs for 32 bit systems
* lib-src/emacsclient.c (main): Use right length modifier when
printing uintmax_t.
* src/alloc.c (check_pure_size): Use right length modifier when
printing ptrdiff_t.
Stefan Kangas [Fri, 9 Sep 2022 21:56:24 +0000 (23:56 +0200)]
Accept "-w" as safe value for vc-git-annotate-switches
* lisp/vc/vc-git.el
(vc-git-annotate-switches-safe-p): New predicate function.
(vc-git-annotate-switches): Use above new predicate function to
check if it's :safe.
Paul Eggert [Fri, 9 Sep 2022 20:22:16 +0000 (15:22 -0500)]
Fix problem with Glib 2.73.2+ and SIGCHLD handler
This code fix is by Stefan Monnier (Bug#57699).
* src/process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
Adjust to Glib 2.73.2 behavior change on Linux kernel 5.3+.
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
* lisp/shell.el (shell-mode): Enable highlighting of non-existent
commands if requested.
(shell-highlight-undef-aliases):
(shell-highlight-undef-remote-file-name-inhibit-cache): New user
options.
(shell-highlight-undef-mode): New minor mode.
(shell-highlight-undef-defined-face):
(shell-highlight-undef-undefined-face):
(shell-highlight-undef-alias-face): New faces.
(shell-highlight-undef--exec-cache):
(shell-highlight-undef--face):
(shell-highlight-undef-keywords):
(shell-highlight-undef-regexp):
(shell-highlight-undef--executable-find):
(shell-highlight-undef-matcher):
(shell-highlight-undef--indirect):
(shell-highlight--setup):
(shell-highlight-undef-reset-mode): New functions and buffer local
variables (bug#51940).
* lisp/ielm.el (ielm-comint-fl-enable): New user option to control
input fontification.
(ielm-indirect-setup-hook): New hook.
(inferior-emacs-lisp-mode): Set up and enable input fontification.
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
Implement a general input fontification mechanism for comint modes
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Don't bind
the "s" command, because it's meaningless outside modes that have
set the backtrace-goto-source-functions variable (and only edebug
does that) (bug#57674).
* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Use it.
(edebug-backtrace-mode-map, edebug-backtrace-mode): New mode.
Michael Albinus [Fri, 9 Sep 2022 15:10:28 +0000 (17:10 +0200)]
Make use of rx in Tramp backward compatoble
* lisp/net/tramp-compat.el (tramp-compat-rx--runtime-params): New defvar.
(tramp-compat-rx--transform-items)
(tramp-compat-rx--transform-item, tramp-compat-rx--transform):
New defuns. Suggested by Mattias Engdegård <mattiase@acm.org>.
(tramp-compat-rx): New defalias or defmacro.
(tramp-compat-string-replace, tramp-compat-string-search):
Use regexp-quote.