Paul Eggert [Sat, 17 Aug 2024 00:08:36 +0000 (17:08 -0700)]
Don’t ignore -Wclobbered in eval.c
This fix is also prompted by Emacs bug#71744.
* src/eval.c (CACHEABLE): Remove. All uses removed.
Do not ignore -Wclobbered.
(internal_lisp_condition_case): Fix violations of the C standard,
where setjmp clobbered oldhandlerlist, var, and clauses.
Rewrite to pacify GCC, by using a sentinel rather than a count,
which GCC incorrectly complained about, and by coalescing some
duplicate code. If GCC_LINT && __GNUC__ && !__clang__ add a useless
assignment to pacify GCC.
Paul Eggert [Fri, 16 Aug 2024 23:59:08 +0000 (16:59 -0700)]
Don’t ignore -Wclobbered in emacs-module.c
This fix is also prompted by Emacs bug#71744.
* src/emacs-module.c: Do not ignore -Wclobbered.
(MODULE_HANDLE_NONLOCAL_EXIT): Fix violations of the C standard,
where setjmp clobbered env and internal_cleanup.
(module_extract_big_integer) [GCC_LINT && __GNUC__ && !__clang__]:
Work around GCC -Wclobbered false positive for ‘sign’.
Paul Eggert [Fri, 16 Aug 2024 23:29:51 +0000 (16:29 -0700)]
Don’t ignore -Wclobbered in bytecode.c
This fix is prompted by Emacs bug#71744.
The working hypothesis is that there are some bugs in Emacs,
and some in GCC’s diagnostics, and that this patch
fixes the Emacs bugs and works around the GCC diagnostic bugs.
The hypothesis is that GCC diagnostic bugs occur when GCC
coalesces variables or temporaries and some variables
are clobbered by setjmp and some vars/temps are not.
Part of this hypothesis involves GCC diagnosing the wrong variables.
Instead of ignoring the diagnostics, which the hypothesis suggests
indicate either problems in Emacs or in GCC, fix the Emacs bugs
and pacify the GCC false positives, with comments about the GCC bugs.
GCC’s true positives are helpful enough in squashing obscure bugs like
Emacs bug#71744, that it’s worth going to some effort to pacify
-Wclobbered instead of ignoring it.
* src/bytecode.c: Do not ignore -Wclobbered.
(exec_byte_code): Fix violations of the C standard, where setjmp
clobbered quitcounter and bc. If GCC_LINT && __GNUC__ && !__clang__,
work around GCC -Wclobbered warnings for bytestr_data and vectorp.
Eli Zaretskii [Thu, 15 Aug 2024 08:30:48 +0000 (11:30 +0300)]
Improve documentation of ERT
* doc/misc/ert.texi (Running Tests Interactively)
(Test Selectors):
* lisp/emacs-lisp/ert.el (ert-select-tests)
(ert-run-tests-interactively, ert-run-tests-batch): Improve and
clarify the documentation of the main ERT functions.
Eli Zaretskii [Wed, 14 Aug 2024 08:35:48 +0000 (11:35 +0300)]
Improve documentation of time-parsing functions
* doc/lispref/os.texi (Time Parsing):
* lisp/calendar/iso8601.el (iso8601-parse):
* lisp/calendar/parse-time.el (parse-time-string): Document that
these functions don't care about the distinction between local
time and UTC. (Bug#72570)
Po Lu [Fri, 16 Aug 2024 13:01:22 +0000 (21:01 +0800)]
Remove Hangul character from `han' representative character list
* lisp/international/fontset.el (script-representative-chars):
U+3200 is a Hangul character that is predictably absent from CJK
fonts, such as are provided by Xiaomi devices.
Paul Eggert [Fri, 16 Aug 2024 03:10:53 +0000 (20:10 -0700)]
Port better to NFS unlink
I found this problem while looking into Bug#72641.
* lib-src/etags.c (do_move_file):
* lib-src/update-game-score.c (unlock_file):
* src/androidvfs.c (android_hack_asset_fd_fallback):
* src/filelock.c (current_lock_owner):
Treat unlink as successful if it fails because the file wasn’t there.
This can happen with some NFS implementations, due to its
retrying over the network to get at-least-once semantics.
Although most of Emacs’s calls to unlink were already doing this,
a few instances were not.
Paul Eggert [Thu, 15 Aug 2024 20:30:23 +0000 (13:30 -0700)]
Remove empty (& invalid) lock files
* src/filelock.c (current_lock_owner):
Remove empty lock files, as they are necessarily invalid
and can be caused by buggy file systems.
Problem reported by Michal Nazarewicz (bug#72641).
Paul Eggert [Thu, 15 Aug 2024 18:29:16 +0000 (11:29 -0700)]
Fix unlikely lock file integer overflow
* src/filelock.c (within_one_second): Accept intmax_t first arg.
Avoid undefined behavior on integer overflow.
(current_lock_owner): Simplify based on within_one_second change.
Spencer Baugh [Fri, 2 Aug 2024 16:15:58 +0000 (12:15 -0400)]
Fix 'partial-completion' for candidates containing newlines
'partial-completion' tries to match a pattern containing wildcards
(such as `any' or `prefix') against completion candidates.
Wildcards are supposed to match any sequence of characters, but
'completion-pcm--pattern->regex' transformed the wildcards into
".*", which won't match sequences containing newlines. Fix this to
properly match anything by using "[^z-a]*" instead.
(That's (rx (* anything)).)
* lisp/minibuffer.el (completion-pcm--pattern->regex): Fix
regex. (Bug#72425)
Ulrich Müller [Wed, 14 Aug 2024 11:57:16 +0000 (13:57 +0200)]
Drop fallback code in date-to-time, update documentation
* lisp/calendar/time-date.el (date-to-time): Drop fallback code.
Document that the default timezone is local time, rather than GMT.
* test/lisp/calendar/time-date-tests.el (test-date-to-time):
Add more test cases.
* doc/lispref/os.texi (Time Parsing): Document that 'date-to-time'
defaults to local time.
* etc/NEWS: Announce the change. (Bug#72570)
Po Lu [Mon, 12 Aug 2024 12:44:27 +0000 (20:44 +0800)]
Remove extraneous entries for `han' from script-representative-chars
* lisp/international/fontset.el (script-representative-chars):
Remove characters that are either Kana, obsolete, or radicals,
which interferes with the discovery of real Chinese fonts, and
does not impact font resolution on free systems with Fontconfig.
Po Lu [Mon, 12 Aug 2024 00:10:36 +0000 (08:10 +0800)]
; Grammar fixes
* doc/misc/erc.texi (Connecting):
* lisp/erc/erc.el (erc-compute-server, erc-compute-nick)
(erc-compute-full-name, erc-compute-port): Replace "a number of
increasingly more" with an alternative more grammatical.
Pip Cet [Sat, 10 Aug 2024 17:01:44 +0000 (17:01 +0000)]
Fix coordinate transformations in sfnt.c
* src/sfnt.c (sfnt_transform_coordinates):
(sfnt_transform_f26dot6): Fix calculation of transformed coordinates in
the very rare case of arbitrary transformation matrices.
Kien Nguyen [Wed, 7 Aug 2024 17:39:38 +0000 (10:39 -0700)]
Use SetHandleInformation to set NOINHERIT in UCRT64
* src/w32.c (init_ntproc) [_UCRT]: Use SetHandleInformation to
prevent standard handles from being inherited, instead of relying
on MSVCRT-only behavior. For the details of the problem, see
https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01129.html.
Gerd Möllmann [Thu, 8 Aug 2024 06:19:56 +0000 (08:19 +0200)]
NS: Fix scroll-bar setting code (bug#72331)
* src/nsterm.m (ns_set_vertical_scroll_bar): Use
WINDOW_SCROLL_AREA_WIDTH instead of NS_SCROLL_BAR_WIDTH.
(ns_set_horizontal_scroll_bar): Use WINDOW_SCROLL_AREA_HEIGHT
instead of NS_SCROLL_BAR_HEIGHT. Clear area differently if vertical
scroll bars are present.
* src/nsterm.h (NS_SCROLL_BAR_WIDTH, NS_SCROLL_BAR_HEIGHT): Remove.
Paul Eggert [Thu, 8 Aug 2024 06:05:52 +0000 (23:05 -0700)]
Port zoneinfo-world-style-list to Debian testing
Problem reported by Gijs Hillenius <gijs@hillenius.net> in:
https://lists.gnu.org/r/emacs-devel/2024-08/msg00279.html
* lisp/time.el (zoneinfo-style-world-list): Use Asia/Kolkata
instead of Asia/Calcutta. The main name was changed in tzdata
2008b every practical system has it now. Some systems do
not include backward-compatibility names, so it is better
to use the standard time now.
Yuan Fu [Wed, 7 Aug 2024 04:54:20 +0000 (21:54 -0700)]
; Minor change in c-ts-common--fill-block-comment
* lisp/progmodes/c-ts-common.el:
(c-ts-common--fill-block-comment): Add check for end-mask-done. This
doesn't affect correctness, but makes the code easier to read.
Eli Zaretskii [Tue, 6 Aug 2024 18:19:49 +0000 (21:19 +0300)]
Avoid crashes in very large buffers with long lines
* src/xdisp.c (get_large_narrowing_begv, get_large_narrowing_zv)
(get_medium_narrowing_begv, get_medium_narrowing_zv): Use
'ptrdiff_t' instead of 'int', to prevent integer overflow in
large buffers. (Bug#72497)
Ulrich Müller [Tue, 6 Aug 2024 16:04:46 +0000 (18:04 +0200)]
Update description of string comparison functions
* doc/lispref/strings.texi (Text Comparison): Swap descriptions of
'string-equal' (the function) and 'string=' (its alias). Same for
'string-lessp' and 'string<'. Document 'string>'. (Bug#72486)
* doc/lispref/sequences.texi (Sequence Functions): Update cross
reference to 'string-lessp'.