]> git.eshelyaron.com Git - emacs.git/log
emacs.git
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

5 months ago; * src/sfntfont.c (sfnt_parse_style): Fix typo.
Po Lu [Wed, 29 May 2024 09:16:47 +0000 (17:16 +0800)]
; * src/sfntfont.c (sfnt_parse_style): Fix typo.

(cherry picked from commit 39d2f402528cd3c8be1ffd1b59d036ce3cd213fa)

5 months agoFix unsafe usage of string data on Android
Po Lu [Wed, 29 May 2024 09:11:11 +0000 (17:11 +0800)]
Fix unsafe usage of string data on Android

* src/dired.c (open_directory): Reload name after calling
maybe_quit, which might invoke GC.

(cherry picked from commit b8d880e059252541be0017523fc1ffa2251bb542)

5 months agoRename `SUBR_NATIVE_COMPILED` to `NATIVE_COMP_FUNCTION` (bug#71123)
Stefan Monnier [Wed, 29 May 2024 00:49:55 +0000 (20:49 -0400)]
Rename `SUBR_NATIVE_COMPILED` to `NATIVE_COMP_FUNCTION` (bug#71123)

Keep the name consistent with the naming used in the ELisp world.

* src/pdumper.c (dump_object_emacs_ptr, dump_do_fixup):
* src/eval.c (eval_sub, funcall_general, funcall_lambda):
* src/alloc.c (CHECK_ALLOCATED_AND_LIVE_SYMBOL, survives_gc_p):
* src/data.c (Fcl_type_of, Ffset, Fnative_comp_function_p)
(Fsubr_native_lambda_list, Finteractive_form):
* src/comp.c (check_comp_unit_relocs):
* src/bytecode.c (exec_byte_code):

* src/lisp.h (NATIVE_COMP_FUNCTIONP, NATIVE_COMP_FUNCTION_DYNP):
Rename from `SUBR_NATIVE_COMPILEDP` and `SUBR_NATIVE_COMPILED_DYNP`.

(cherry picked from commit 3480ca83510f1ad6026971c9031e2c65540d402a)

5 months agoRedirect calls to `subr-native-elisp-p` to `native-comp-function-p`
Stefan Monnier [Wed, 22 May 2024 18:45:35 +0000 (14:45 -0400)]
Redirect calls to `subr-native-elisp-p` to `native-comp-function-p`

* test/src/comp-tests.el (comp-tests-bootstrap, lambda-return)
(lambda-return2, free-fun, free-fun2, free-fun-silly-name, speed--1)
(compile-forms, comp-test-defsubst, primitive-redefine-compile-44221)
(48029-1, 61917-1, tco, fw-prop-1, pure):
* test/lisp/help-fns-tests.el (help-fns-test-lisp-defun):
* lisp/subr.el (subr-primitive-p, primitive-function-p, symbol-file):
* lisp/help-fns.el (find-lisp-object-file-name):
* lisp/emacs-lisp/disass.el (disassemble-internal):
* lisp/emacs-lisp/comp.el (comp--call-optim-form-call):
* lisp/emacs-lisp/comp-run.el (comp-warn-primitives):
* lisp/emacs-lisp/comp-common.el (comp-function-type-spec):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
* lisp/emacs-lisp/bytecomp.el (<trailer>): Rename `subr-native-elisp-p`
to `native-comp-function-p`.

(cherry picked from commit fde8dc9287c0a81c6b942b5cf445f8f7aeba1207)

5 months agoRename `subr-native-elisp` to `native-comp-function` (bug#71123)
Stefan Monnier [Wed, 22 May 2024 17:45:39 +0000 (13:45 -0400)]
Rename `subr-native-elisp` to `native-comp-function` (bug#71123)

Now that this type name is displayed in *Help*, it is more
important to use a name that is less weird for the unsuspecting user.

* lisp/emacs-lisp/cl-preloaded.el (cl-functionp): Adjust to new name of
native function's type.
(subr-native-elisp-p): Redefine as an obsolete alias.
(native-comp-function): Rename from `subr-native-elisp`

* src/data.c (Fcl_type_of): Return `Qnative_comp_function` i.s.o
`Qsubr_native_elisp`.
(Fnative_comp_function_p): Rename from `Fsubr_native_elisp_p`.
(syms_of_data): Adjust accordingly.

* src/doc.c (Fsubr_documentation): Use new `Fnative_comp_function_p` name.

(cherry picked from commit 1a1170cde7e847f4eb4d736a400f7325f2265a1c)

5 months agoMention direction when resizing a window fails
Stefan Kangas [Tue, 28 May 2024 22:34:37 +0000 (00:34 +0200)]
Mention direction when resizing a window fails

* lisp/window.el (enlarge-window, shrink-window): When an attempt to
resize a window fails, also mention the direction of the
operation (i.e., horizontally or vertically).

(cherry picked from commit 0ae66c1917609832f2456b8207743468439926ae)

5 months agoFix adding to history via 'eshell-command'
Jim Porter [Tue, 28 May 2024 21:43:28 +0000 (14:43 -0700)]
Fix adding to history via 'eshell-command'

* lisp/eshell/eshell.el (eshell-read-command): Don't handle history
here.

* lisp/eshell/em-hist.el (eshell-hist-initialize): Properly set up
history for minibuffer.
(eshell-add-command-to-history): Immediately save history.

(cherry picked from commit 7e326b915f45346803edb52b5023db9b765ed07a)

5 months agoesh-mode.el: Refrain from hiding buffer modifications (bug#70966)
Stefan Monnier [Tue, 28 May 2024 21:42:27 +0000 (17:42 -0400)]
esh-mode.el: Refrain from hiding buffer modifications (bug#70966)

We have not been able to discover why these functions let-bound
`inhibit-modification-hooks`, but these let-bindings are
undesired effects on other modes such as `diff-mode` which
need to keep track of buffer modifications.  Let's remove those
let-bindings and hope for the best.

* lisp/eshell/esh-mode.el (eshell-send-input)
(eshell-interactive-filter): Don't bind `inhibit-modification-hooks`.

(cherry picked from commit 647de5e952c6ba806d3c36373cf8eb4f11034650)

5 months agoCorrect and clarify two doc strings in lisp/files.el
Alan Mackenzie [Tue, 28 May 2024 20:12:17 +0000 (20:12 +0000)]
Correct and clarify two doc strings in lisp/files.el

lisp/files.el (major-mode-remap-alist)
(major-mode-remap-defaults): Correct and clarify the doc
strings.

(cherry picked from commit 0999c64fa861bf9b5200b6dae09e81563853a04c)

5 months agoUse the current face foreground for read-passwd icons (bug#71213)
Kévin Le Gouguec [Fri, 22 Mar 2024 19:24:46 +0000 (20:24 +0100)]
Use the current face foreground for read-passwd icons (bug#71213)

* etc/images/conceal.svg:
* etc/images/reveal.svg: Remove 'fill' attribute so that the
current face's background is applied: this helps the icon's SVG
representation remain legible regardless of how the mode-line
is themed.

(cherry picked from commit 066e9b598858cc4c0b666b12242f07a7fdf3e073)

5 months ago* lisp/image-mode.el (image-transform-fill-window): New command (bug#69565).
Juri Linkov [Tue, 28 May 2024 16:51:21 +0000 (19:51 +0300)]
* lisp/image-mode.el (image-transform-fill-window): New command (bug#69565).

(image-mode-menu): Add image-transform-fill-window to the menu.

(cherry picked from commit 730b61c64b5d86cc3b38ee15d4530fdd2194619b)

5 months agoProvide a list of default values for M-n of project-find-file (bug#70996)
Juri Linkov [Tue, 28 May 2024 16:31:55 +0000 (19:31 +0300)]
Provide a list of default values for M-n of project-find-file (bug#70996)

* lisp/progmodes/project.el (project-find-file)
(project-or-external-find-file): Provide a list of suggested
filenames for the first arg of project-find-file-in.
Use buffer-file-name first to make it more predictable for M-n.
(project--read-file-cpd-relative): Handle mb-default as a list.

(cherry picked from commit ebac4d4872829c44f65966b3268ceaf7ecbf43d9)

5 months agoAvoid rare crashes in 'uncache_face'
Eli Zaretskii [Tue, 28 May 2024 16:03:00 +0000 (19:03 +0300)]
Avoid rare crashes in 'uncache_face'

* src/xfaces.c (realize_face): Prevent rare crashes in
'uncache_face' because 'former_face' is NULL (i.e. the face
corresponding to 'former_face_id' is no longer cached).
(Bug#71243)

(cherry picked from commit d9512da49514623ef3e35524dc894c06f2c0ce20)

5 months agoUse same Python binary for test as in python mode (bug#70815)
Mattias Engdegård [Tue, 28 May 2024 15:48:37 +0000 (17:48 +0200)]
Use same Python binary for test as in python mode (bug#70815)

* test/lisp/progmodes/python-tests.el
(python-tests-get-shell-interpreter): Try Python executable names
in the same order as we do for `python-shell-interpreter`,
so that we run the test with the one is most likely to be used.

(cherry picked from commit 9c7de10079bb5f803a1744ae1d56399ad7d42ac5)

5 months agoFix tar-mode-test-tar-extract-zip-and-gz
Michael Albinus [Tue, 28 May 2024 11:23:12 +0000 (13:23 +0200)]
Fix tar-mode-test-tar-extract-zip-and-gz

* test/lisp/tar-mode-tests.el (tar-mode-test-tar-extract-zip-and-gz):
Check also for "unzip" executable.

(cherry picked from commit 8b70093b369440ea96e2fd38efdd3a05b12f7ac5)

5 months agoFix date-stamp regression in erc-fill-wrap
F. Jason Park [Fri, 9 Feb 2024 04:28:56 +0000 (20:28 -0800)]
Fix date-stamp regression in erc-fill-wrap

* lisp/erc/erc-fill.el (erc-fill-wrap, erc-fill-wrap-enable)
(erc-fill-wrap-disable): Add and remove `erc-stamp--insert-date-hook'
member.
(erc-fill--wrap-continued-predicate): Add function-valued variable for
modules to influence `erc-fill--wrap-continued-message-p', which was
originally introduced as part of bug#60936.
(erc-fill--wrap-rejigger-last-message): Move toward beginning of file.
(erc-fill--wrap-unmerge-on-date-stamp): New function.
(erc-fill-wrap): Use `erc-fill--wrap-continued-predicate'.  Restore
recently deleted hunk that reset the wrap marker upon seeing a date
stamp.
* test/lisp/erc/erc-scenarios-fill-wrap.el: New file.
* test/lisp/erc/resources/fill/wrap/merge-datestamp.eld: New file.

(cherry picked from commit 7aa91b299e9dd9f416a22658afed1a8edf323b30)

5 months agoAdd ERC module querypoll as monitor placeholder
F. Jason Park [Thu, 23 May 2024 05:59:54 +0000 (22:59 -0700)]
Add ERC module querypoll as monitor placeholder

* doc/misc/erc.texi: Add module `querypoll' to list of built-in
modules'.
* etc/ERC-NEWS: Mention new module `querypoll', and explain new
default behavior for deriving query membership from that of channels.
* lisp/erc/erc-goodies.el (erc--querypoll-ring)
(erc--querypoll-timer): New variables.
(erc-querypoll-exclude-regexp): New option.
(erc-querypoll-mode, erc-querypoll-enable, erc-querypoll-disable): New
module for polling with "WHO" requests for the presence of otherwise
"untracked" query targets.
(erc-querypoll-period-params): New variable.
(erc--querypoll-compute-period)
(erc--querypoll-target-in-chan-p)
(erc--querypoll-get-length)
(erc--querypoll-get-next)
(erc--querypoll-subscribe)
(erc--querypoll-on-352)
(erc--querypoll-send): New functions.
* lisp/erc/erc-speedbar.el (erc-speedbar-buttons): Dispatch queries as
if they were channels when `erc--queries-current-p' returns non-nil.
That is, show head counts alongside query targets as users come and
go.
(erc-speedbar-insert-target): Defer to `erc--queries-current-p' to
know whether to show a query in the style of a channel.  This affects
both the plain speedbar integration as well as the `nickbar' module
added for bug#63595.  Also, use question marks rather than the empty
string for query bullets, so that query and channel items are aligned
vertically.
* lisp/erc/erc.el (erc--queries-current-p): New function.
* test/lisp/erc/erc-goodies-tests.el
(erc--querypoll-compute-period)
(erc--querypoll-target-in-chan-p)
(erc--querypoll-get-length)
(erc--querypoll-get-next): New tests.  (Bug#70928)

(cherry picked from commit 6888bbbe832e14c3aaaa2c9750ed27e577e0983d)

5 months agoRetain client's own user in erc-server-users
F. Jason Park [Thu, 25 Apr 2024 12:16:23 +0000 (05:16 -0700)]
Retain client's own user in erc-server-users

* lisp/erc/erc-backend.el (erc-server-KICK, erc-server-PART): Use new
function `erc--remove-channel-user-but' instead of
`erc-remove-channel-users'.  In `erc-server-KICK', remove sender's
channel membership data after displaying the message so that nicks are
buttonized.  Return nil.  In `erc-server-PART', don't run
`erc-remove-channel-member' when the client itself has parted.
* lisp/erc/erc-common.el (erc--remove-user-from-targets): New
function.
* lisp/erc/erc.el (erc-remove-server-user): Redo doc string.
(erc--forget-server-user-function): New variable.
(erc--forget-server-user): New function.
(erc--forget-server-user-ignoring-queries): New function, the default
value of `erc--forget-server-user-function'.
(erc-remove-channel-user): Defer to `erc--forget-server-user-function'
to do the actual removal.
(erc-remove-user): Defer to `erc--remove-user-from-targets'.
(erc-remove-channel-users): Redo doc
(erc--remove-channel-users-but): New function.  The only use case thus
far is for protecting the client's own `erc-server-users' entry from
removal when draining `erc-channel-members' tables after the client
leaves a target buffer or quits.
(erc-kill-buffer-function): Don't remove own user from
`erc-server-users'.
* test/lisp/erc/erc-scenarios-base-renick.el
(erc-scenarios-base-renick-queries-solo): Assert own client parting
its only channel doesn't remove own user from server.  Also assert
that another user parting their only channel removes them from all
queries.  (Bug#70928)

(cherry picked from commit 5f84213c9802181b4d800615915e3c8dded7b94f)

5 months agoTether query rolls to channel membership in ERC
F. Jason Park [Thu, 9 May 2024 02:04:13 +0000 (19:04 -0700)]
Tether query rolls to channel membership in ERC

* lisp/erc/erc-backend.el (erc-server-JOIN): Update query membership
via `erc--ensure-query-member' when someone else joins a channel.
(erc-server-NICK): Update query membership via
`erc--ensure-query-member' after someone else changes their nick.
(erc-server-PRIVMSG): After printing a query message from some other
person, remove their nick's data from the query buffer's user table if
they're "untracked," i.e., not a member of a channel.
(erc-server-263, erc-server-263-functions): New function and variable,
a default response handler and hook for "RPL_TRYAGAIN", which servers
send for things like rejecting "WHO" and "WHOX" responses due to rate
limiting.
(erc-server-311): Fix call to `erc-update-user-nick' so the userhost
login component is no longer supplied as the `info' parameter but
rather, correctly, as the `login'.
(erc--extract-352-full-name): Factor out trailing hop-count and GECOS
parsing for use by overriding handlers or those for adjacent numerics.
(erc-server-352): Refactor to handle asterisk as `channel' parameter,
which indicates a nick rather than a channel target.
(erc-server-366): Update membership in all query buffers via
`erc--ensure-query-members' after all names have been received.
(erc-server-401): Forget a known user completely when the server
reports them as nonexistent.
* lisp/erc/erc-common.el (erc--get-server-user): New function, a thin
wrapper around `erc-get-server-user' for cases were inlining would
require declaring symbols not defined in erc-common.
* lisp/erc/erc.el (erc-channel-members): Mention that instances are
used for query-participant tables as well.
(erc--decouple-query-and-channel-membership-p): New variable, a
compatibility flag to access pre-5.6 query bookkeeping behavior.
(erc--ensure-query-member, erc--ensure-query-members): New functions.
(erc-cmd-QUERY): Ensure parties are present in the query buffer's
membership table if they're known to be on the server by simple virtue
of being present in some joined channel.
(erc-message-english-s352-you): New variable.
* test/lisp/erc/erc-scenarios-base-query-participants.el
(erc-scenarios-base-query-participants)
(erc-scenarios-base-query-participants/legacy): Rename former to
latter.  Enable compat flag to activate legacy query behavior in which
channel membership does not impact query membership.
(erc-scenarios-base-query-participants/coupled): New test asserting
new behavior in which channel membership dictates query
membership.  (Bug#70928)

(cherry picked from commit 04477cf97be9eb2bb5ae09eff114252864461f05)

5 months agoReuse old query buffers for reassumed nicks in ERC
F. Jason Park [Thu, 9 May 2024 02:04:13 +0000 (19:04 -0700)]
Reuse old query buffers for reassumed nicks in ERC

* lisp/erc/erc-backend.el
(erc--wrangle-query-buffers-on-nick-change): New function for handling
buffer renaming and message routing triggered by a nick change.  Such
twiddling used to reside in `erc-server-NICK' but has been separated
out for use by built-in modules overriding `erc-server-NICK'.  The
behavior has also changed to favor always reusing an existing query
buffer whenever possible instead of creating a new, <N>-suffixed
buffer.  This addresses some arguably unfinished business from
bug#48598.
(erc-server-NICK): Fix erroneous call to `erc-update-user-nick' that
passed the sender's login as the function's INFO argument.  Move
buffer renaming logic to `erc--wrangle-query-buffers-on-nick-change'
for use by "NICK" handlers managed by modules.  Also, print the notice
in all query buffers when the client changes its own nick.
(erc-server-QUIT): Show messages in all query buffers when the client
itself quits, but prevent `track' from updating the mode line with
redundant noise.
* lisp/erc/erc.el (erc-generate-new-buffer-name): Fix typo in doc.
(erc--query-list): New function.
* test/lisp/erc/erc-scenarios-base-query-participants.el: New file.
* test/lisp/erc/erc-scenarios-base-renick.el
(erc-scenarios-base-renick-queries-solo): Revise slightly to use
modern helper API.
(erc-scenarios-base-renick-queries/reassume): New test.
(erc-scenarios-base-renick-self/merge-query): New test.
* test/lisp/erc/resources/base/query-participants/legacy.eld: New file.
* test/lisp/erc/resources/base/reconnect/options-again.eld: Adjust
timeout.
* test/lisp/erc/resources/base/renick/queries/reassume.eld: New file.
* test/lisp/erc/resources/base/renick/self/manual.eld: Update timeouts.
* test/lisp/erc/resources/base/renick/self/merge-query-a.eld: New file.
* test/lisp/erc/resources/base/renick/self/merge-query-b.eld: New file.
(Bug#70928)

(cherry picked from commit 75aefe6514854bfdbe2a398cf1b7265012c9a88b)

5 months agoMention if an ERC module is local in its doc string
F. Jason Park [Fri, 24 May 2024 03:50:20 +0000 (20:50 -0700)]
Mention if an ERC module is local in its doc string

* lisp/erc/erc-common.el (erc--assemble-toggle)
(define-erc-module): Update language of doc string to indicate if a
module is local.
* test/lisp/erc/erc-tests.el (define-erc-module--global)
(define-erc-module--local)
(define-erc-module--local/permanent-locals): Update expected output.

(cherry picked from commit ab78cbfabc856b0f9c069ab42ad8827cdaa499ce)

5 months agoDelete original speedbar frame in erc-nickbar-mode
F. Jason Park [Tue, 21 May 2024 12:37:39 +0000 (05:37 -0700)]
Delete original speedbar frame in erc-nickbar-mode

* lisp/erc/erc-speedbar.el (erc-speedbar-buttons): Disable
`erc-nickbar-mode' when it's not displayed in a window.
(erc-speedbar--highlight-self-and-ops): Check `status' slot of
`erc-channel-user' object instead of calling accessors.
(erc-speedbar--hidden-speedbar-frame)
(erc-speedbar--emulate-speedbar): Add doc string.
(erc-speedbar--handle-delete-frame): New function.
(erc-speedbar--toggle-nicknames-sidebar): Remove function because its
conditional logic was needlessly complicated and is no longer needed.
(erc-speedbar--ensure): Create `speedbar-buffer' when needed, and
delete the original frame, but still keep a reference to it in
`erc-speedbar--hidden-speedbar-frame'.  Set
`dframe-delete-frame-function' to own handler.
(erc-speedbar--shutting-down-p): Remove unused variable.
(erc-speedbar--run-timer-on-post-insert)
(erc-speedbar--prod-dframe-timer): Rename former to latter.  Return
nil, and accept any number of args.
(erc-nickbar-mode, erc-nickbar-disable): Tear down completely when
disabling, regardless of universal argument.  This changes user-facing
behavior that was originally introduced with this module as part of
bug#63595.  Run `erc-speedbar--prod-dframe-timer' on
`erc-server-PONG-functions' as well as `erc-insert-post-hook' so that
the panel will eventually update if no messages are being received.
(erc-speedbar--dframe-controlled): Don't make frame visible because
it's been deleted and was never made invisible.
* test/lisp/erc/erc-scenarios-status-sidebar.el
(erc-scenarios-status-sidebar--nickbar): Update assertions.

(cherry picked from commit 1b633ea59ad7f27263bf2a74ecc0e7d048b5eab5)

5 months agoReturn nil from more ERC response handlers
F. Jason Park [Mon, 20 May 2024 06:04:49 +0000 (23:04 -0700)]
Return nil from more ERC response handlers

* etc/ERC-NEWS: Mention that certain aberrant response handlers now
return nil.
* lisp/erc/erc-backend.el (define-erc-response-handler): Mention that
body should explicitly return nil.
(erc-server-PART)
(erc-server-PING): Return nil.
* lisp/erc/erc-sasl.el (erc-sasl--destroy): Return nil.
* lisp/erc/erc.el (erc-display-message): Mention in doc string that
the return value is undefined.
(erc-kill-channel-hook): Fix package-version.
* test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Ensure
`erc--route-insertion' returns nil because this influences whether
response-handler hooks continue running.
* test/lisp/erc/erc-sasl-tests.el
(erc-sasl-create-client-ecdsa): Fix regression that made test
unusable, although it's still relatively useless and therefore skipped
by default.
* test/lisp/erc/erc-services-tests.el
(erc-services-tests--auth-source-standard)
(erc-services-tests--auth-source-announced): Clarify annotations.
* test/lisp/erc/erc-tests.el (erc-message): Don't return non-nil in
mocked `erc-display-message'.
(erc-send-modify-hook): Shadow `erc-send-modify-hook' because
`erc-stamp--date-mode' modifies it locally.

(cherry picked from commit 8c54a79ec10d21cfc961476d85db06b643260e38)

5 months agoEglot: run eglot-managed-mode-hook when turning off (bug#70958)
João Távora [Mon, 27 May 2024 21:58:48 +0000 (16:58 -0500)]
Eglot: run eglot-managed-mode-hook when turning off (bug#70958)

* lisp/progmodes/eglot.el (eglot--managed-mode): Run
  eglot-managed-mode-hook.

(cherry picked from commit 1a9128e0208d60f414401679d76f3722fa4085fd)