]> git.eshelyaron.com Git - emacs.git/log
emacs.git
5 months agopcase.el (\`): Try and handle large patterns better
Stefan Monnier [Mon, 3 Jun 2024 17:26:10 +0000 (13:26 -0400)]
pcase.el (\`): Try and handle large patterns better

Large backquote patterns tend to lead to very large and deeply
nested expansions, but they also tend to contain a lot of
"constant" subpatterns that can be compiled to quote patterns.
This patch does just that.  See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01140.html

* lisp/emacs-lisp/pcase.el (pcase--split-pred):
Improve the handling of pred-vs-quote so it also works with
quoted objects like cons cells, vectors, and strings.
Simplify the `pcase--mutually-exclusive-p` branch accordingly.
(pcase--expand-\`): New function, extracted from the \` pcase macro.
Make it recurse internally, and optimize backquote patterns to `quote`
patterns where possible.
(\`): Use it.

* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-vectors): Add tests
that were broken by a more naïve version of the optimization.
(pcase-tests-quote-optimization): New test.

(cherry picked from commit 16fc5b6c0c72464a75d9a84b754375662b3acec6)

5 months agoAvoid crashes and assertions while handling SIGWINCH
Eli Zaretskii [Mon, 3 Jun 2024 17:37:31 +0000 (20:37 +0300)]
Avoid crashes and assertions while handling SIGWINCH

* src/dispnew.c (build_frame_matrix_from_leaf_window)
(window_to_frame_vpos): Avoid assertion violations when we have an
unhandled SIGWINCH.
(frame_size_change_delayed): New function.
* src/dispextern.h (frame_size_change_delayed): Add prototype.
* src/cm.c (cmcheckmagic): Don't check magicwrap if we have an
unhandled SIGWINCH.  (Bug#71289)

(cherry picked from commit eb9afd558ec506f1d349dbb61668d6231fda136f)

5 months agoNew commands to show/hide outlines by regexp (bug#49731)
Juri Linkov [Mon, 3 Jun 2024 17:18:46 +0000 (20:18 +0300)]
New commands to show/hide outlines by regexp (bug#49731)

* lisp/outline.el (outline-mode-prefix-map): Bind "/ s" to
'outline-show-by-heading-regexp', and "/ h" to
'outline-hide-by-heading-regexp'.
(outline-show-by-heading-regexp)
(outline-hide-by-heading-regexp): New commands.
(outline-hidden-headings-regexp): New helper function.

(cherry picked from commit 4395f4d4530db77156b20209c1a81dce22c6e62d)

5 months agoNew variable 'revert-buffer-restore-functions' (bug#69511)
Juri Linkov [Mon, 3 Jun 2024 16:55:47 +0000 (19:55 +0300)]
New variable 'revert-buffer-restore-functions' (bug#69511)

* doc/lispref/backups.texi (Reverting):
Add documentation for 'revert-buffer-restore-functions'.

* lisp/files.el (revert-buffer-restore-functions): New variable.
(revert-buffer-restore-read-only): New function.
(revert-buffer): Use 'revert-buffer-restore-functions' with
the default value 'revert-buffer-restore-read-only' (bug#69511).

* lisp/buff-menu.el (Buffer-menu-mode): Add hook
'revert-buffer-restore-functions' to restore
outline-minor-mode highlighting.

(cherry picked from commit a525cfb3af0c49c5c64e8af548ab23d086348fed)

5 months agoSupport ada-ts-mode, gpr-mode and gpr-ts-mode in Eglot
Troy Brown [Sun, 2 Jun 2024 15:48:54 +0000 (11:48 -0400)]
Support ada-ts-mode, gpr-mode and gpr-ts-mode in Eglot

* lisp/progmodes/eglot.el (eglot-server-programs): Add
ada-ts-mode, gpr-mode and gpr-ts-mode.

Copyright-paperwork-exempt: yes
(cherry picked from commit 58a26db6261b752a34957a6554820a7cf5c05fc2)

5 months agoAdd 'message' to 'comp-primitive-type-specifiers'
Andrea Corallo [Fri, 31 May 2024 15:14:10 +0000 (17:14 +0200)]
Add 'message' to 'comp-primitive-type-specifiers'

* lisp/emacs-lisp/comp-common.el (comp-primitive-type-specifiers): Add
message.

(cherry picked from commit 2ae6451ec1216a9341080008d7065d6a75150455)

5 months ago* lisp/emacs-lisp/comp.el (native-compile): Type declare.
Andrea Corallo [Fri, 31 May 2024 15:00:50 +0000 (17:00 +0200)]
* lisp/emacs-lisp/comp.el (native-compile): Type declare.

(cherry picked from commit e39e96c9b93cf99d50f99f3e0593cbfbf0ac758d)

5 months ago; compilation-error-regexp-alist-alist order comment
Mattias Engdegård [Mon, 3 Jun 2024 14:52:27 +0000 (16:52 +0200)]
; compilation-error-regexp-alist-alist order comment

(cherry picked from commit 876bd6506d78392d7f6b8d13df678da21ad05af9)

5 months agoRevert "Add support for Rust compilation messages"
Mattias Engdegård [Mon, 3 Jun 2024 14:31:02 +0000 (16:31 +0200)]
Revert "Add support for Rust compilation messages"

This reverts commit 2e862f81a355435fb7e837ffebee2f657c26ff23.
It had serveral problems; see bug#70794.

(cherry picked from commit bf6c3892dedea4c329fc884e6a1d59c463f1adac)

5 months agoImprove key binding documentation.
Robert Pluim [Mon, 3 Jun 2024 12:52:05 +0000 (14:52 +0200)]
Improve key binding documentation.

* doc/emacs/custom.texi (Init Rebinding): Explain how to bind a key to a
string and how to use non-ASCII characters.
* lisp/keymap.el (keymap-global-set, keymap-local-set): Mention
'key-description'.

(cherry picked from commit 4dfb0829ed3e9c0d26523242e8db9907191dc8db)

5 months agoAdd common pairs to defcustom for electric-quote-chars
Robert Pluim [Mon, 3 Jun 2024 12:00:56 +0000 (14:00 +0200)]
Add common pairs to defcustom for electric-quote-chars

* lisp/electric.el (electric--print-list-of-chars): New function to
display chars as chars instead of integers in a custom widget.
(electric-char-pair): New widget for displaying a pair of characters.
(electric-quote-chars-pairs): New widget.  Contains presets for common
combinations of left/right quotation characters
(electric-quote-chars): Update to use 'electric-quote-chars-pairs'.

* etc/NEWS: Announce the change.

(cherry picked from commit 62d6ba2ede95805ba309bdc538628eb49b331f03)

5 months agoSmall followup change
Po Lu [Mon, 3 Jun 2024 12:37:41 +0000 (20:37 +0800)]
Small followup change

* lisp/image.el (create-image): Remove supererogatory instances
of pcase.  Recognize new `lambda' values and refrain from
specifying a default transform-smoothing when it is returned.
(image--default-smoothing): Return lambda if scaling is default.

* lisp/tool-bar.el (tool-bar--image-expression): Revert this
portion of last change.

(cherry picked from commit 68cc4cb6b1ce7ccc66084cb5e431bc9f6713bf04)

5 months ago; * src/xterm.c (syms_of_xterm): Fix doc string typos.
Collin Funk [Mon, 3 Jun 2024 09:35:06 +0000 (02:35 -0700)]
; * src/xterm.c (syms_of_xterm): Fix doc string typos.

Bug#71333

Copyright-paperwork-exempt: yes
(cherry picked from commit 3a54dfab2463913601a16756102ac1d30653a805)

5 months ago; Fix doc strings in kmacro.el
Eli Zaretskii [Mon, 3 Jun 2024 11:35:51 +0000 (14:35 +0300)]
; Fix doc strings in kmacro.el

* lisp/kmacro.el (kmacro-reg-add-counter-equal)
(kmacro-reg-add-counter-less, kmacro-reg-add-counter-greater):
Clarify doc string.  (Bug#61549)

(cherry picked from commit 52f802363ad34010cd073629a55831a52377dd43)

5 months agoAdd another iso-transl entry for Euro character
Robert Pluim [Mon, 3 Jun 2024 11:29:54 +0000 (13:29 +0200)]
Add another iso-transl entry for Euro character

* lisp/international/iso-transl.el (iso-transl-char-map): Add 'C-x 8 E'
to align with the other currency characters.

* etc/NEWS: Announce it.

(cherry picked from commit 3ad2dd7f3bf5309aa5a12aa5d16b0d0d9f9364c4)

5 months agoImprove support for entering quotation marks
Robert Pluim [Thu, 16 May 2024 14:25:24 +0000 (16:25 +0200)]
Improve support for entering quotation marks

* lisp/international/iso-transl.el (iso-transl-char-map): Add entries
for "low" single and double quotation marks.
(iso-transl-language-alist): Add convenient support for the official
German quoting style to the German language entry. It uses "low" double
quotes on the left, and *left* double quotes on the right.  Add support
for single guillemets to the French language entry.
* lisp/leim/quail/latin-post.el ("latin-postfix"): Add entries for
single, double and "low" Unicode quotation marks.  Add entries for
single guillemets.
* lisp/leim/quail/latin-pre.el ("latin-prefix"): And here.

* etc/NEWS: Announce the changes.

(Bug#70984)

(cherry picked from commit 0e811aba53f5cc3a8d8c13fa8922149f95e83da4)

5 months agoSkip unmature file notification tests
Michael Albinus [Mon, 3 Jun 2024 10:53:04 +0000 (12:53 +0200)]
Skip unmature file notification tests

* test/lisp/filenotify-tests.el (file-notify--deftest-remote):
Skip with "gio" library.  It is unmature.

(cherry picked from commit 288b0db9682c519a3d7f8fa0c037640997209375)

5 months ago; * doc/lispref/display.texi (Image Descriptors): Insert missing text.
Po Lu [Mon, 3 Jun 2024 08:36:20 +0000 (16:36 +0800)]
; * doc/lispref/display.texi (Image Descriptors): Insert missing text.

(cherry picked from commit a739cab66378a367cef8fa3a59f7ccb70a56bbb4)

5 months agoMaintain relationship between tool bar image and default font width
Po Lu [Mon, 3 Jun 2024 08:34:51 +0000 (16:34 +0800)]
Maintain relationship between tool bar image and default font width

* doc/lispref/display.texi (Image Descriptors): Document new
value of QCscale.

* lisp/cus-start.el (standard) <image-scaling-factor>: New
definition.

* lisp/image.el (image-scaling-factor): Move to C.
(create-image): Provide `default' as the default scaling factor.
(image--default-smoothing): Accept non-integer scaling factors.
(image-compute-scaling-factor): Document that this function
is no longer invoked by Emacs.

* lisp/tool-bar.el (tool-bar--image-expression): Disable
transform smoothing for tool-bar icons.

* src/dispextern.h (clear_image_cache): New definition.

* src/frame.c (gui_set_font): Clear such image cache entries as
derive their scales from the default font width.

* src/image.c (clear_image_cache): Export function.
(compute_image_size): Implement `default' by reading
Vimage_scaling_factor and/or computing a scale factor from the
frame's column width, as the case may be.
New argument F.  All callers changed.
(syms_of_image) <Vimage_scaling_factor>: Move from image.el.

(cherry picked from commit 56376585134d627f96c71b7b063ec51548d3ad3f)

5 months agoUse parser notifier to set parser ranges
Yuan Fu [Mon, 3 Jun 2024 04:52:48 +0000 (21:52 -0700)]
Use parser notifier to set parser ranges

This is a continuation from an earlier commit where I added
treesit-parser-changed-ranges and friends.  Dmitry raised an concern
about the edge case where the parser re-parses multiple times before
treesit--pre-redisplay has a chance to run and process changed ranges.

Instead of making treesit-parser-changed-ranges DTRT and become more
complicated, it's agreed that using parser notifier is a better
solution (and treesit-parser-changed-ranges can probably be removed).

So, I took out the code that does the work from treesit--pre-redisplay
and put them into treesit--font-lock-mark-ranges-to-fontify.  This
function will be called on each parser re-parse.  And in
treesit--pre-redisplay, to ensure that treesit--f-l-m-r-to-f gets
called, we force the primary parser to re-parse.

I also added a new variable that major modes need to set,
treesit-primary-parser.  I also added code that makes Emacs guess the
primary parser if that variable isn't set.

Documentation fot treesit-primary-parser will come later.

For futher reference, the message id for the message that prompted
this change is <dc94733b-df75-446c-980e-1c8ea65826cf@gutov.dev>

* lisp/treesit.el (treesit-primary-parser): New variable.
(treesit--font-lock-mark-ranges-to-fontify): New function.
(treesit--guess-primary-parser): New function.
(treesit--pre-redisplay): Extract out.
(treesit--pre-syntax-ppss): Add comments.
(treesit-major-mode-setup): Guess and set treesit-primary-parser; add
treesit--font-lock-mark-ranges-to-fontify as a notifier to the primary
parser.

(cherry picked from commit 760b54de080c238ea9f7b16055e820862d3e8896)

5 months ago; Remove superfluous 'quit' handler in 'eshell-send-input'
Jim Porter [Sun, 2 Jun 2024 19:03:44 +0000 (12:03 -0700)]
; Remove superfluous 'quit' handler in 'eshell-send-input'

This is now handled by the command form itself, thanks to eef32d13da5.

* lisp/eshell/esh-mode.el (eshell-send-input): Remove 'quit' handler.

(cherry picked from commit b44d511102dd3a94495d8f8446c88ac8898cd58f)

5 months agoNew user option 'shell-history-file-name'
Michael Albinus [Sun, 2 Jun 2024 17:30:12 +0000 (19:30 +0200)]
New user option 'shell-history-file-name'

* doc/emacs/misc.texi (Shell Ring): Explain shell-history-file-name.

* doc/misc/tramp.texi (Inline methods): Be more specific with containers.
(Remote processes): New subsection "Managing remote shell history".
Explain shell-history-file-name.
(Frequently Asked Questions): Add items to Tramp speedup.  Remove
entry about history file.

* etc/NEWS: New user option 'shell-history-file-name'.

* lisp/shell.el (shell-history-file-name): New defcustom.
(shell-mode): Use it.  (Bug#71049)

(cherry picked from commit bffe73b562f4065bfa99095a46f1bdb731bebc13)

5 months agoFix last change
Michael Albinus [Sun, 2 Jun 2024 14:53:56 +0000 (16:53 +0200)]
Fix last change

* lisp/net/tramp.el (tramp-remote-path): Add "/opt/homebrew/bin"
and "/opt/homebrew/sbin".

(cherry picked from commit 2849c0cda3785124465806134b316f95231a67a5)

5 months agoFix bug#71235
Michael Albinus [Sun, 2 Jun 2024 13:09:44 +0000 (15:09 +0200)]
Fix bug#71235

* lisp/dired.el (dired-insert-directory): Fix remote case.

* lisp/net/tramp.el (tramp-remote-path): Add "/opt/homebrew/bin".

(cherry picked from commit a37e812d9677a1e97daf112ec2d821aaacd7664f)

5 months agoImprove 'customize-read-group'
Eshel Yaron [Mon, 3 Jun 2024 09:10:23 +0000 (11:10 +0200)]
Improve 'customize-read-group'

5 months agoAdd Flymake fix suggestions for Checkdoc diagnostics
Eshel Yaron [Mon, 3 Jun 2024 08:55:26 +0000 (10:55 +0200)]
Add Flymake fix suggestions for Checkdoc diagnostics

5 months agoRemove helper.el
Eshel Yaron [Mon, 3 Jun 2024 08:54:53 +0000 (10:54 +0200)]
Remove helper.el

5 months ago; Improve diagnostics in Image Dired
Eli Zaretskii [Sun, 2 Jun 2024 11:14:10 +0000 (14:14 +0300)]
; Improve diagnostics in Image Dired

* lisp/image/image-dired-external.el
(image-dired--check-executable-exists): Improve diagnostics.

(cherry picked from commit 4303e5c9fa37368b50677f21aba977758f100e3c)

5 months agoIn rgrep, check matching files before excluding files
Spencer Baugh [Sun, 26 May 2024 13:26:09 +0000 (09:26 -0400)]
In rgrep, check matching files before excluding files

There are a lot of excluding globs, and checking them all is expensive.
The files glob (i.e. the glob for files we actually want) is usually
just one or two entries, so it's quite fast to check.

If find checks the files glob first and then the excluding glob, it has
to do much less checking (since the files glob will substantially narrow
down the set of files on its own), and find performance is much better.

In my benchmarking, this takes (rgrep "foo" "*.el" "~/src/emacs/trunk/")
from ~410ms to ~130ms.

Further optimizations are possible now that the ignores and matched
files are in the same <F> argument which can be rearranged more easily
without compatibility issues; I'll do those optimizations in later
commits.

* lisp/progmodes/grep.el (rgrep-find-ignores-in-<f>): Add.
* lisp/progmodes/grep.el (rgrep-default-command): Check
rgrep-find-ignores-in-<f> and move the excluded files glob to part of
the "files" argument.  (Bug#71179)

(cherry picked from commit b71fa27987d89774c84b0c9362ddfb4a0f679856)

5 months ago; * etc/NEWS: Name the systems that support touch-screen events.
Po Lu [Sun, 2 Jun 2024 08:39:18 +0000 (16:39 +0800)]
; * etc/NEWS: Name the systems that support touch-screen events.

(cherry picked from commit 7983f882823bafd5dd834c24d4defb26525f687b)

5 months agoTrim redundancies from EmacsTileObject
Po Lu [Sun, 2 Jun 2024 08:37:39 +0000 (16:37 +0800)]
Trim redundancies from EmacsTileObject

* java/org/gnu/emacs/EmacsTileObject.java (EmacsTileObject)
<colorFilter>: Delete unused field.
<paint>: Qualify as `static'.

(cherry picked from commit 253b1d6ee817222b5394fa7791cfbb0de29e4a65)

5 months agoDocument a GDK misdesign interfering with touch screens and menus
Po Lu [Sun, 2 Jun 2024 08:17:34 +0000 (16:17 +0800)]
Document a GDK misdesign interfering with touch screens and menus

* etc/PROBLEMS (Runtime problems specific to PGTK): Document a
misdesign preventing menus from being displayed in response to
touch screen events.

(cherry picked from commit 50c4feb13246f1f82efd761dd13d31d5474cffa0)

5 months agoMake comment-indent-new-line conform better to CC Mode (bug#71225)
Vincenzo Pupillo [Sun, 26 May 2024 19:07:50 +0000 (21:07 +0200)]
Make comment-indent-new-line conform better to CC Mode (bug#71225)

* lisp/progmodes/c-ts-common.el: (c-ts-common-comment-indent-new-line):
Single line comment and block comment now behave more like the
c-indent-new-comment-line.

(cherry picked from commit 1ea398e8f1d32310ef0b462567e60254c6189766)

5 months agoStipple support for MS Windows (bug#71159)
Elias G. Perez [Sat, 11 May 2024 02:36:42 +0000 (20:36 -0600)]
Stipple support for MS Windows (bug#71159)

* src/w32term.c (w32_fill_stipple_pattern): New function.
(w32_draw_glyph_string_bg_rect w32_draw_stretch_glyph_string)
(w32_draw_glyph_string_background): Use new stipple function.
* src/w32term.h (w32_bitmap_record): Add stipple value.
* src/image.c (image_create_bitmap_from_data): Create stipple
bitmap.
(image_create_bitmap_from_file): Add suuport for pixmap and
create stipple bitmap.
(free_bitmap_record): Release stipple.

* etc/NEWS: Announce support for stipples in MS-Windows.

(cherry picked from commit 48bb25c0e37f8489b06b82a4c32f0c6dcc0856e9)

5 months agoAdd 'minibuffer-action' for 'bookmark-jump'
Eshel Yaron [Sun, 2 Jun 2024 11:15:38 +0000 (13:15 +0200)]
Add 'minibuffer-action' for 'bookmark-jump'

5 months agoSeparate creation and display of Xref results buffer
Eshel Yaron [Sun, 2 Jun 2024 11:15:13 +0000 (13:15 +0200)]
Separate creation and display of Xref results buffer

5 months agoAdapt last addition to kmacro.el
Eshel Yaron [Sun, 2 Jun 2024 11:14:37 +0000 (13:14 +0200)]
Adapt last addition to kmacro.el

5 months agoAdd new keyboard macro counter functions (bug#61549)
Alex Bochannek [Sat, 1 Jun 2024 00:19:02 +0000 (17:19 -0700)]
Add new keyboard macro counter functions (bug#61549)

Advanced keyboard macro counter commands for register
integration and conditional macro termination
* lisp/kmacro.el (kmacro-keymap)
(kmacro-reg-load-counter, kmacro-reg-save-counter)
(kmacro-reg-add-counter-equal, kmacro-reg-add-counter-less)
(kmacro-reg-add-counter-greater, kmacro-reg-add-counter)
(kmacro-quit-counter-equal, kmacro-quit-counter-less)
(kmacro-quit-counter-greater, kmacro-quit-counter):
Add advanced keyboard macro counter commands to kmacro keymap.
Implement advanced keyboard macro counter commands.

* test/lisp/kmacro-tests.el (kmacro-tests-test-reg-load)
(kmacro-tests-test-reg-save)
(kmacro-tests-test-reg-add-counter-equal-01)
(kmacro-tests-test-reg-add-counter-equal-02)
(kmacro-tests-test-reg-add-counter-equal-03)
(kmacro-tests-test-reg-add-counter-equal-04)
(kmacro-tests-test-reg-add-counter-less)
(kmacro-tests-test-reg-add-counter-greater)
(kmacro-tests-test-quit-counter-equal-01)
(kmacro-tests-test-quit-counter-equal-02)
(kmacro-tests-test-quit-counter-equal-03)
(kmacro-tests-test-quit-counter-equal-04)
(kmacro-tests-test-quit-counter-less)
(kmacro-tests-test-quit-counter-greater):
Implement unit tests for advanced keyboard macro counter
commands.

* etc/NEWS:
Document advanced keyboard macro counter commands.

(cherry picked from commit 5ad8ebe6e2808df001255e1f34e8c880e1e57ad4)

5 months ago; * lisp/image/image-dired-external.el (image-dired-set-exif-data): Doc fix.
Eli Zaretskii [Sun, 2 Jun 2024 05:37:57 +0000 (08:37 +0300)]
; * lisp/image/image-dired-external.el (image-dired-set-exif-data): Doc fix.

(cherry picked from commit a0519d6d09c6df86adc658a89e97926bb352eb05)

5 months agoFix LLDB frame-format for optional column number info
Gerd Möllmann [Sat, 1 Jun 2024 19:05:50 +0000 (21:05 +0200)]
Fix LLDB frame-format for optional column number info

* lisp/progmodes/gud.el (gud--lldb-python-init-string): In the !gud
part, make column number info optional by putting it in a scope.

(cherry picked from commit 9a2088bdd928b384beca3c95c2719843f74924a0)

5 months agoImprove error handling in 'image-dired-thumbnail-set-image-description'.
Eli Zaretskii [Sat, 1 Jun 2024 17:50:40 +0000 (20:50 +0300)]
Improve error handling in 'image-dired-thumbnail-set-image-description'.

* lisp/image/image-dired-external.el
(image-dired-thumbnail-set-image-description): Show more detailed
error messages in case of failure.

(cherry picked from commit 8ecf1a995fc318ea055cbc71f9223340feb2acd0)

5 months ago; * doc/emacs/dired.texi (Image-Dired): Improve and extend.
Eli Zaretskii [Sat, 1 Jun 2024 17:40:53 +0000 (20:40 +0300)]
; * doc/emacs/dired.texi (Image-Dired): Improve and extend.

(cherry picked from commit d98ec75d649758c9fe96a7054c0a7829d04525a0)

5 months agoMinor Tramp changes
Michael Albinus [Sat, 1 Jun 2024 17:22:21 +0000 (19:22 +0200)]
Minor Tramp changes

* lisp/net/tramp-adb.el:
* lisp/net/tramp-container.el: Add myself as maintainer.

* lisp/net/tramp-compat.el (connection-local-default-application):
Define if not bound.
(tramp-compat-connection-local-p, tramp-compat-connection-local-value):
Use it.

(cherry picked from commit f0cd7eab0967c787703f144ac9d7c04e1d866306)

5 months agoElaborate 'help-complete-keys'
Eshel Yaron [Sat, 1 Jun 2024 19:47:30 +0000 (21:47 +0200)]
Elaborate 'help-complete-keys'

5 months agoshell-command-mode: New major mode for async-shell-command
Dmitry Gutov [Sat, 1 Jun 2024 15:03:42 +0000 (18:03 +0300)]
shell-command-mode: New major mode for async-shell-command

* etc/NEWS: Mention the additions.

* lisp/shell.el (shell-command-mode): New major mode (bug#71049).

* lisp/simple.el (async-shell-command-mode):
New variable, with default value pointing to that mode.
(shell-command): Refer to it here.
(async-shell-command): Update docstring.

* lisp/net/tramp.el (tramp-handle-shell-command):
Use the new variable when available.

(cherry picked from commit a154f0aa73bceeaaeefcd243e7db9d09e3f450d7)

5 months agogo-ts-mode: Highlight variadic function parameter names
Dmitry Gutov [Sat, 1 Jun 2024 14:47:13 +0000 (17:47 +0300)]
go-ts-mode: Highlight variadic function parameter names

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Add matcher for variadic parameter declarations.

(cherry picked from commit d91ad9be5a72974784e0552069020c3ae0bc830e)

5 months agoAdd font-locking for variables in go-ts-mode range clauses (bug#71209)
Noah Peart [Sun, 26 May 2024 12:34:34 +0000 (05:34 -0700)]
Add font-locking for variables in go-ts-mode range clauses (bug#71209)

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Add font-locking rule for variable names in range clauses.
* test/lisp/progmodes/go-ts-mode-tests.el (go-ts-test-font-lock):
Add font-locking test for go-ts-mode.
* test/lisp/progmodes/go-ts-mode-resources/font-lock.go: New file
for go-ts-mode font-locking tests.

(cherry picked from commit 302142189222f4a1ba75bc2c8ce00307c2499689)

5 months agoFix misc problems with thumbnails on MS-Windows
Eli Zaretskii [Sat, 1 Jun 2024 13:43:18 +0000 (16:43 +0300)]
Fix misc problems with thumbnails on MS-Windows

* lisp/image/image-dired-external.el (image-dired-pngcrush-thumb):
Fix deletion of intermediate file.
(image-dired-cmd-pngcrush-options)
(image-dired-cmd-create-standard-thumbnail-options): Use %u for
file:// URI.
(image-dired--file-URI): New function.
(image-dired-create-thumb-1, image-dired-create-thumb-2)
(image-dired-set-exif-data): Use it to generate correct URI on
MS-Windows.

* src/w32image.c (Fw32image_create_thumbnail): Copy the file names
before mirroring their slashes.

(cherry picked from commit d2dce513445d7235c9f751ea6d9b4847d62882e7)

5 months agoImprove touch-screen support on PGTK
Po Lu [Sat, 1 Jun 2024 13:27:51 +0000 (21:27 +0800)]
Improve touch-screen support on PGTK

* lisp/touch-screen.el (touch-screen-translate-touch): Do not
prepend posn if the symbol is such that keyboard.c will do so
immediately after returning.

* src/pgtkterm.c (pgtk_toolkit_position): Remove mistakenly
ported code.
(pgtk_create_terminal): Remove toolkit_position hook.
(motion_notify_event, button_event): Ignore emulated pointer
events, and apply an additional test to circumvent a GDK
oversight.
(touch_event_cb): Correct return type, and provide touch
sequence initialization and removal events as
`last_click_event's.

(cherry picked from commit 7af5d6fc9a352d4f53f8e48a6bc9ae9a3bf235a3)

5 months ago; Fix a typo.
Eli Zaretskii [Sat, 1 Jun 2024 12:37:51 +0000 (15:37 +0300)]
; Fix a typo.

(cherry picked from commit b4a93b4484c7406a395f1c1f3e8d1236138ba2a9)

5 months ago; * lisp/image/image-dired.el (w32-shell-execute): Declare.
Eli Zaretskii [Sat, 1 Jun 2024 12:33:10 +0000 (15:33 +0300)]
; * lisp/image/image-dired.el (w32-shell-execute): Declare.

(cherry picked from commit bed63ea922a4e13bd3d6fbb3e7e7f2b408779d3b)

5 months ago; Fix compilation warning in 'image-dired-external.el'
Eli Zaretskii [Sat, 1 Jun 2024 12:30:03 +0000 (15:30 +0300)]
; Fix compilation warning in 'image-dired-external.el'

* lisp/image/image-dired-external.el (w32image-create-thumbnail):
Declare.

(cherry picked from commit de7e3c33241923ab44b3cda8b237281f00c6b49d)

5 months agoImprove thumbnail generation on MS-Windows
Eli Zaretskii [Sat, 1 Jun 2024 12:22:11 +0000 (15:22 +0300)]
Improve thumbnail generation on MS-Windows

* lisp/image/image-dired-external.el (image-dired-create-thumb-2):
Optimize PNG thumbnails.
(image-dired-pngnq-thumb, image-dired-pngcrush-thumb)
(image-dired-optipng-thumb): On MS-Windows, invoke the PNG
optimization programs synchronously.
(image-dired-cmd-create-thumbnail-program)
(image-dired-cmd-create-thumbnail-options)
(image-dired-cmd-pngcrush-program)
(image-dired-cmd-optipng-program)
(image-dired-cmd-create-standard-thumbnail-options)
(image-dired-cmd-rotate-original-program)
(image-dired-temp-rotate-image-file)
(image-dired-cmd-write-exif-data-program)
(image-dired-cmd-write-exif-data-options): Doc fixes.
(image-dired-thumb-queue-run): Don't allow more than 30 concurrent
thumbnail-creation jobs on MS-Windows.

(cherry picked from commit e42da81f54ec7d3ddcb70b54fa461c7dd6c3b101)

5 months agoImplement touch screen events on PGTK
Po Lu [Sat, 1 Jun 2024 07:41:54 +0000 (15:41 +0800)]
Implement touch screen events on PGTK

* etc/NEWS: Better qualify entry for touch screen events.

* lisp/loadup.el (featurep 'pgtk): Load touch-screen.el.

* lisp/touch-screen.el: Revise list of systems where touch
screen events are reported.

* src/gtkutil.c (xg_create_frame_widgets): Request
GDK_TOUCH_MASK.

* src/pgtkfns.c (pgtk_frame_parm_handlers, tip_window): Pacify
compiler warning.

* src/pgtkterm.c (pgtk_free_frame_resources): Free touch points
linked to this frame.
(pgtk_link_touch_point, pgtk_unlink_touch_point)
(pgtk_unlink_touch_points, pgtk_find_touch_point): New
functions, ported from X.
(touch_event_cb): New event callback.
(pgtk_set_event_handler): Register `touch_event_cb' as handler
for `touch-event'.
(pgtk_delete_display): Free residual touch points on this
display.

* src/pgtkterm.h (struct pgtk_touch_point): New structure.
(struct pgtk_display_info) <touchpoints>: New field.

(cherry picked from commit 2b7056db424ab0f8bf9e96b5a3c6aa12a3debf48)

5 months agoOn X, avoid reporting unrepresentable touch IDs to Lisp
Po Lu [Sat, 1 Jun 2024 05:53:37 +0000 (13:53 +0800)]
On X, avoid reporting unrepresentable touch IDs to Lisp

* src/xterm.c (xi_link_touch_point): Assign a Lisp-representable
identifier to the new touch point and return the same.
(xi_unlink_touch_point): New arg LOCAL_DETAIL.  Return such an
identifier if there is a matching touch point record.
(handle_one_xevent): Adjust as is proper.

* src/xterm.h (struct xi_touch_point_t) <local_detail>:
New field.  Reorder fields for alignment.

(cherry picked from commit b1692e23edc32ce8938d3af200c0c42c8aa6b313)

5 months agoMake Tramp error handling more precise
Michael Albinus [Fri, 31 May 2024 14:27:47 +0000 (16:27 +0200)]
Make Tramp error handling more precise

* lisp/net/tramp-container.el (tramp-actions-copy-out-of-band)
(tramp-container-no-container-regexp): Remove.  Do not register them.
(tramp-distrobox-no-container-regexp): New defcustom.
(tramp-enable-distrobox-method): Add it to
`'tramp-actions-before-shell.  (Bug#71200)

(cherry picked from commit 0cb511b33bc96fc30d8e5286a474b4eea54817e3)

5 months agoRemove unused Fget_file_char
Mattias Engdegård [Thu, 30 May 2024 16:10:02 +0000 (18:10 +0200)]
Remove unused Fget_file_char

* src/lread.c (Fget_file_char): Remove.  It is unused, undocumented and
we actively tell users not to call it.

(cherry picked from commit 319e16550d665d1eae6f9e355c475ab668371cf3)

5 months ago; * src/w32image.c (thumb_type_data): Revert parts of recent change.
Eli Zaretskii [Fri, 31 May 2024 06:36:03 +0000 (09:36 +0300)]
; * src/w32image.c (thumb_type_data): Revert parts of recent change.

(cherry picked from commit f3891da49722a5e8a9f68435c8af13d24e03a6be)

5 months agoLimit matches of treesit-thing-settings in js-ts-mode (bug#71244)
Juri Linkov [Fri, 31 May 2024 06:34:28 +0000 (09:34 +0300)]
Limit matches of treesit-thing-settings in js-ts-mode (bug#71244)

* lisp/progmodes/js.el (js-ts-mode): Use 'js--regexp-opt-symbol'
for 'js--treesit-sexp-nodes', 'js--treesit-sentence-nodes' and 'text'
that wraps the regexp in \_< and \_> delimiters to avoid false positives
such as "expression" used for "expression_statement".
(js--treesit-sexp-nodes): Add more useful nodes "parenthesized_expression",
"formal_parameters", "statement_block", "object", "object_pattern",
"named_imports", "class_body".

(cherry picked from commit 87e4e1beab05c297c6a4b2b159dd07246381884f)

5 months ago* lisp/man.el (Man-getpage-in-background): Don't set buffer before display.
Juri Linkov [Fri, 31 May 2024 06:25:52 +0000 (09:25 +0300)]
* lisp/man.el (Man-getpage-in-background): Don't set buffer before display.

Call 'Man-notify-when-ready' before switching the current buffer.
This will avoid possible messing with the current buffer by
'Man-notify-when-ready' where display-buffer functions might change
the current buffer, thus breaking the subsequent setting of buffer-local
variables like Man-arguments in the wrong buffer (bug#71271).

(cherry picked from commit b7824916300e63e7352d2e268c72894b68937553)

5 months ago; Fix coding style in w32image.c
Po Lu [Fri, 31 May 2024 01:54:49 +0000 (09:54 +0800)]
; Fix coding style in w32image.c

* src/w32image.c (get_encoder_clsid): Insert space between
identifier and param type list.
(struct thumb_data_type, struct cached_encoder): Break before
opening bracket at top-level.

(cherry picked from commit 4077bb9867c4396769fa5837b40c0461de6b92d6)

5 months agotrack-changes.el: Keep a bit more info when logging an error
Stefan Monnier [Thu, 30 May 2024 23:00:23 +0000 (19:00 -0400)]
track-changes.el: Keep a bit more info when logging an error

* lisp/emacs-lisp/track-changes.el (track-changes--recover-from-error):
Add arg `info`.
(track-changes-fetch, track-changes--after): Use it to preserve a bit
more information about errors.

(cherry picked from commit 436b344be36152acbac693009c560b6bfb9697a2)

5 months agoad-activate-advised-definition: Use proper function objects
Stefan Monnier [Thu, 30 May 2024 22:57:56 +0000 (18:57 -0400)]
ad-activate-advised-definition: Use proper function objects

* lisp/emacs-lisp/advice.el (ad-activate-advised-definition):
Use interpreted functions rather than lambda lists.

(cherry picked from commit 2e16bcd8ede77e41e0caaf71e1d22edadadc79dd)

5 months agoserver.el: Avoid nested runs of process filters (bug#71223)
Stefan Monnier [Thu, 30 May 2024 22:28:02 +0000 (18:28 -0400)]
server.el: Avoid nested runs of process filters (bug#71223)

In case we have a "storm" of emacsclient requests coming at the
same time, our process filters ended up running nested within
each other, eating up the stack and causing errors.  Try and be
more careful with our use of `sit-for` in the process filter,
and make sure our process filters are run one at a time.

* lisp/server.el (server--message-sit-for): New function.
(server--process-filter-1): New function, extracted from
`server-process-filter`.  Use `server--message-sit-for` to display the
messages and use `run-with-timer` to delay the `delete-process`.
(server--process-filter-pending, server--process-filter-active): New vars.
(server--process-filter-all-pending): New function.
(server-process-filter): Use them.

(cherry picked from commit 0d7d835902dfaeaae03850fb37e369833bb5664d)

5 months agoImprove documentation of case-conversion commands
Eli Zaretskii [Tue, 28 May 2024 12:39:13 +0000 (15:39 +0300)]
Improve documentation of case-conversion commands

* doc/emacs/text.texi (Case): Include the commands with negative
arguments.  (Bug#71220)

(cherry picked from commit bf50aa38f9d2a3a5af8d32ce139c7533c912c476)

5 months ago; Fix typos
Stefan Kangas [Mon, 27 May 2024 08:11:15 +0000 (10:11 +0200)]
; Fix typos

(cherry picked from commit 225b426f256ba00aff7669ad18a5c85f86e22f67)

5 months agoCease adding completions to minibuffer defaults by default
Eshel Yaron [Sat, 1 Jun 2024 16:43:22 +0000 (18:43 +0200)]
Cease adding completions to minibuffer defaults by default

5 months agoMove category ahead of style in completions header line
Eshel Yaron [Sat, 1 Jun 2024 16:43:02 +0000 (18:43 +0200)]
Move category ahead of style in completions header line

5 months agoNew command 'help-complete-keys' for 'prefix-help-command'
Eshel Yaron [Sat, 1 Jun 2024 16:42:04 +0000 (18:42 +0200)]
New command 'help-complete-keys' for 'prefix-help-command'

5 months agoFix 'info-finder' with prefix argument
Eshel Yaron [Fri, 31 May 2024 11:53:17 +0000 (13:53 +0200)]
Fix 'info-finder' with prefix argument

5 months agoAdd fix suggestions to shellcheck diagnostics in 'sh-mode'
Eshel Yaron [Thu, 30 May 2024 19:36:51 +0000 (21:36 +0200)]
Add fix suggestions to shellcheck diagnostics in 'sh-mode'

* lisp/progmodes/sh-script.el (sh-shellcheck-fix): New function.
(sh-shellcheck-flymake): Use it.

5 months agoFix job control in remote shell
Michael Albinus [Thu, 30 May 2024 16:55:21 +0000 (18:55 +0200)]
Fix job control in remote shell

* lisp/net/tramp-sh.el (tramp-methos) <scp, ssh>:
Adapt `tramp-direct-async' argument.  (Bug#71259)

(cherry picked from commit baecf9bb283e52a829e31ae6f36c4687171a51c5)

5 months agouniversal-argument--preserve: Preserve last-prefix-arg
Sean Whitton [Thu, 30 May 2024 11:45:57 +0000 (12:45 +0100)]
universal-argument--preserve: Preserve last-prefix-arg

* lisp/simple.el (universal-argument--preserve): Set
current-prefix-arg to last-prefix-arg in order to preserve
last-prefix-arg, too (bug#71277).

(cherry picked from commit 0b4d2bb9b366ea78e8bc6bf1915d91d4131e98f7)

5 months agoSupport built-in thumbnail creation on MS-Windows
Eli Zaretskii [Thu, 30 May 2024 14:45:33 +0000 (17:45 +0300)]
Support built-in thumbnail creation on MS-Windows

* src/w32image.c (get_encoder_clsid, Fw32image_create_thumbnail)
(globals_of_w32image, syms_of_w32image): New functions.
* src/emacs.c (main): Call 'syms_of_w32image' and
'globals_of_w32image'.
* src/w32term.h (syms_of_w32image, globals_of_w32image): Add
prototypes.

* lisp/image/image-dired.el
(image-dired-thumbnail-display-external): Add a fallback for
MS-Windows.
* lisp/image/image-dired-external.el
(image-dired--probe-thumbnail-cmd): New function.
(image-dired--check-executable-exists): Call it to verify that
"convert" is indeed an Imagemagick program.  New argument FUNC
specifies a function that can be used as an alternative to running
EXECUTABLE.
(image-dired-create-thumb-1): Don't call
'image-dired--check-executable-exists' here, ...
(image-dired-thumb-queue-run): ...call it here, with
'w32image-create-thumbnail' as the alternative function.  If on
MS-Windows and no "convert" command, call
'image-dired-create-thumb-2' instead.
(image-dired-create-thumb-2): New function.

* etc/NEWS: Announce the thumbnail support.

(cherry picked from commit ae7d0e86b37eabc434c48f85f56df0a221e0e7c7)

5 months agoDon't set text scale to fractional values in touch-screen-pinch
Po Lu [Thu, 30 May 2024 13:31:18 +0000 (21:31 +0800)]
Don't set text scale to fractional values in touch-screen-pinch

* lisp/touch-screen.el (touch-screen-pinch): Take floor of
computed scale.

(cherry picked from commit 1ebb9cb93b2fefa84f18a63fb24c1ed4fcf095a7)

5 months ago; Skip commit 1fdf0f68ccf02cc92e4fb995f82f01a6148b62e7
Eshel Yaron [Thu, 30 May 2024 14:36:28 +0000 (16:36 +0200)]
; Skip commit 1fdf0f68ccf02cc92e4fb995f82f01a6148b62e7

5 months agoShow all date options when adding Gnus scores interactively
Jakub Ječmínek [Thu, 30 May 2024 08:54:57 +0000 (10:54 +0200)]
Show all date options when adding Gnus scores interactively

* lisp/gnus/gnus-score.el (gnus-summary-increase-score): Rename
'char-to-type' variable to 'char-to-types' and bind all legal types
for date header.

* lisp/gnus/gnus-score.el (gnus-summary-score-entry): Provide better
default values for each scoring type and cast 'match' to number only
if necessary.

Co-authored-by: Alex Bochannek <alex@bochannek.com>
(cherry picked from commit 39b704e36e308783dcec791d333fca317c6a5202)

5 months agoImprove Tramp error handling
Michael Albinus [Thu, 30 May 2024 08:44:30 +0000 (10:44 +0200)]
Improve Tramp error handling

* lisp/net/tramp-container.el (tramp-container-no-container-regexp):
New defcustom.
(tramp-actions-before-shell, tramp-actions-copy-out-of-band): Declare.
Add `tramp-container-no-container-regexp'.  (Bug#71200)

(cherry picked from commit c166abe897bcc2d6e1f59283cf25aef9d47e0c9f)

5 months ago* lisp/dired-aux.el (shell-command-guess-xdg): Check nil xdg-mime (bug#71270).
Juri Linkov [Thu, 30 May 2024 06:44:03 +0000 (09:44 +0300)]
* lisp/dired-aux.el (shell-command-guess-xdg): Check nil xdg-mime (bug#71270).

(cherry picked from commit 9ca7632c5c0c8a8d4c1eb39a82d6c59bea848898)

5 months agoUpdate TUTORIAL.cs and TUTORIAL.translators
Jakub Ječmínek [Wed, 29 May 2024 18:37:37 +0000 (20:37 +0200)]
Update TUTORIAL.cs and TUTORIAL.translators

* etc/tutorials/TUTORIAL.cs: Update TUTORIAL.cs according to its
English counterpart.
* etc/tutorials/TUTORIAL.translators: Update maintaner of
TUTORIAL.cs.

(cherry picked from commit 6bf0f5c9fb8e896a5efc3f4c9595e097b3489d77)

5 months agoMake Eshell's "which" command extensible
Jim Porter [Thu, 30 May 2024 02:21:09 +0000 (19:21 -0700)]
Make Eshell's "which" command extensible

Since 'eshell-named-command-hook' already makes execution of commands
extensible, "which" should be too.  This makes sure that "which" returns
the right result for quoted commands like "/:cat".

* lisp/eshell/em-alias.el (eshell-aliases-file): Allow it to be nil.
(eshell-read-aliases-list, eshell-write-aliases-list): Check if
'eshell-aliases-file' is nil.
(eshell-maybe-replace-by-alias--which): New function...
(eshell-maybe-replace-by-alias): ... use it.

* lisp/eshell/esh-cmd.el (eshell-named-command-hook): Update docstring.
(eshell/which): Make extensible.
(eshell--find-plain-lisp-command, eshell-plain-command--which): New
functions.
(eshell-plain-command): Use 'eshell--find-plain-lisp-command'.

* lisp/eshell/esh-ext.el (eshell-explicit-command--which): New
function...
(eshell-explicit-command): ... unise it.
(eshell-quoted-file-command--which): New function...
(eshell-quoted-file-command): ... use it.
(eshell-external-command--which): New function.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/which/plain/eshell-builtin)
(esh-cmd-test/which/plain/external-program)
(esh-cmd-test/which/plain/not-found, esh-cmd-test/which/alias)
(esh-cmd-test/which/explicit, esh-cmd-test/which/explicit/not-found)
(esh-cmd-test/which/quoted-file)
(esh-cmd-test/which/quoted-file/not-found): New tests.

* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell-settings):
Don't load or save aliases.
(eshell-command-result--match,eshell-command-result--match-explainer)
(eshell-command-result-match): New functions.

(cherry picked from commit 1df3554f0766c91a9452cd40f74f469ed612eda6)

5 months ago; Improve recent change to deferred evaluation in Eshell
Jim Porter [Thu, 30 May 2024 00:27:01 +0000 (17:27 -0700)]
; Improve recent change to deferred evaluation in Eshell

* lisp/eshell/esh-cmd.el (eshell-do-eval): Move active check later.

(cherry picked from commit 6a0f4d333a35543cd99bd88e053995a44020dadb)

5 months agoUse `scheme-mode` for the Guile init file
Stefan Kangas [Wed, 29 May 2024 21:29:21 +0000 (23:29 +0200)]
Use `scheme-mode` for the Guile init file

* lisp/files.el (auto-mode-alist): Use `scheme-mode` for the Guile
init file (~/.guile).

(cherry picked from commit 69a9fdd6bb004cd4ef96bddef457dd2b8e53303c)

5 months agoFix calling Eshell scripts outside of Eshell
Jim Porter [Mon, 20 May 2024 15:59:02 +0000 (08:59 -0700)]
Fix calling Eshell scripts outside of Eshell

* lisp/eshell/em-script.el (eshell-source-file): Make obsolete.
(eshell--source-file): Adapt from 'eshell-source-file'...
(eshell-script-initialize, eshell/source, eshell/.): ... use it.
(eshell-princ-target): New struct.
(eshell-output-object-to-target, eshell-target-line-oriented-p): New
implementations for 'eshell-princ-target'.
(eshell-execute-file, eshell-batch-file): New functions.

* lisp/eshell/esh-mode.el (eshell-mode): Just warn if we can't create
the Eshell directory.

* test/lisp/eshell/em-script-tests.el (em-script-test/execute-file):
(em-script-test/execute-file/args), em-script-test/batch-file): New
tests.

* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell-settings):
New function...
(with-temp-eshell): ... use it.

* doc/misc/eshell.texi (Control Flow): Update documentation.

* etc/NEWS: Announce this change (bug#70847).

(cherry picked from commit 9280a619ab3141c0b3b8f4ae876f82e6a38c757f)

5 months agoRework how 'eshell-ensure-newline-p' adds newlines
Jim Porter [Thu, 23 May 2024 21:55:59 +0000 (14:55 -0700)]
Rework how 'eshell-ensure-newline-p' adds newlines

This allows for other output targets (see the following commit) to be
"line-oriented".

* lisp/eshell/esh-io.el (eshell-ensure-newline-p): Move from esh-cmd.el.
(eshell-target-line-oriented-p, eshell--output-maybe-n)
(eshell-print-maybe-n, eshell-error-maybe-n)
(eshell-maybe-output-newline): New functions.

* lisp/eshell/esh-cmd.el (eshell-lisp-command): Don't print a newline
in this function directly; instead, use 'eshell-print-maybe-n' and
'eshell-error-maybe-n'.
(eshell-ensure-newline-p): Move to esh-io.el.

* lisp/eshell/em-unix.el (eshell/cat): Remove now-unnecessary override
of 'eshell-ensure-newline-p'.

(cherry picked from commit eac608cb8041222ba3b2eac48ac6f76ac36bab16)

5 months agoAdd ability for Eshell virtual targets to handle closing the target
Jim Porter [Thu, 23 May 2024 21:52:07 +0000 (14:52 -0700)]
Add ability for Eshell virtual targets to handle closing the target

This was documented to work by calling the output function with 'nil',
but that was never actually implemented.  Instead, for compatibility,
we now support a new (optional) close function.

* lisp/eshell/esh-io.el (eshell-virtual-targets): Update docstring.
(eshell-generic-target): New struct...
(eshell-function-target): ... inherit from it, and rename from
'eshell-virtual-target'.
(eshell-get-target): Handle already-created 'eshell-generic-target'.
(eshell-close-target): Call the target's close function if present.

* test/lisp/eshell/esh-io-tests.el (esh-io-test/virtual/device-close):
New test.

* doc/misc/eshell.texi (Redirection): Document the new behavior.

(cherry picked from commit 9daf1085a9b11e056079edce8dccca92d69bf891)

5 months agoUse 'esh-module-autoload' for Eshell modules' defgroups
Jim Porter [Mon, 20 May 2024 05:01:31 +0000 (22:01 -0700)]
Use 'esh-module-autoload' for Eshell modules' defgroups

This will let modules define their own, regular autoloads, independent
of the core Eshell machinery for defining modules.

* lisp/eshell/em-alias.el (em-alias):
* lisp/eshell/em-banner.el (em-banner):
* lisp/eshell/em-basic.el (em-basic):
* lisp/eshell/em-cmpl.el (em-cmpl):
* lisp/eshell/em-dirs.el (em-dirs):
* lisp/eshell/em-elecslash.el (em-elecslash):
* lisp/eshell/em-extpipe.el:
* lisp/eshell/em-glob.el (em-glob):
* lisp/eshell/em-hist.el (em-hist):
* lisp/eshell/em-ls.el (em-ls):
* lisp/eshell/em-pred.el (em-pred):
* lisp/eshell/em-prompt.el (em-prompt):
* lisp/eshell/em-rebind.el (em-rebind):
* lisp/eshell/em-script.el (em-script):
* lisp/eshell/em-smart.el (em-smart):
* lisp/eshell/em-term.el (em-term):
* lisp/eshell/em-tramp.el (em-tramp):
* lisp/eshell/em-unix.el (em-unix):
* lisp/eshell/em-xtra.el (em-xtra): Use 'esh-module-autoload'.

* lisp/eshell/esh-module.el ("esh-module-loaddefs"): Load this instead
of "esh-groups".

* .gitignore: Change esh-groups.el to esh-module-loaddefs.el

(cherry picked from commit 4c924a53334035dc4089b24174012b54c020631b)

5 months agoConsolidate Eshell module loading/unloading code
Jim Porter [Sat, 11 Mar 2023 03:02:26 +0000 (19:02 -0800)]
Consolidate Eshell module loading/unloading code

This also adds the ability to suppress module loading/unloading
messages, which will be necessary to support running Eshell scripts as
batch scripts.

* lisp/eshell/esh-mode.el (eshell-mode): Move module
loading/initialization to...

* lisp/eshell/esh-module.el (eshell-load-modules)
(eshell-initialize-modules): ... here.
(eshell-module-loading-messages): New option.
(eshell-module--feature-name): Improve docstring.
(eshell-unload-modules): Display a real warning if unable to unload a
module.

* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell)
(eshell-command-result-equal):
* test/lisp/eshell/eshell-tests-unload.el (load-eshell): Silence Eshell
loading messages.

(cherry picked from commit 6c2f21e4a6ff65cc1697cb8a6ba0e1ef1a52ae1c)

5 months ago; Improve documentation of new Imenu features
Eli Zaretskii [Wed, 29 May 2024 18:43:57 +0000 (21:43 +0300)]
; Improve documentation of new Imenu features

* doc/emacs/programs.texi (Imenu): Update documentation of
'imenu-flatten'.

* etc/NEWS: Fix wording of 'imenu-flatten's entry.

* lisp/imenu.el (imenu-flatten): Fix doc string and value
descriptions.  (Bug#70846)

(cherry picked from commit 98149ad31ea2cfd5a82f95443affd665c9da667b)

5 months ago* lisp/imenu.el (imenu-flatten): Add new choice 'group' (bug#70846).
Juri Linkov [Wed, 29 May 2024 18:05:20 +0000 (21:05 +0300)]
* lisp/imenu.el (imenu-flatten): Add new choice 'group' (bug#70846).

(imenu-flatten): For prefix use the implicit symbol 'prefix'.
(imenu--completion-buffer): Use :group-function
if imenu-flatten is 'group'.
(imenu--flatten-index-alist): Handle the value 'group' of
imenu-flatten in a way similar to the value 'annotation'.

(cherry picked from commit f469ab73a777c9930582af8b4fd22967f07808aa)

5 months agoAdd Tramp distrobox method
Michael Albinus [Wed, 29 May 2024 16:29:52 +0000 (18:29 +0200)]
Add Tramp distrobox method

* doc/misc/tramp.texi (Inline methods) <distrobox>: Add.

* etc/NEWS: Mention Tramp distrobox method.

* lisp/net/tramp-container.el (tramp-distrobox-program): New defcustom.
(tramp-distrobox-method): New defconst.
(tramp-distrobox--completion-function)
(tramp-enable-distrobox-method): New defuns.  (Bug#71200)
(tramp-docker-method, tramp-dockercp-method)
(tramp-podman-method, tramp-podmancp-method)
(tramp-kubernetes-method, tramp-flatpak-method)
(tramp-apptainer-method, tramp-nspawn-method): Adapt docstring.

* test/lisp/net/tramp-tests.el (tramp--test-box-p): Rename from
`tramp--test-toolbox-p'.  Add distrobox.  Adapt callees.

(cherry picked from commit 17c23a46c3d834e7dc9f153e86a51242b3867b74)

5 months agoAdd 'help-echo' to more fields in completions list header line
Eshel Yaron [Thu, 30 May 2024 14:24:52 +0000 (16:24 +0200)]
Add 'help-echo' to more fields in completions list header line

5 months ago; Update ldefs-boot.el some more
Eshel Yaron [Wed, 29 May 2024 16:18:45 +0000 (18:18 +0200)]
; Update ldefs-boot.el some more

5 months ago; Update ldefs-boot.el
Eli Zaretskii [Wed, 29 May 2024 15:48:27 +0000 (11:48 -0400)]
; Update ldefs-boot.el

(cherry picked from commit 62a3d72bee3f7a0b92b48ac17ddac2528e8ccdb7)

5 months agoRename comp-run.el and comp-cstr.el private functions
Davide Pola [Wed, 29 May 2024 15:34:38 +0000 (17:34 +0200)]
Rename comp-run.el and comp-cstr.el private functions

* lisp/emacs-lisp/comp-run.el (native-compile-async-skip-p)
(comp-async-runnings, comp-effective-async-max-jobs)
(comp-accept-and-process-async-output, comp-run-async-workers)
(comp-trampoline-search): rename using '--' separator convention for
private functions.
* lisp/emacs-lisp/comp-cstr.el
(comp-cstr-copy, comp-cstrs-homogeneous, comp-split-pos-neg)
(comp-normalize-valset, comp-union-valsets)
(comp-intersection-valsets, comp-normalize-typeset)
(comp-union-typesets, comp-intersect-two-typesets)
(comp-intersect-typesets, comp-range-union)
(comp-range-intersection, comp-range-negation, comp-cstr-add-2)
(comp-cstr-sub-2, comp-cstr-union-homogeneous-no-range)
(comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem)
(comp-cstr-union-1, comp-cstr-union-make)
(comp-cstr-intersection-make): Likewise.

(cherry picked from commit fd61cf3976c1c24b5a58923f6520f88db060cacd)

5 months agoObey tramp-histfile-override in remote direct async processes
Michael Albinus [Wed, 29 May 2024 15:11:49 +0000 (17:11 +0200)]
Obey tramp-histfile-override in remote direct async processes

* doc/emacs/custom.texi (Connection Variables):
Mention `permanent-local' symbol property.

* lisp/net/tramp-sh.el (tramp-histfile-override):
Add ;;;###tramp-autoload cookie and `permanent-local' symbol
property.

* lisp/net/tramp.el (tramp-handle-make-process):
Obey `tramp-histfile-override'.  (Bug#71049)

(cherry picked from commit 063b67325b4e00a31c1178b340529a94e0de1c4e)

5 months ago; * src/w32.c (sys_open): Set errno to EISDIR if opening a directory.
Eli Zaretskii [Wed, 29 May 2024 14:56:18 +0000 (17:56 +0300)]
; * src/w32.c (sys_open): Set errno to EISDIR if opening a directory.

(cherry picked from commit 4e836407ce3a2140725c7ddc2cedc3478d34a479)

5 months agoFix error message from 'insert-file-contents'
Eli Zaretskii [Wed, 29 May 2024 14:41:01 +0000 (17:41 +0300)]
Fix error message from 'insert-file-contents'

* src/fileio.c (Finsert_file_contents): Consider directories
to be "regular" files.  (Bug#71258)

(cherry picked from commit 8f618711d13fb82b10b67a12f47736e01ec4b92b)

5 months ago; Skip commit 608e9a5806f643876246ee9dceac381589a4fa2a
Eshel Yaron [Wed, 29 May 2024 16:00:45 +0000 (18:00 +0200)]
; Skip commit 608e9a5806f643876246ee9dceac381589a4fa2a

5 months ago; Skip commit c04eccd667f425e9b253e8178130c7e00c659df9
Eshel Yaron [Wed, 29 May 2024 16:00:39 +0000 (18:00 +0200)]
; Skip commit c04eccd667f425e9b253e8178130c7e00c659df9