csharp-mode.el: Improve fontification of string-interpolation exprs
* lisp/progmodes/csharp-mode.el
(csharp-ts-mode--font-lock-settings): Remove too wide selector,
causing non-string content to be fonitified as strings. Add
additional eselectors to highlight variables inside
interpolation-expressions too. (Bug#78008)
Paul Nelson [Mon, 21 Apr 2025 20:14:53 +0000 (22:14 +0200)]
Add "forward history" support for some debuggers
* lisp/progmodes/gud.el (gud-query-cmdline): Add an optional
default-list parameter to allow passing a list of "forward
history" suggestions to the minibuffer.
(perldb, pdb, guiler): Use buffer file name to suggest a default
debugging command via "forward history".
* doc/emacs/building.texi (Starting GUD): Document the new
feature.
Paul Nelson [Mon, 21 Apr 2025 14:25:06 +0000 (16:25 +0200)]
Don't consider "Grep finished" lines as matches for file names
* lisp/progmodes/grep.el
(grep-compilation-transform-finished-rules): New variable
containing rules to prevent "Grep finished" lines from being
misinterpreted as matches for file names.
(grep-mode): Add these rules to
'compilation-transform-file-match-alist' (bug#77732).
Liu Hui [Mon, 21 Apr 2025 04:46:55 +0000 (12:46 +0800)]
Fix filename completion in Python shell (bug#77853)
'comint-filename-completion' may complete the filename at
wrong locations. Users who want proper filename completion
should use specialized completion backends (e.g. Jedi).
* lisp/progmodes/python.el (inferior-python-mode): Remove
'comint-filename-completion' in 'comint-dynamic-complete-functions'.
Before d50c82f3e98e ("Simplify
'help-enable-variable-value-editing' using 'string-edit'"),
'help-fns-edit-variable' would open a buffer in 'emacs-lisp-mode'
and would not allow exiting that buffer with an invalid Lisp
expression. Restore that functionality by enhancing 'string-edit'
to allow choosing a major mode and allow passing a function to
validate the buffer contents before returning.
* lisp/help-fns.el (help-fns-edit-variable): Call 'string-edit',
passing 'emacs-lisp-mode' and 'read'.
* lisp/textmodes/string-edit.el (string-edit--read): Add.
(string-edit): Add :major-mode and :read arguments and avoid
passive voice.
(read-string-from-buffer): Avoid passive voice in docs.
(string-edit-mode-map, string-edit-minor-mode-map)
(string-edit-mode, string-edit-minor-mode): Move 'string-edit'
keybindings to a minor mode.
(string-edit-done): Call 'string-edit--read' before exiting.
(Bug#77834)
* lisp/progmodes/python.el (python-nav-cache)
(python-nav-cache-tick): New variables.
(python-nav-cache-get, python-nav-cache-set)
(python-nav-with-cache): New functions.
(python-nav-beginning-of-block, python-nav-end-of-block): New
wrapper functions.
(python-nav--beginning-of-block): Renamed from
'python-nav-beginning-of-block'.
(python-nav--end-of-block): Renamed from
'python-nav-end-of-block'. (Bug#77620)
Performance optimization of 'python-info-statement-ends-block-p'
* lisp/progmodes/python.el (python-info-statement-ends-block-p):
Add a comparison of the indentation of the next statement with
the indentation of the current statement. (Bug#77620)
Yuan Fu [Sat, 26 Apr 2025 00:38:58 +0000 (17:38 -0700)]
Add multivar indent style in typescript-ts-mode (bug#77803)
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode-multivar-indent-style): New option.
(typescript-ts-mode--indent-rules): Support both styles.
Sean Whitton [Thu, 24 Apr 2025 07:38:34 +0000 (15:38 +0800)]
comment-indent: Handle BOL already within a multiline comment
* lisp/newcomment.el (comment-indent): Newly handle the case
that BOL is already within a multiline comment (bug#78003).
Thanks to Stefan Monnier for review and reworking the control
flow.
* lisp/arc-mode.el (archive-find-type): Detect more types of
split zip archives.
* test/lisp/arc-mode-tests.el (arc-mode-test-make-file)
(arc-mode-test-make-archive): Factor out functions from ...
(arc-mode-test-zip-ensure-ext): ... this test.
(define-arc-mode-test-on-type): Add macro to test function
`archive-find-type' and use the macro to test detection of
various archive types. (Bug 77898)
Juri Linkov [Wed, 23 Apr 2025 17:17:46 +0000 (20:17 +0300)]
Add the keyword ':copy-queries' to 'treesit-language-source-alist'.
* lisp/treesit-x.el (define-treesit-generic-mode): Add keyword
':copy-queries t' to the end of 'source'.
* lisp/treesit.el (treesit-language-source-alist):
Document the keyword ':copy-queries'.
(treesit--install-language-grammar-1): Add &rest args.
Process the keyword args. Call 'treesit--copy-queries'
when :copy-queries is non-nil.
(treesit--copy-queries): Add arg 'source-dir'. Copy queries
from source-dir as well. Copy only the file "highlights.scm".
w32: change the way text is measured when using DirectWrite
Now the glyph outline is inspected directly to get its real size,
as the direct measuring functions give generic values for some
fonts.
* src/w32dwrite.c (data structures): Added data structures from
header files that are not present in the 32bit MinGW build
environment.
(text_extents_internal): Call GetGlyphRunOutline to get exact
glyph vertical bounds. Add new parameter to make this optional
if case that information is not required.
(w32_dwrite_text_extents, w32_initialize_direct_write)
(w32_dwrite_draw): New parameter for 'text_extents_internal'.
(Bug#77171)
Juri Linkov [Tue, 22 Apr 2025 16:48:30 +0000 (19:48 +0300)]
* lisp/treesit-x.el: Use 'treesit-ensure-installed'.
(define-treesit-generic-mode): Append new item
to 'treesit-language-source-alist' instead of prepending.
(treesit-generic-mode-setup): Remove 'source' arg.
Use 'treesit-ensure-installed'.
(liquid-generic-ts-mode): Use 'treesit-ensure-installed'.
(alpinejs-generic-ts-setup): Run setup hook.
(treesit-generic-mode-font-lock-map): Add more mappings.
Sean Whitton [Tue, 22 Apr 2025 12:45:34 +0000 (20:45 +0800)]
Delete unused block-comment-start and block-comment-end
* lisp/newcomment.el (block-comment-start)
(block-comment-end): Delete.
(comment-indent):
* lisp/cedet/semantic/doc.el
(semantic-doc-snarf-comment-for-tag):
Remove use of the now-deleted variables.
Sean Whitton [Tue, 22 Apr 2025 12:42:45 +0000 (20:42 +0800)]
Revert addition of electric-block-comment-mode & follow-up commits
As presently under discussion in bug#77823, the intended new
functionality is not really about comments at all.
Remove it for now to allow us to redesign from a clean slate,
and to deal with the regression reported in bug#77823.
This reverts the following three changesets:
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 17 12:56:52 2025 -0600
New minor mode: `electric-block-comment-mode'
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 31 17:58:16 2025 -0600
Add block-comment-start and block-comment-end to supported modes
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Sun Apr 13 12:26:08 2025 -0600
João Távora [Fri, 18 Apr 2025 18:43:45 +0000 (19:43 +0100)]
Flymake: new flymake-diagnostic-format-alist (bug#77439, bug#77480)
* lisp/progmodes/flymake.el (flymake-diagnostic-text): Overhaul.
(flymake-diagnostic-format-alist): New defcustom.
(flymake--diagnostic-format): New util.
(flymake--eol-overlay-summary)
(flymake--highlight-line)
(flymake-eldoc-function): Use flymake--diagnostic-format.
(flymake--tabulated-diagnostic-origin): New helper.
(flymake--tabulated-entries-1): Use flymake--tabulated-diagnostic-origin.
(flymake--diagnostics-base-tabulated-list-format): "Backend" -> "Origin"
* doc/misc/flymake.texi (Customizable variable): Mention new variable.
João Távora [Thu, 17 Apr 2025 21:00:39 +0000 (22:00 +0100)]
Flymake: more powerful flymake-make-diagnostic and rework manual
Flymake backends may now explicitly specify an origin and a code for a
diagnostic in addition to the textual description. This change lays
groundwork for richer diagnostic listings and user options for
summarizing diagnostics, addressing bug#77439 and bug#77480.
* doc/misc/flymake.texi (Flymake API): Rename from "Extending
Flymake". Rework.
(Inspecting diagnostics): New section.
* lisp/progmodes/flymake.el (flymake--diag): Add origin, code and
message. Remove text.
(flymake-make-diagnostic): Support new origin, code and message.
(flymake-diagnostic-text): Rework.
Michael Albinus [Sun, 20 Apr 2025 16:16:14 +0000 (18:16 +0200)]
Fix emerge.el for remote files
* lisp/vc/emerge.el (emerge-make-diff-list)
(emerge-make-diff3-list): Set proper `default-directory' in order
to support remote files. (Bug#6850, Bug#74352)
Fix indentation of "{" on a new line of a function declaration
* lisp/progmodes/js.el (js--treesit-switch-body-helper): New
anchor helper function for the switch_body.
(js--treesit-member-chained-expression-helper): New anchor
helper function for chained calls in member_expression.
(js--treesit-arrow-function-helper): New anchor helper
function for arrow_function.
(js--treesit-indent-rules): Fix rule for the indentation of
"{" when of a new line of a function declaration. (Bug#76704)
Fix the indentation of the parent of arrow_function, member_expression,
switch_body, ternary_expression and sequence_expression.
Paul Eggert [Sun, 20 Apr 2025 05:50:28 +0000 (22:50 -0700)]
Omit trailing white space in one line
* oldXMenu/Recomp.c: Omit trailing spaces in C source code line.
This was the only such line found by this command:
grep '[ ]$' $(git ls-files | grep '\.[chmy]$')
Paul Eggert [Sun, 20 Apr 2025 01:44:52 +0000 (18:44 -0700)]
Avoid name clashes with static GnuTLS
Work around a bug in GnuTLS 3.7.11 and earlier: when built
statically, its mistakenly exports symbols hash_lookup and
hash_string, which collide with Emacs symbols of the same name,
preventing temacs from linking statically. Problem reported by
Greg A. Woods (Bug#77476).
Because GnuTLS never uses hash_lookup or hash_string this issue
ordinarily doesn’t seem to prevent temacs from linking to GnuTLS
on GNU/Linux, as it’s linked dynamically and the dynamic linker
never needs to resolve references to either symbol. However, I
suppose a clash or bug could occur even with dynamic linking if
Emacs later loads a module that uses either symbol.
Although GnuTLS should be fixed, Emacs should link statically to
current and older GnuTLS versions in the meantime, and it should
avoid potential problems with dynamic linking. Renaming the two
clashing names is an easy way to do this. For consistency with
the new name for hash_lookup, also rename hash_lookup_with_hash
and hash_lookup_get_hash.
* src/fns.c (hash_find_with_hash): Rename from hash_lookup_with_hash.
(hash_find): Rename from hash_lookup.
(hash_find_get_hash): Rename from hash_lookup_get_hash.
(hash_char_array): Rename from hash_string.
All uses changed.
Paul Eggert [Sat, 19 Apr 2025 19:15:51 +0000 (12:15 -0700)]
Don’t use Gnulib’s locale-h module
* admin/merge-gnulib (AVOIDED_MODULES):
Add locale-h, as Emacs should’t need this Gnulib module.
This change is needed for when we next run admin/merge-gnulib,
as some Gnulib dependencies changed recently.
Werner Fink [Mon, 7 Apr 2025 11:51:07 +0000 (13:51 +0200)]
Fix seccomp-filter for newer Linux kernels
* lib-src/seccomp-filter.c (MAP_DROPPABLE): Define if undefined.
(main): Use MAP_DROPPABLE flag. Allow `tcgetattr' call of glibc
on physical terminal devices. (Bug#77232)
Peter Oliver [Wed, 2 Apr 2025 14:15:02 +0000 (15:15 +0100)]
Tweak AppStream metadata to satisfy `appstream-util validate'
* etc/emacs.metainfo.xml: `appstream-util validate' suggests that
screenshot height and width attributes should match the actual size of
the image, and that captions be no longer than 50 chars and do not end
in `.'. Follow those rules.
Peter Oliver [Wed, 2 Apr 2025 14:06:05 +0000 (15:06 +0100)]
Add AppStream metadata about supported and recommended hardware
* etc/emacs.metainfo.xml: Note that Emacs is best with a keyboard, but
other forms of input are possible. Also note that Emacs can access the
Internet. A modestly sized display is sufficient.
Stefan Kangas [Sat, 19 Apr 2025 08:35:59 +0000 (10:35 +0200)]
; Fix failing diff-mode tests
* test/lisp/vc/diff-mode-resources/git.patch: Delete file, moving
its contents to...
* test/lisp/vc/diff-mode-tests.el (diff-mode-tests--git-patch):
...this new variable. Git merges kept deleting a trailing
whitespace in the patch signature, so let's do this instead.
(diff-mode-test-git-patch)
(diff-mode-test-git-patch/before-first-hunk)
(diff-mode-test-git-patch/signature): Use above new variable.
Stefan Kangas [Sat, 19 Apr 2025 06:48:17 +0000 (08:48 +0200)]
xterm.c: Move GTK3-specific variables into narrower scopes
Avoid declaring GTK3-specific variables in larger-than-necessary scopes,
especially under #ifdefs. Instead, declare them where used. This improves
readability and reduces #ifdef clutter without changing behavior.