Philip Kaludercic [Sat, 15 Jun 2024 12:44:06 +0000 (14:44 +0200)]
Merge remote-tracking branch 'github-which-key/master'
Po Lu [Tue, 4 Jun 2024 08:21:58 +0000 (16:21 +0800)]
Temporarily repair build with Android NDK r10b
* configure.ac (gl_cv_header_working_endian_h): Unconditionally
define to yes on Android.
Po Lu [Tue, 4 Jun 2024 07:16:01 +0000 (15:16 +0800)]
Correct previous change
* msdos/sedlibmk.inp (NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H)
(NEXT_ENDIAN_H): Define to machine/endian.h.
Po Lu [Tue, 4 Jun 2024 07:12:18 +0000 (15:12 +0800)]
Fix the DJGPP build
* config.bat: Update endian.in-h from endian.in.h.
* msdos/sedlibmk.inp (HAVE_ENDIAN_H)
(NEXT_AS_FIRST_DIRECTIVE_ENDIAN_H, NEXT_ENDIAN_H, ENDIAN_H)
(ENDIAN_H_JUST_MISSING_STDINT, GL_GENERATE_ENDIAN_H_CONDITION):
Define appropriately for DJGPP.
Juri Linkov [Tue, 4 Jun 2024 06:37:02 +0000 (09:37 +0300)]
* lisp/outline.el (outline-revert-buffer-restore-visibility): New function.
(outline-minor-mode): Add 'outline-revert-buffer-restore-visibility'
to 'revert-buffer-restore-functions' (bug#69511).
Paul Eggert [Tue, 4 Jun 2024 04:57:53 +0000 (21:57 -0700)]
Update from Gnulib by running admin/merge-gnulib
* lib/endian.c, lib/endian.in.h, m4/endian_h.m4, m4/sys_cdefs_h.m4:
New files, copied from Gnulib.
Paul Eggert [Mon, 3 Jun 2024 21:43:10 +0000 (14:43 -0700)]
lwlib: pacify gcc -Wmissing-variable-declarations
* lwlib/lwlib.c (lwlib_toolkit_type): Remove unused var.
* lwlib/xlwmenu.c (submenu_destroyed): Now static.
* src/xmenu.c (widget_id_tick): Declare extern, as a FIXME.
Jim Porter [Sun, 2 Jun 2024 20:07:10 +0000 (13:07 -0700)]
Check for a real process when trying to find password prompts in Eshell
* lisp/eshell/esh-mode.el (eshell-watch-for-password-prompt): Use
'eshell-head-process'.
Jim Porter [Fri, 31 May 2024 16:36:03 +0000 (09:36 -0700)]
Add an "Interaction" chapter to the Eshell manual
* doc/misc/eshell.texi (Interaction): New chapter.
(Completion, History): Move into "Interaction" and add key indexing.
(Key rebinding): Add key indexing.
(Command Index): Add this index.
Po Lu [Tue, 4 Jun 2024 02:23:13 +0000 (10:23 +0800)]
Provide additional Android metadata
* java/AndroidManifest.xml.in: Enable preserving user data
beyond uninstallation, restarting activities without persiting
state, increase maximum number of simultaneously open
activities, and provide a sensible category.
Po Lu [Tue, 4 Jun 2024 02:03:01 +0000 (10:03 +0800)]
Enable downgrading between this and future releases of Emacs
* java/AndroidManifest.xml.in: Fix `versionCode' at 30.
Juri Linkov [Mon, 3 Jun 2024 18:13:38 +0000 (21:13 +0300)]
Move revert-buffer-restore-functions use from buff-menu.el to outline.el
* lisp/buff-menu.el (Buffer-menu-mode): Remove
revert-buffer-restore-functions with handling of
outline-minor-mode and move it to outline-minor-mode.
* lisp/outline.el (outline-minor-mode):
Add revert-buffer-restore-functions to call
outline-minor-mode-highlight-buffer after reverting the buffer
with outline-minor-mode and outline-minor-mode-highlight
where font-lock can't be used to update highlighting.
Eli Zaretskii [Mon, 3 Jun 2024 18:13:05 +0000 (21:13 +0300)]
Avoid assertion violations in 'try_window_id'
* src/xdisp.c (try_window_id): Avoid assertions in
'find_first_unchanged_at_end_row' due to 'init_iterator' freeing
all the realized faces. (Bug#71274)
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.
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)
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.
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.
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
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.
Andrea Corallo [Fri, 31 May 2024 15:00:50 +0000 (17:00 +0200)]
* lisp/emacs-lisp/comp.el (native-compile): Type declare.
Mattias Engdegård [Mon, 3 Jun 2024 14:52:27 +0000 (16:52 +0200)]
; compilation-error-regexp-alist-alist order comment
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.
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'.
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.
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.
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
Eli Zaretskii [Mon, 3 Jun 2024 11:36:38 +0000 (14:36 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
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)
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.
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)
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.
Po Lu [Mon, 3 Jun 2024 08:36:20 +0000 (16:36 +0800)]
; * doc/lispref/display.texi (Image Descriptors): Insert missing text.
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.
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.
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.
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)
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".
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".
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.
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)
Po Lu [Sun, 2 Jun 2024 08:39:18 +0000 (16:39 +0800)]
; * etc/NEWS: Name the systems that support touch-screen events.
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'.
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.
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.
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.
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.
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.
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.
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.
Eli Zaretskii [Sat, 1 Jun 2024 17:40:53 +0000 (20:40 +0300)]
; * doc/emacs/dired.texi (Image-Dired): Improve and extend.
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.
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.
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.
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.
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.
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.
Eli Zaretskii [Sat, 1 Jun 2024 12:37:51 +0000 (15:37 +0300)]
; Fix a typo.
Eli Zaretskii [Sat, 1 Jun 2024 12:34:43 +0000 (08:34 -0400)]
Merge from origin/emacs-29
bf50aa38f9d Improve documentation of case-conversion commands
225b426f256 ; Fix typos
Eli Zaretskii [Sat, 1 Jun 2024 12:33:10 +0000 (15:33 +0300)]
; * lisp/image/image-dired.el (w32-shell-execute): Declare.
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.
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.
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.
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.
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)
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.
Eli Zaretskii [Fri, 31 May 2024 06:36:42 +0000 (09:36 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Fri, 31 May 2024 06:36:03 +0000 (09:36 +0300)]
; * src/w32image.c (thumb_type_data): Revert parts of recent change.
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".
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).
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.
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.
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.
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.
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)
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).
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.
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.
Alan Mackenzie [Thu, 30 May 2024 12:40:07 +0000 (12:40 +0000)]
In normal-mode, make c-mode call c-mode when CC Mode is loaded
As regards which mode normal-mode calls for the symbols c-mode,
etc., the first of the following which applies holds:
(i) If the user has made a pertinent entry in
major-mode-remap-alist, this is used.
(ii) If CC Mode has been loaded, c-mode is called.
(iii) If library c-ts-mode has been loaded, c-ts-mode is
called.
(iv) Otherwise c-mode is called.
* lisp/progmodes/cc-mode.el (top level): Add entries to
major-mode-remap-defaults to implement the above.
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>
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)
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).
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.
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.
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.
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).
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).
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'.
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.
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
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.
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)
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'.
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.
Eli Zaretskii [Wed, 29 May 2024 15:50:23 +0000 (11:50 -0400)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Eli Zaretskii [Wed, 29 May 2024 15:48:27 +0000 (11:48 -0400)]
; Update ldefs-boot.el
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.
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)
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.
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)
Andrea Corallo [Wed, 29 May 2024 14:30:16 +0000 (16:30 +0200)]
Add some documentation for 'help-find-source'
* doc/emacs/help.texi (Name Help): Add 'help-find-source' entry.
* etc/NEWS: Likewise.