Juri Linkov [Mon, 20 May 2024 06:22:10 +0000 (09:22 +0300)]
New tests for nested archives (bug#70987)
* test/lisp/tar-mode-tests.el (tar-mode-test-tar-extract-zip-and-gz):
* test/lisp/arc-mode-tests.el (arc-mode-test-zip-extract-tar-and-gz):
New tests.
* test/data/decompress/tzg.tar.gz:
* test/data/decompress/ztg.zip:
New data files to test decompressing of different combinations
of nested tar and zip archives.
Jim Porter [Sat, 11 May 2024 18:41:11 +0000 (11:41 -0700)]
Tell direction in prompts for '(previous|next)-matching-history-element'
Previously, this always said "Previous" for
'previous-matching-history-element' (likewise "Next"). Now, the prompt
accounts for a negative prefix argument changing the search direction
(bug#70882).
* lisp/simple.el (previous-matching-history-element)
(next-matching-history-element): Consult numeric prefix argument to
determine the prompt string.
Jim Porter [Mon, 29 Apr 2024 04:19:53 +0000 (21:19 -0700)]
Allow defining custom providers for more "thingatpt" functions
This also fixes an issue in EWW and bug-reference-mode where
(thing-at-point 'url) at the end of a URL would return nil.
See <https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00200.html>.
* lisp/thingatpt.el (forward-thing-provider-alist)
(bounds-of-thing-at-point-provider-alist): New variables...
(forward-thing, bounds-of-thing-at-point): ... use them.
(text-property-search-forward, text-property-search-backward)
(prop-match-beginning, prop-match-end): Declare.
(thing-at-point-for-text-property, forward-thing-for-text-property)
(bounds-of-thing-at-point-for-text-property): New functions.
* lisp/net/eww.el (eww--url-at-point): Use
'thing-at-point-for-text-property'.
(eww--bounds-of-url-at-point, eww--forward-url): New functions...
(eww-mode): ... use them.
* lisp/progmodes/bug-reference.el (bug-reference--url-at-point): Use
'thing-at-point-for-text-property'.
(bug-reference--bounds-of-url-at-point, bug-reference--forward-url): New
functions...
(bug-reference--init): ... use them.
* test/lisp/thingatpt-tests.el (thing-at-point-providers)
(forward-thing-providers, bounds-of-thing-at-point-providers): New
tests.
Paul Eggert [Sun, 19 May 2024 15:48:52 +0000 (08:48 -0700)]
Tweak STORE_NUMBER arg type
* src/regex-emacs.c (STORE_NUMBER): Make the arg int, not int16_t.
There’s no need for the caller to convert to int16_t, and using
int makes the machine code a bit smaller (and presumably a bit
faster) on x86-64 with GCC 14.
Paul Eggert [Sun, 19 May 2024 15:42:57 +0000 (08:42 -0700)]
Port knuth_hash to odd platforms
* src/lisp.h (hash_hash_t, knuth_hash): Use unsigned int and
unsigned long long int rather than uint32_t and uint64_t, as POSIX
does not guarantee the presence of uint64_t, and uint32_t and
uint64_t both in theory have problems with undefined behavior on
integer overflow. This doesn’t affect behavior (or even machine
code) on typical platforms.
Paul Eggert [Sat, 18 May 2024 20:18:32 +0000 (13:18 -0700)]
Pacify -Wanalyzer-null-dereference in sfnt.c
* src/sfnt.c (sfnt_map_table, sfnt_read_table)
(sfnt_read_cvar_table): Pacify GCC -Wanalyzer-null-dereference.
The change to sfnt_read_cvar_table fixes what appears to be
an actual null-dereference bug.
When PIXELWISE is nil, we still calculate width in pixels and
then convert it to columns. However, part of the calculation
was using columns where it should have used pixels. (Bug#70894)
Po Lu [Sun, 19 May 2024 01:46:26 +0000 (09:46 +0800)]
Fix the DJGPP build
* config.bat: Generate stdbit.in-h from stdbit.in.h.
* msdos/sedlibmk.inp (GL_STDC_...): Enable generation
of ISO C2x features.
(STDBIT_H): Define to stdbit.h.
(GL_GENERATE_STDBIT_H_CONDITION): Define to 1.
F. Jason Park [Thu, 9 May 2024 02:03:58 +0000 (19:03 -0700)]
Reconcile erc-stamp--date-stamps when merging buffers
* etc/ERC-NEWS: Mention new face `erc-information'.
* lisp/erc/erc-button.el (erc-button-add-buttons): Skip buttonization
when the "msg prop" `erc--skip' is present and contains the symbol
`button'. Set `alist' to nil in the same guard condition as a
roundabout way of suppressing further processing.
* lisp/erc/erc-networks.el (erc--insert-admin-message): Forward
declaration.
(erc-networks--insert-transplanted-content)
(erc-networks--transplant-buffer-content): Replace former with latter.
Change signature to take source and destination buffers as parameters.
(erc-networks--transplant-target-buffer-function): New function-valued
variable.
(erc-networks--target-transplant-in-progress-p): New variable, a flag
for downstream code to detect when a transplant is underway.
(erc-networks--reclaim-orphaned-target-buffers): Defer to
`erc-networks--transplant-target-buffer-function' to handle the actual
transplant business. Crucially, kill the buffer afterwards instead of
beforehand. If new buffer-association bugs emerge related to the
combining of old or renamed target buffers, this reordering may be at
fault.
(erc-networks--copy-over-server-buffer-contents): Pass old and new
buffers to `erc-networks--insert-transplanted-content'.
* lisp/erc/erc-stamp.el
(erc-stamp--defer-date-insertion-on-post-modify): Set `fn' slot of
`erc-stamp--date' instance to `ignore' when running the actual
callback in order to conserve a little space.
(erc-stamp--date-mode): Add and remove hook members for
`erc-networks--copy-server-buffer-functions' and
`erc-networks--transplant-target-buffer-function'.
(erc-insert-timestamp-left-and-right): Always clear
`erc-timestamp-last-inserted-right' to ensure a right stamp
accompanies every date stamp.
(erc-stamp--dedupe-date-stamps)
(erc-stamp--dedupe-date-stamps-from-buffer)
(erc-stamp--dedupe-date-stamps-from-target-buffer): New functions.
Date stamp behavior was revamped as part of bug#60936.
* lisp/erc/erc.el (erc-informational): New face.
(erc--insert-admin-message): New function to hide some "msg prop"
complexity from "upstream" libraries, like `erc-networks', and thus
avoid more forward-declarations. A less smelly approach would be to
devise a general interface owned by such libraries, or erc-common,
that `erc-mode' could then hook into on init.
(erc-display-message-highlight): Make face matching more limber to
accommodate the convention of face names lacking a "-face" suffix.
(erc-message-english-graft): New variable.
(erc-kill-channel): Inhibit execution of hook when
`erc-networks--target-transplant-in-progress-p' is non-nil.
* test/lisp/erc/erc-networks-tests.el
(erc-networks--rename-server-buffer--no-existing--orphan)
(erc-networks--rename-server-buffer--existing--reuse)
(erc-networks--rename-server-buffer--local-match)
(erc-networks--rename-server-buffer--local-nomatch): Use helper to
initialize markers.
* test/lisp/erc/erc-stamp-tests.el (erc-stamp--dedupe-date-stamps):
New test. (Bug#70928)
F. Jason Park [Wed, 15 May 2024 04:09:55 +0000 (21:09 -0700)]
Don't kill server buffer with erc-kill-buffer-on-part
* etc/ERC-NEWS: Mention new flag `erc-killing-buffer-on-part-p' and
the renaming of `erc-kill-channel'.
* lisp/erc/erc-backend.el (erc-server-PART): Only kill a buffer on
behalf of `erc-kill-buffer-on-part' when the buffer hasn't already
been killed, and bind `erc-killing-buffer-on-part-p' to t when doing
so.
* lisp/erc/erc-log.el (erc-conditional-save-buffer): Don't save logs
when the buffer parameter is nil because that causes the server buffer
to be saved out. It's possible that user code relying on this
longstanding bug will be affected, however, by default, the server
buffer will also be saved out independently at designated junctures.
* lisp/erc/erc.el (erc-part-hook): Redo doc string.
(erc-killing-buffer-on-part-p): New variable, a flag to prevent
redundant execution of `erc-kill-channel-hook' members concerned with
parted channels.
(erc-kill-buffer-on-part): Tweak doc string.
(erc-kill-channel-hook): Use new name for `erc-kill-channel',
`erc-part-channel-on-kill'.
(erc-kill-channel, erc-part-channel-on-kill): Rename former to latter,
and inhibit execution when `erc-killing-buffer-on-part-p' is non-nil.
* test/lisp/erc/erc-scenarios-base-kill-on-part.el: New file.
(Bug#70840)
kobarity [Sat, 24 Feb 2024 14:11:02 +0000 (23:11 +0900)]
Improve fontification of Python assignments with type hints
* lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration):
Fontify type hints of assignment statement. (Bug#69357)
* test/lisp/progmodes/python-tests.el
(python-font-lock-assignment-statement-11)
(python-font-lock-assignment-statement-12)
(python-font-lock-assignment-statement-13)
(python-font-lock-assignment-statement-18): Add fontification of type
hints.
(python-font-lock-assignment-statement-19): New test.
nxml-mode: Add schemas for Mono/.NET related files
* etc/schema/dotnet-appconfig.rnc:
* etc/schema/dotnet-packages-config.rnc:
* etc/schema/dotnet-packages-props.rnc:
* etc/schema/dotnet-resx.rnc:
* etc/schema/msbuild.rnc:
* etc/schema/nuget.rnc:
* etc/schema/nuspec.rnc: New files.
* etc/schema/README: Document copyright status of above new files.
* etc/schema/schemas.xml: Use above new files to support Mono/.NET
development related XML files.
This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2024-02/msg00638.html
Paul Eggert [Sun, 12 May 2024 21:26:32 +0000 (14:26 -0700)]
Simplify 32-bit Android bit fiddling
* src/sfnt.c: Include stdbit.h.
(sfnt_count_leading_zero_bits) [!INT64_MAX]: Remove this function,
which was confusingly named as it actually returned 31 minus the
number of leading zero bits.
(sfnt_multiply_divide_2) [!INT64_MAX]: Use stdc_leading_zeros instead.
Paul Eggert [Sun, 12 May 2024 21:22:58 +0000 (14:22 -0700)]
Prefer stdbit.h to count-one-bits.h etc
C23's <stdbit.h> in the long run should be better supported than
Gnulib's count-one-bits.h and similar headers, so switch to the
C23 primitives, with a Gnulib fallback for platforms lacking C23.
* admin/merge-gnulib (GNULIB_MODULES): Remove count-leading-zeros,
count-one-bits, count-trailing-zeros. Add stdc_bit_width,
stdc_count_ones, stdc_trailing_zeros.
* lib/count-leading-zeros.c, lib/count-leading-zeros.h:
* lib/count-one-bits.c, lib/count-one-bits.h:
* lib/count-trailing-zeros.c, lib/count-trailing-zeros.h: Remove.
* lib/stdbit.c, lib/stdbit.in.h, lib/stdc_bit_width.c:
* lib/stdc_count_ones.c, lib/stdc_leading_zeros.c:
* lib/stdc_trailing_zeros.c, m4/stdbit_h.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/data.c: Do not include count-one-bits.h, count-trailing-zeros.h.
Instead, rely on lisp.h including stdbit.h.
(Flogcount, Fbool_vector_count_population)
(Fbool_vector_count_consecutive): Use stdbit.h macros instead of
count-one-bits.h and count-trailing-zeros.h macros.
(shift_right_ull, count_one_bits_word, pre_value)
(count_trailing_zero_bits): Remove; no longer needed.
* src/lisp.h: Include stdbit.h instead of count-leading-zeros.h.
(elogb): Use stdbit.h macro instead of count-leading-zeros.h macro.
Dmitry Gutov [Sat, 18 May 2024 13:30:23 +0000 (16:30 +0300)]
minibuffer-completion-help: Fix earlier mistake
* lisp/minibuffer.el (minibuffer-completion-help): Fix earlier
mistake. Instead of altering a variable whose value is
immutable (and already captured in a saved list), move the
reference to said list to a lexical binding and alter that
list's second element instead.
Tony Zorman [Sun, 15 Oct 2023 14:51:00 +0000 (16:51 +0200)]
use-package: Add ':ignored-files' support to ':vc' keyword
* lisp/use-package/use-package-core.el (use-package-split-when):
New utility function to split a list whenever a specified
predicate returns t.
(use-package-vc-valid-keywords): A new defconst to gather all
allowed keywords.
(use-package-normalize--vc-arg): Properly normalize the
':ignored-files' keyword, in that the following are all valid
ways of entering files:
:ignored-files "a"
:ignored-files ("a")
:ignored-files "a" "b" "c"
:ignored-files ("a" "b" "c")
(use-package-normalize/:vc): Adjust normalization, now that we
do not necessarily receive a valid plist as an input. (Bug#66567)
* test/lisp/use-package/use-package-tests.el
(use-package-test-normalize/:vc): Add tests for ':ignored-files'
keyword.
Jared Finder [Fri, 26 Jan 2024 18:08:30 +0000 (10:08 -0800)]
Add user option to only display default tool bar
This works well with `window-tool-bar-mode', to be added in upcoming
commit. Then the default tool bar is displayed frame-wide and
mode-specific tool bars are displayed in the window that mode is
active in.
* lisp/tool-bar.el (tool-bar-always-show-default): New user option.
(tool-bar--cache-key, tool-bar-make-keymap-1): Return default tool bar
when option is set.
Eli Zaretskii [Sat, 18 May 2024 09:15:21 +0000 (12:15 +0300)]
Document :box attribute caveats when used on display strings
* doc/lispref/display.texi (Replacing Specs, Face Attributes):
Mention special considerations when a display string has a
':box' face attribute identical to the surrounding buffer text.
Suggested by JD Smith <jdtsmith@gmail.com>. (Bug#70637)
Joost Kremers [Tue, 7 May 2024 09:52:27 +0000 (11:52 +0200)]
Make 'vtable-insert-object' more versatile
* lisp/emacs-lisp/vtable.el (vtable-insert-object): Rename
argument AFTER-OBJECT to LOCATION; allow use of index to
refer to the insertion position; add argument BEFORE.
(Bug#70664).
* etc/NEWS:
* doc/misc/vtable.texi (Interface Functions): Document the
change.
* test/lisp/emacs-lisp/vtable-tests.el
(test-vtable-insert-object): New test.
Eli Zaretskii [Sat, 18 May 2024 06:12:54 +0000 (09:12 +0300)]
Improve documentation of 'movemail'
* doc/emacs/rmail.texi (Movemail): Fix the name of the Mailutils
manual in the printed version. Add index entries. Move the
description of remote mailboxes to...
(Remote Mailboxes): ...here, to avoid duplication.
Dmitry Gutov [Sat, 18 May 2024 00:24:56 +0000 (03:24 +0300)]
Fix project-find-regexp in remote projects
* lisp/progmodes/xref.el (xref--hits-file-prefix):
New variable. Something to prepend to each file name (bug#69233).
(xref--convert-hits): Use it to also store the "default directory"
part of the filename conditionally on whether it's remote.
(xref--collect-matches): Use the new variable here.
Dmitry Gutov [Sat, 18 May 2024 00:00:29 +0000 (03:00 +0300)]
xref--group-name-for-display: Undo most of the latest change
* lisp/progmodes/xref.el (xref--group-name-for-display):
Remove the DD-SUFFIX parameter, returning the function more like
to how it was (bug#69233).
(xref--analyze, xref--add-log-current-defun):
Revert the previous change accordingly.
* test/lisp/progmodes/xref-tests.el: Undo the last change.
Po Lu [Fri, 17 May 2024 11:21:05 +0000 (19:21 +0800)]
Port to certain Android environments with no GUI
* configure.ac (USER_FULL_NAME): Define to
android_user_full_name only when a GUI system is being built.
Otherwise, set to pw->pw_gecos or NULL consistently with the
presence of pw->pw_gecos.
* src/editfns.c (Fuser_full_name): Adjust to match. Accept NULL
values from USER_FULL_NAME.
Harald Jörg [Thu, 16 May 2024 20:22:37 +0000 (22:22 +0200)]
; cperl-mode.el: prevent Emacs from "freezing" (Bug#70948)
* cperl-mode.el (defconst): Replace the rx expression for
`cperl--basic-identifier-rx' with its actual macro expansion.
This makes it efficient under Emacs 29.3, where the expansion
by rx.el could make Emacs freeze with a crafted Perl source
(Bug#70948).
Harald Jörg [Thu, 16 May 2024 19:55:07 +0000 (21:55 +0200)]
;cperl-mode.el: Allow running under Emacs >=27
I would like to advertise cperl-mode.el from the repository as a
workaround for bug#70948. This can be achieved by safeguarding
the call to derived-mode-add-parents with a version check.
* lisp/progmodes/cperl-mode.el: Call derived-mode-add-parents only
if it is available.
Stefan Monnier [Thu, 16 May 2024 15:01:11 +0000 (11:01 -0400)]
(describe-package-1): Handle (nil . "string") in `:maintainer`
* lisp/emacs-lisp/package.el (describe-package-1): Refine the
check to distinguish the old single-maintainer format from the
new multi-maintainer format. (bug#69712)
Jim Porter [Fri, 10 May 2024 19:22:52 +0000 (12:22 -0700)]
Use "/local:" prefix in Eshell to run local commands when cwd is remote
* lisp/eshell/esh-ext.el (eshell-explicit-remote-commands)
(eshell-explicit-command): Update docstrings.
(eshell--local-prefix): New constant.
(eshell-handle-remote-command): Remove.
(eshell-quoted-file-command): New function...
(eshell-ext-initialize): ... add it as a hook.
(eshell-remote-command): Support running commands on localhost.
(eshell-connection-local-command): Rename from
'eshell-external-command'.
(eshell-external-command): New implementation calling
'eshell-remote-command' or 'eshell-connection-local-command' as
appropriate.
* lisp/progmodes/eglot.el (eglot--managed-mode): Unregister from
track-changes after `eglot-shutdown` since that function may
call `eglot--signal-textDocument/didChange`. (bug#70927)
Stefan Monnier [Wed, 15 May 2024 17:57:11 +0000 (13:57 -0400)]
control.texi: Be a bit more explicit about the behavior of `pcase-let`
* doc/lispref/control.texi (Destructuring with pcase Patterns):
Clarify the kind of "unspecified" behavior that can occur when
the destructing pattern does not match the value.
Stefan Monnier [Tue, 14 May 2024 21:09:39 +0000 (00:09 +0300)]
(xref--collect-matches): Move inhibit-modification-hooks binding down
* lisp/progmodes/xref.el (xref--collect-matches): Move the
inhibit-modification-hooks binding a little down (bug#53749).
(xref--show-common-initialize): Add sharp-quoting.
Robert Pluim [Fri, 19 Apr 2024 13:14:11 +0000 (15:14 +0200)]
Document 'use-default-font-for-symbols' more
"why does my set-fontset-font call not work for symbols" is a common
question, and it's because 'use-default-font-for-symbols' is not
discoverable enough.
* doc/emacs/mule.texi (Modifying Fontsets): Mention it here.
* doc/lispref/display.texi (Fontsets): And here.
* src/fontset.c (Fset_fontset_font): And most importantly here.
Use proper smime-keys entry for S/MIME signatures using OpenSSL
bug#67931
* doc/misc/emacs-mime.texi (MML Definition):
* lisp/gnus/mml.el (mml-parse-1): Add chainfile parameter to sign tags.
* lisp/gnus/mml-smime.el (mml-smime-openssl-sign-query): Include the
additional certificates from smime-keys in MML tag generation as
chainfile parameters.
(mml-smime-openssl-sign): Forward chainfile entries from the parsed tag
alist to smime-sign-buffer.
; * lisp/gnus/smime.el (smime-sign-region): Fix typo in documentation.
; (smime-sign-buffer): Improve documentation to match smime-sign-region.