Robert Pluim [Thu, 7 Nov 2024 20:03:20 +0000 (21:03 +0100)]
Ensure `move-frame-functions' trigger on macOS frame resize
* src/nsterm.m ([EmacsView windowWillResize:toSize:]): Call
windowDidMove to ensure that MOVE_FRAME_EVENT events are
generated when a frame is resized. (Bug#74074)
Michael Albinus [Tue, 5 Nov 2024 14:57:42 +0000 (15:57 +0100)]
Several Tramp cleanups
* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection):
Move setting of sentinel up.
* lisp/net/tramp-cache.el (tramp-get-connection-property)
(tramp-set-connection-property): Don't raise a debug message for
the `tramp-cache-version' key.
Cecilio Pardo [Mon, 4 Nov 2024 17:58:40 +0000 (18:58 +0100)]
Support :transform-smoothing on images (MS-Windows) (bug#57166)
* src/dispextern.h (struct image): Add field 'smoothing' for
NTGUI.
* src/image.c (image_set_transform): Assign the 'smoothing'
field of the image struct.
* src/w32gdiplus.h: Add references to more GDI+ functions.
* src/w32image.c (gdiplus_init): Add references to more GDI+
functions.
* src/w32term.c (w32_draw_image_foreground): If the image is
marked for smoothing and GDI+ is available, draw it with GDI+
bilinear interpolation.
* etc/NEWS: New entry for this change.
Stefan Kangas [Tue, 5 Nov 2024 03:19:22 +0000 (04:19 +0100)]
pcomplete/find: Support new GNU find expressions
* lisp/pcmpl-gnu.el (pcomplete/find): Add expressions from new GNU find:
"-newerxy" (4.3.3) and "-files0-from" (4.9.0). This list is now
complete as of GNU findutils 4.10.0, released on 2024-06-01.
Jim Porter [Mon, 21 Oct 2024 01:01:10 +0000 (18:01 -0700)]
Move more of Eshell range handling to the parser phase
* lisp/eshell/esh-util.el (eshell-range): New struct.
(eshell--range-string-p, eshell--string-to-range): New functions.
* lisp/eshell/esh-arg.el (eshell-parse-integer)
(eshell-parse-range-token): New functions...
(eshell-parse-argument-hook): ... add them.
(eshell--after-range-token-regexp): New defsubst.
(eshell-concat-1): Don't remove the 'number' property; we use that when
handling range arguments.
(eshell--range-token): New constant.
(eshell-unmark-range-token): New function.
* lisp/eshell/esh-var.el (eshell-parse-index): Update implementation to
use parsed range argument.
* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-indices):
Test range index using variables.
Cecilio Pardo [Mon, 28 Oct 2024 21:18:13 +0000 (22:18 +0100)]
Add support for 'yank-media' on MS-Windows
Adds the capacity to handle types different from strings to the
clipboard management functions on MS-Windows, and some logic
required to convert media types names and content to be what
yank-media and the modes that use it expect (bug#71909).
* lisp/term/w32-win.el (w32--selection-target-translations): New
variable that holds the name translations for media types.
(w32--translate-selection-target): New function, translate the
name of a media type.
(w32--translate-reverse-selection-target): New function, reverse
translation.
(w32--get-selection): Modified to translate target names when
asked for targets, and retrieve media types when asked for them.
(w32--mime-type-textual-p): New function, checks if a MIME type
is textual.
* lisp/textmodes/sgml-mode.el (html-mode--image-yank-handler):
Fixed the image save mechanism, that added line feed characters
on MS-Windows, breaking binary formats.
* src/w32image.c (gdiplus_init): Modified to fetch more
functions fromm gdiplus.
(get_encoder_clsid): Renamed to 'w32_gdip_get_encoder_clsid'
and made nonstatic.
(gdiplus_startup): Renamed to 'w32_gdiplus_startup' and
made nonstatic.
* src/w32select.c (stdfmt_name): Made global, was static
function.
(convert_dibv5_to_png): New function to convert DIBV5 clipboard
format to PNG.
(get_clipboard_format_name): New function get the name of a
format given its index.
(Fw32__get_clipboard_data_media): New function, retrieves and
converts media content.
(syms_of_w32select): Export new lisp functions.
* src/w32gdiplus.h: New file, for definitions in w32image.c
* doc/lispref/frames.texi: Updated with MS-Windows support.
* etc/NEWS: Added entry about new feature.
Sebastián Monía [Thu, 24 Oct 2024 17:09:11 +0000 (13:09 -0400)]
More lax doctype check in EWW (bug#73133)
The regexp to match doctype tags was simplified and will match
more legacy entries; also correct binding of 'case-fold-search'.
* lisp/net/eww.el (eww--html buffer-list): Update function.
Stephen Berman [Thu, 31 Oct 2024 09:46:27 +0000 (10:46 +0100)]
Fix bugs in dabbrev-expand (bug#74090)
* lisp/dabbrev.el (dabbrev-expand): Use the buffer where the
expansion was found when setting the internal variables used to
determine the next expansion or a replacement expansion.
* test/lisp/dabbrev-tests.el (ert-x): Require for
'ert-with-temp-directory', 'ert-resource-directory' and
'ert-resource-file'.
(with-dabbrev-test): New macro.
(dabbrev-expand-test-same-buffer-{1,2,3,4})
(dabbrev-expand-test-other-buffer-{1,2,3,4})
(dabbrev-expand-test-minibuffer-{1,2,3,4}): New tests.
* test/lisp/dabbrev-resources/dabbrev-expand.el:
* test/lisp/dabbrev-resources/INSTALL_BEGIN: New test resources.
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Delete trailing
whitespace before inserting newline. The insert-line-break
function is the same as in c-indent-new-comment-line.
Laurence Warne [Wed, 30 Oct 2024 14:12:13 +0000 (15:12 +0100)]
Work on proced-tests.el
* test/lisp/proced-tests.el
(proced--assert-process-valid-cpu-refinement-explainer): New function
for explaining refinement test failures in greater detail.
Stefan Monnier [Tue, 29 Oct 2024 02:14:10 +0000 (22:14 -0400)]
(with-peg-rules): Fix references to rulesets (bug#74018)
PEG rules get "compiled" to functions with name `peg-rule <RULE>`.
`define-peg-ruleset` instead defines it PEG rules with name
`peg-rule <RULESET> <RULE>`, so that they can be made visible
by `with-peg-rules` simply by adding local aliases from
`peg-rule <RULE>` to `peg-rule <RULESET> <RULE>`.
Apparently when I added `define-peg-ruleset` I somehow failed to
install some of the corresponding code in `with-peg-rules`, so
the aliases were not installed, making it "impossible" to use
rulesets.
[ I still have no idea how this happened and/or where
the missing code went, so I "recreated" it. ]
* lisp/progmodes/peg.el (with-peg-rules): Install the aliases
for the rulesets.
(peg--translate-rule-body): Try and preserve
location info when emitting a warning.
* test/lisp/progmodes/peg-tests.el (peg-test-myrules): New ruleset.
(peg-test-ruleset): New test.
Laurence Warne [Sun, 27 Oct 2024 15:50:20 +0000 (16:50 +0100)]
Fix flakey proced refine tests (Bug#73441)
* test/lisp/proced-tests.el (proced-refine-test)
(proced-refine-with-update-test): Use the much simpler CPU refinement
for testing 'proced-refine'. The previous tests made the incorrect
assumption that refining on the PID of process A only filtered the
buffer to contain process A and its children, whereas in actuality
the children of process A's children, their children, and so on will
also be shown.
(proced-update-preserves-pid-at-point-test): Mark as unstable.
Stefan Kangas [Fri, 1 Nov 2024 21:54:11 +0000 (22:54 +0100)]
Mark unused reftex variable as obsolete
* lisp/textmodes/reftex-vars.el
(reftex-toc-split-windows-horizontally-fraction): Mark unused variable
as obsolete in favor of 'reftex-toc-split-windows-fraction'.
Jim Porter [Fri, 1 Nov 2024 17:40:25 +0000 (10:40 -0700)]
Improve evaluation of conditional Eshell forms
This simplifies the logic for building these forms and also fixes an
issue where a subcommand in a "&&" or "||" conditional had its output
suppressed.
* lisp/eshell/esh-cmd.el (eshell-structure-basic-command): Make
obsolete.
(eshell-silence-test-command): New function...
(eshell-rewrite-while-command, eshell-rewrite-if-command): ... use it,
and make the command form ourselves.
(eshell-parse-pipeline): Use 'and' and 'or' to make the conditional
command sequence.
(eshell-command-success): New macro.
(eshell-do-eval): Add support for 'and' and 'or' forms.
* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/and-operator/output)
(esh-cmd-test/or-operator/output): New tests.
Stephen Gildea [Fri, 1 Nov 2024 16:32:27 +0000 (09:32 -0700)]
; time-stamp: Reformat some long doc strings for clarity.
* lisp/time-stamp.el (time-stamp-format, time-stamp-pattern): Reformat
doc strings for clarity.
(group time-stamp): is a subgroup of "files", not "data".
The "data" group seems to be for editing non-text files.
* test/lisp/time-stamp-tests.el: Fix tense of some doc strings.
Jim Porter [Mon, 21 Oct 2024 22:41:42 +0000 (15:41 -0700)]
Improve correctness of Eshell globs when using escape characters
This new implementation opts *in* to treating characters as glob
characters, rather than opting out. This reduces the need to coordinate
with other parts of Eshell and should be harder to break (bug#74033).
* lisp/eshell/em-glob.el (eshell-parse-glob-chars): Return the
propertized globbing character directly.
(eshell--propertize-glob, eshell--glob-char-p)
(eshell--contains-glob-char-p, eshell--all-glob-chars-p): New functions.
(eshell-glob-p): Make obsolete.
(eshell-glob-regexp, eshell-glob-convert-1, eshell-glob-convert): Check
for 'eshell-glob-char' property.
(eshell-extended-glob): Remove text properties when returning no match.
(eshell--glob-anything): New constant.
(eshell-glob-entries): Propertize "*" to treat it as a glob.
* lisp/eshell/em-ls.el (eshell-ls--expand-wildcards): New function...
(eshell-ls--insert-directory): ... use it.
* test/lisp/eshell/em-glob-tests.el: Use 'eshell--propertize-glob' in
tests.
(em-glob-test/convert/literal-characters)
(em-glob-test/convert/mixed-literal-characters): New tests.
* lisp/eshell/em-glob.el (eshell-expand-glob): Rename from
'eshell-extended-glob'. Update callers.
(eshell-extended-glob): New function to expand a GLOB that hasn't been
propertized yet, for use outside of Eshell command forms.
(eshell-parse-glob-chars): Return the propertized globbing character
directly.
(eshell-parse-glob-string, eshell--glob-char-p)
(eshell--contains-glob-char-p, eshell--all-glob-chars-p): New functions.
(eshell-glob-regexp, eshell-glob-convert-1, eshell-glob-convert): Check
for 'eshell-glob-char' property.
(eshell-glob-p): Make obsolete.
(eshell--glob-anything): New constant...
(eshell-glob-entries): ... use it.
* lisp/eshell/em-ls.el (eshell-ls--expand-wildcards): New function...
(eshell-ls--insert-directory): ... use it.
* test/lisp/eshell/em-glob-tests.el: Use 'eshell-parse-glob-string in
tests.
(em-glob-test/convert/literal-characters)
(em-glob-test/convert/mixed-literal-characters): New tests.
Jim Porter [Fri, 11 Oct 2024 04:03:45 +0000 (21:03 -0700)]
Fix and improve behavior of 'eshell/clear'
* lisp/eshell/esh-mode.el (eshell-clear): New function.
(eshell/clear): Fix incorrect behavior, and do the right thing when
'eshell-scroll-show-maximum-output' is nil.
(eshell/clear-scrollback): Call 'eshell/clear'.
* test/lisp/eshell/esh-mode-tests.el
(esh-mode-test/clear/eshell-command)
(esh-mode-test/clear/eshell-command/erase)
(esh-mode-test/clear/emacs-command)
(esh-mode-test/clear/emacs-command/erase): New tests.
* etc/NEWS: Mention the new 'eshell-command' (bug#73722).
Dmitry Gutov [Fri, 1 Nov 2024 00:32:10 +0000 (02:32 +0200)]
project-tests: Add test assertion for bug#73801
* test/lisp/progmodes/project-tests.el
(project-vc-extra-root-markers-supports-wildcards): End with a
check that we didn't cache a wrong value for parent (bug#73801).
Cecilio Pardo [Sun, 27 Oct 2024 13:39:34 +0000 (14:39 +0100)]
Fix 'yank-media' to allow yanking SVG data
* lisp/net/mailcap.el (mailcap-mime-type-to-extension): Return
"svg" for mime type 'image/svg+xml'. Org-mode uses this.
* lisp/yank-media.el (yank-media--find-matching-media): If svg is
supported, don't filter out 'image/svg+xml'. (Bug#74044)
Juri Linkov [Wed, 30 Oct 2024 18:32:28 +0000 (20:32 +0200)]
Call tab-bar-tab-post-open-functions during tabs initialization
* lisp/tab-bar.el (tab-bar-tabs): Run the hook
'tab-bar-tab-post-open-functions' after creating the first tab
in the selected frame's tab-bar list of tabs (bug#74087).
Suggested by Ship Mints <shipmints@gmail.com>.
Sean Whitton [Wed, 30 Oct 2024 01:34:12 +0000 (09:34 +0800)]
; Revise improvements to vc-git-stash-read
* lisp/vc/vc-git.el (vc-git-stash-read): Use a keyword argument.
Abbreviate the prompt reference to the most recent stash.
(vc-git-stash-pop): Update call to vc-git-stash-read.
Sean Whitton [Tue, 29 Oct 2024 11:55:08 +0000 (19:55 +0800)]
Improve prompting for git stashes
* lisp/vc/vc-git.el (vc-git-stash-read): New DEFAULT-MOST-RECENT
optional argument. Use format-prompt. Signal user-error
immediately if there are no stashes. Rewrite docstring.
(vc-git-stash-show, vc-git-stash-apply, vc-git-stash-pop)
(vc-git-stash-delete): Drop trailing ": " from prompts.
(vc-git-stash-pop): Pass non-nil DEFAULT-MOST-RECENT to
vc-git-stash-read.
Sean Whitton [Tue, 29 Oct 2024 11:25:31 +0000 (19:25 +0800)]
VC Git: Use vc-deduce-fileset to determine what to stash
* lisp/vc/vc-git.el (vc-git--deduce-files-for-stash): New function.
(vc-git-stash, vc-git-stash-snapshot): Use it to determine what
to stash. Update and expand docstrings.
(vc-git-stash-snapshot): No longer unconditionally snapshot all
uncommitted changes across the whole working tree.
* lisp/progmodes/c-ts-common.el:
(c-ts-common-comment-indent-new-line): Delete trailing
whitespace before inserting newline. The insert-line-break
function is the same as in c-indent-new-comment-line.
Dmitry Gutov [Tue, 29 Oct 2024 02:27:00 +0000 (04:27 +0200)]
project--completing-read-strict: Move some common processing here
* lisp/progmodes/project.el (project--completing-read-strict):
Add new optional argument, COMMON-PARENT-DIRECTORY. Move the
absolute->relative processing of MB-DEFAULT and the contents of
HIST here.
(project--read-file-cpd-relative): From here. So that
'project--read-file-absolute' can also benefit from those
conversions.
(project--read-file-absolute): Pass the new argument.
(project-read-file-name-function): Update value tags.
Dmitry Gutov [Tue, 29 Oct 2024 01:48:03 +0000 (03:48 +0200)]
project--read-file-cpd-relative: Move out the 'included-cpd' logic
* lisp/progmodes/project.el (project-find-dir):
Use 'project-files-relative-names'. Include "./" here rather than
(project--read-file-cpd-relative): ...doing it here.
Sean Whitton [Tue, 29 Oct 2024 01:40:02 +0000 (09:40 +0800)]
Fix window selection after log-edit-show-diff
* lisp/vc/vc.el (vc-diff-patch-string): Use display-buffer, not
pop-to-buffer, for consistency with log-edit-diff-fileset.
(vc-modify-change-comment): Use save-selected-window around
vc-diff-internal to avoid leaving the *vc-diff* window selected,
for consistency with log-edit-diff-fileset.
Alan Mackenzie [Mon, 28 Oct 2024 16:35:27 +0000 (16:35 +0000)]
Call PF correctly from pcase--edebug-match-pat-args
Also correct a doc string and insert commentary. This fixes
bug#74052.
* lisp/emacs-lisp/edebug.el
(edebug--match-&-spec-op <&interpose>): Correct and complete
the doc string, which now says MUST call exactly once, and
documents the return values of FUN, PF and
edebug--match-&-spec-op. Also remove an unneeded `(...)
construct.
* lisp/emacs-lisp/pcase.el (pcase--edebug-match-pat-args): Call
PF also for the main cases handled.
Sean Whitton [Mon, 28 Oct 2024 13:46:06 +0000 (21:46 +0800)]
Fix C-c C-d and C-c C-w during log-view-modify-change-comment
* lisp/vc/vc-dispatcher.el (log-edit-diff-fileset)
(log-edit-diff-patch): Declare.
(vc-log-edit, vc-start-logentry): New optional argument
DIFF-FUNCTION to specify log-edit-diff-function in the generated
Log Edit buffer.
* lisp/vc/vc.el (vc-modify-change-comment): Pass the new
DIFF-FUNCTION argument to vc-start-logentry.
Jim Porter [Mon, 28 Oct 2024 04:13:56 +0000 (21:13 -0700)]
Fix definitions of Eshell "xtra" functions
* lisp/eshell/em-xtra.el (eshell-parse-command): Remove unnecessary
autoload.
(eshell/substitute): Pass the correct number of arguments to
'cl-substitute'.
(eshell/count, eshell/union, eshell/mismatch, eshell/intersection)
(eshell/set-difference, eshell/set-exclusive-or): Use named arguments
for the required arguments (bug#73738).