Stefan Kangas [Fri, 4 Nov 2022 15:25:21 +0000 (16:25 +0100)]
Use progress reporter in cpp.el
* lisp/progmodes/cpp.el (cpp-highlight-buffer): Use progress
reporter.
(cpp-progress-time, cpp-progress-message): Make obsolete in favor
of 'make-progress-reporter'.
(cpp-message-min-time-interval): Doc fix.
Paul Eggert [Fri, 4 Nov 2022 18:00:49 +0000 (11:00 -0700)]
Pacify gcc -Wanalyzer-null-dereference
This is for gcc 12.2.1 20220819 (Red Hat 12.2.1-2) x86-64
when Emacs is configured with --enable-gcc-warnings.
* src/buffer.c (Fmove_overlay): Prefer BASE_EQ to EQ in a place
where they’re equivalent because the only symbol allowed here is nil.
* doc/emacs/package.texi: Expand documentation and give example.
* etc/NEWS: Mention 'package-vc-selected-packages'.
* lisp/emacs-lisp/package-vc.el (package-vc--select-packages): Remove
function.
(package-vc-ensure-packages): Add function based on
'package-vc--select-packages'.
(package-vc-selected-packages): Call 'package-vc-ensure-packages' from
custom setter.
* test/manual/noverlay/Makefile.in: Add copyright notice.
(LIBS): Rename...
(PACKAGES): ...to this, to avoid confusion with Autoconf's LIBS.
All uses changed.
(CFLAGS): Break out -I flag...
(CPPFLAGS): ...into this new variable.
(LDFLAGS): Rename...
(LDLIBS): ...to this, which is expected to hold -l flags.
(top_builddir): New variable.
(EMACS): Define in terms of it.
(.PHONY): Add clean, distclean, and perf targets.
(have-libcheck): Remove redundant target. All uses updated.
(itree-tests.o): Remove redundant dependency on its source file.
(itree-tests): Remove redundant (and uncompilable) rule.
* test/manual/noverlay/check-sanitize.sh: Use /usr/bin/env. Add
copyright notice. Enable pipefail option, to propagate itree-tests
exit status to caller. Fix typo in usage message. Strip less
information from Check's error messages.
* test/manual/noverlay/emacs-compat.h: Add copyright notice.
Include stdlib.h.
(emacs_abort, eassert): Consistently use EXIT_FAILURE.
(eassume): Define when necessary.
* test/manual/noverlay/itree-tests.c: Add copyright notice. Include
standard headers before third-party ones. Use most narrowly
applicable ck_assert* macro for the types being checked,
e.g. ck_assert_ptr_* macros for pointer values. Replace removed
names and APIs with current ones, e.g. the itree_node field 'color'
is now called 'red'. Ensure preconditions of itree API are
satisfied before use, e.g. itree_node otick being set appropriately
before insertion, or global iterator being initialized
before (implicit) use (bug#58976). Make all functions static.
(DEF_TEST_SETUP): Remove all instances, replacing with...
(test_insert1_setup, test_insert2_setup, test_remove1_setup)
(test_remove2_setup): ...these new test fixtures.
(A, B, C, D, E, N_05, N_10, N_15, N_20, N_30, N_40, N_50, N_70)
(N_80, N_90, N_85, N_95): Define as static variables rather than
macros.
(test_get_tree4): Remove, inlining salient parts.
(shuffle): Move closer to users.
(test_create_tree): Accept itree_nodes as argument instead of
dynamically allocating them. All callers changed.
(FOREACH): Remove unused macro.
(N_BEG, N_END): Define in terms of itree_node_begin and
itree_node_end, respectively.
(test_gap_insert_1, test_gap_insert_2, test_gap_insert_3)
(test_gap_insert_5, test_gap_insert_7, test_gap_insert_11): Use
test_setup_gap_node_noadvance.
(basic_suite): Group unit tests into test cases and fixtures. Run
previously forgotten test_insert_14.
(main): Run suite as CK_ENV to allow specifying desired verbosity in
the environment.
Po Lu [Fri, 4 Nov 2022 11:21:22 +0000 (19:21 +0800)]
Avoid using too up-to-date values when restoring valuators
* src/xterm.c (xi_has_scroll_valuators): New function.
(xi_handle_device_changed): If the device changed event provides
scroll valuators, then use the values in there. (bug#58980)
Juri Linkov [Fri, 4 Nov 2022 07:47:06 +0000 (09:47 +0200)]
* lisp/tab-bar.el (tab-bar-fixed-width): New user option.
(tab-bar-fixed-width-max): New user option.
(tab-bar-fixed-width-min): New variable.
(tab-bar-fixed-width-faces): New variable.
(tab-bar--fixed-width-hash): New function.
(tab-bar-make-keymap-1): Use 'tab-bar-fixed-width'.
Jim Porter [Mon, 19 Sep 2022 00:42:09 +0000 (17:42 -0700)]
Only strip newlines when stringifying a value for Eshell
* lisp/eshell/esh-util.el (eshell-stringify): Use 'string-trim-right'
instead of stripping the last character of the result of
'pp-to-string' (bug#58810).
Juri Linkov [Thu, 3 Nov 2022 17:35:45 +0000 (19:35 +0200)]
Fix overlays order in Flyspell (bug#58970)
Flyspell relies on the sorting order of overlays from 'overlays-in'
that returned the overlays sorted by decreased 'overlay-start'.
But after the recent merge of the noverlay branch, the order was reversed.
So need to change the order back to the expected by Flyspell.
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-word):
Sort overlays returned from 'overlays-in' descending by 'overlay-start'.
Some names under the interval_* namespace were renamed under the
itree_* namespace in commits:
0. f421b58db5 of 2022-10-19
"Prefix all itree.h type names with itree_".
1. 37a1145410 of 2022-10-19
"Rename all exported itree.h functions with the itree_ prefix"
Further, some values still referenced in commentary were removed in
commits:
2. 258e618364 of 2022-10-17
"Delete the itree_null sentinel node, use NULL everywhere."
3. 2c4a3910b3 of 2022-10-02
"itree: Use a single iterator object"
* src/emacs.c (main): Allocate global itree iterator once and for
all.
* src/alloc.c (mark_overlay):
* src/buffer.c (set_overlays_multibyte):
* src/itree.c (itree_destroy): Update commentary.
(interval_stack_ensure_space, itree_insert_gap): Prefer
unsigned-to-unsigned comparisons over signed-to-unsigned.
(interval_stack_push_flagged, interval_tree_insert)
(interval_tree_contains, itree_iterator_start)
(itree_iterator_finish, itree_iterator_next, itree_iterator_narrow):
Improve assertions.
(itree_init): Rename...
(init_itree): ...to this, for consistency with other global init
functions.
(itree_create): Stop leaking a global iterator allocation on each
call.
(interval_tree_init): Complete renames of
interval_tree -> itree_tree and interval_tree_clear -> itree_clear.
(interval_tree_remove_fix): Fix indentation.
* src/itree.h: Declare init_itree.
(ITREE_FOREACH): Fix typo in commentary.
* src/pdumper.c [CHECK_STRUCTS]
(dump_interval_node): Use the correct name in the HASH condition
and #error message.
(dump_overlay, dump_buffer): Update HASH (bug#58975).
Po Lu [Thu, 3 Nov 2022 11:27:24 +0000 (19:27 +0800)]
Further simplify valuator reset code
* src/xterm.c (xi_reset_scroll_valuators_for_device_id): Minor
style adjustments.
(handle_one_xevent): Don't check frames; reset on all XI_Enter
and XI_Leave events.
Eli Zaretskii [Thu, 3 Nov 2022 09:25:50 +0000 (11:25 +0200)]
Fix 'text-property-search-backward' with 1-char long properties
* lisp/emacs-lisp/text-property-search.el
(text-property--find-end-backward): Don't miss the end of
text-property value at point. This fixes searches backward when
the property is on a single character position. (Bug#58937)
Paul Eggert [Wed, 2 Nov 2022 20:24:26 +0000 (13:24 -0700)]
Initialize child signal handling before posix_spawn too.
Problem reported by Tino Calancha (Bug#58960).
* src/callproc.c (call_process): Initialize SIGCHLD handling
before possibly creating a child with emacs_span. This need not
be in the critical section that calls emacs_spawn, so do it
outside the critical section.
* src/process.c (child_signal_init): Now extern.
Juri Linkov [Wed, 2 Nov 2022 18:22:10 +0000 (20:22 +0200)]
Add the parameter :noquery to open-network-stream (bug#58948)
* doc/lispref/processes.texi (Network): Add :noquery for open-network-stream.
* lisp/net/network-stream.el (open-network-stream): Pass the
parameter :noquery to make-network-process. Doc fix.
* lisp/progmodes/eglot.el (eglot--connect): Pass `:noquery t' to
eglot--inferior-bootstrap to use in open-network-stream call, like
`:noquery t' is passed to make-process in other places.
Track file name in 'package--downloads-in-progress'
* lisp/emacs-lisp/package.el (package--download-one-archive): Move
'cl-pushnew' call from 'package--download-one-archive' and cons file
name onto the archive.
(package--download-one-archive): Cons the file name onto the archive.
(package--download-and-read-archives): Remove 'cl-pushnew' call.
Po Lu [Wed, 2 Nov 2022 10:27:16 +0000 (18:27 +0800)]
Improve commentary in some parts of xterm.c
* src/xterm.c (x_probe_xfixes_extension): Rename to
`x_fixes_pointer_blanking_supported', as fixes is now used for
selection tracking as well. All callers changed.
(x_focus_changed): Document where this code is used.
Po Lu [Tue, 1 Nov 2022 04:51:38 +0000 (12:51 +0800)]
Fix leaks of XImage structures in image.c
* src/image.c (image_clear_image, lookup_image): Fix coding
style.
(x_destroy_x_image): Remove unnecessary assertion. Call
XDestroyImage, since otherwise only the image data is freed.
(image_from_emacs_colors): Rename variables to make more sense.
Dmitry Gutov [Mon, 31 Oct 2022 00:51:14 +0000 (02:51 +0200)]
Fix semantic-symref-perform-search when dir contains a space
* lisp/cedet/semantic/symref/grep.el (semantic-symref-grep--local-dir):
New variable.
(semantic-symref-perform-search): Use it. And use "." when
expanding the template to substitute for the current dir.
(semantic-symref-parse-tool-output-one-line): Use it (bug#55016)