* lisp/progmodes/compile.el (compilation--update-markers):
Factor out function...
(compilation-next-error-function): ...from here. Adjust
to use the above.
* lisp/progmodes/grep.el (grep-edit--prepare-buffer)
(grep-edit-mode-map, grep-edit-mode-hook, grep-edit-mode)
(grep-change-to-grep-edit-mode, grep-edit-save-changes): Add
new 'grep-edit-mode' to make the grep results editable like
in 'occur-edit-mode' by using the 'occur' framework.
(grep-mode-map): Bind 'e' to the new command
'grep-change-to-grep-edit-mode'.
* doc/emacs/building.texi (Grep Searching): Update Info
manual to include the above command.
* etc/NEWS: Announce the change. (Bug#70820)
Spencer Baugh [Mon, 26 Aug 2024 14:12:51 +0000 (10:12 -0400)]
Correctly include fixed strings before a prefix wildcard in PCM
In 03ac16ece40ba3e3ba805d6a61cc457d84bf3792 I fixed a bug with the
PCM implementation of substring completion, relating to the handling
of PCM wildcards.
However, this fix was incomplete. This change completes the fix by
also including a fixed string if it appears before a 'prefix'
wildcard, even if 'try-completion' doesn't discover that fixed
string grows to a unique completion.
I discovered this bug while working on enhancements to PCM
completion related to 'completion-pcm-leading-wildcard'.
* lisp/minibuffer.el (completion-pcm--merge-completions): Include
fixed strings before 'prefix wildcard. (Bug#72819)
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test for this behavior.
Eli Zaretskii [Sat, 14 Sep 2024 08:55:08 +0000 (11:55 +0300)]
; Improve documentation of 'easy-menu-define'
* doc/lispref/keymaps.texi (Easy Menu):
* lisp/emacs-lisp/easymenu.el (easy-menu-define): Document that
SYMBOL is also defined as a variable. (Bug#73108)
Yuan Fu [Sat, 14 Sep 2024 07:46:05 +0000 (00:46 -0700)]
Set treesit-primary-parser for c and elixir ts mode
For buffers with multiple parsers, it's important to set this variable
so font-lock invalidation works smoothly.
* lisp/progmodes/c-ts-mode.el (c-ts-mode): Set treesit-primary-parser.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode): Set
treesit-primary-parser.
We move around the gap, narrow regions, ralloc, etc, and don't have a
way to invalidate previously given range. So tree-sitter can't be given
the full range.
Robert Pluim [Fri, 13 Sep 2024 14:08:56 +0000 (16:08 +0200)]
Use stable URLs for files imported from Unicode
* admin/notes/unicode: Point people at "admin/unidata/README" for URLs
for Unicode files.
* admin/unidata/README: Use stable URLs for the various files. Remove
dates, the files self-describe their dates anyway.
Yuan Fu [Wed, 28 Aug 2024 05:31:42 +0000 (22:31 -0700)]
Add Ftreesit_grammar_location
* src/treesit.c (treesit_loaded_lang): New struct.
(treesit_load_language): Return a struct instead of just the language
object. The struct contains both the language object and the path to
the shared library.
(Ftreesit_language_available_p, Ftreesit_language_abi_version)
(treesit_ensure_query_compiled, Ftreesit_parser_create): Update
call of treesit_load_language.
(Ftreesit_grammar_location): New function.
Martin Rudalics [Wed, 11 Sep 2024 08:36:14 +0000 (10:36 +0200)]
For minibuffer windows record minibuffers only (Bug#72487)
* src/minibuf.c (zip_minibuffer_stacks): Use wset type
functions. Call 'record-window-buffer' instead of
'push-window-buffer-onto-prev' to handle all sorts of buffers
shown in minibuffer windows in a uniform way.
(read_minibuf): Call 'record-window-buffer' instead of
'push-window-buffer-onto-prev' for same reason as previous.
* lisp/calculator.el (calculator-update-display)
(calculator-save-and-quit): Make sure calculator buffer is live
before operating on it.
* lisp/window.el (record-window-buffer): Handle case where
WINDOW is a minibuffer window: Unconditionally remove WINDOW's
buffer from WINDOW's list of previous buffers and push it if
and only if it is a live minibuffer (Bug#72487). Do not run
'buffer-list-update-hook' if WINDOW is a minibuffer window.
(push-window-buffer-onto-prev): Make it an alias of
'record-window-buffer' so it will run the latter's checks.
(replace-buffer-in-windows): Handle minibuffer windows and
rewrite doc-string accordingly.
* doc/lispref/windows.texi (Buffers and Windows): Explain
handling of minibuffer windows in 'replace-buffer-in-windows'.
fpi [Wed, 28 Aug 2024 16:33:20 +0000 (18:33 +0200)]
Allow comments to organizer in icalendar event replies (Bug#72831)
* lisp/gnus/gnus-icalendar.el
(gnus-icalendar-event--build-reply-event-body): Add optional COMMENT
argument to be inserted into the reply.
(gnus-icalendar-event-reply-from-buffer): Add COMMENT argument to be
passed through to gnus-icalendar-event--build-reply-event-body
(gnus-icalendar-reply-accept, gnus-icalendar-reply-tentative,
gnus-icalendar-reply-decline): If interactively called with a prefix
argument ask user for a COMMENT to add to the reply.
* test/lisp/gnus/gnus-icalendar-tests.el
(gnus-icalendar-accept-with-comment,
gnus-icalendar-decline-without-changing-comment): New tests.
Yuan Fu [Wed, 11 Sep 2024 02:29:31 +0000 (19:29 -0700)]
Fix heex-ts-mode indentation following previews elixir-mode change
After the previous fix in elixir-ts-mode (0fd259d166c), embedded heex
code are indented like this:
1 defmodule Foo do
2 def foo(assigns) do
3 ~H"""
4 <span>
5 text
6 </span>
7 """
8 end
9 end
The indent rule finds the beginning of the parent heex node, and uses
the indentation of that line as anchor with an offset of 0. Previously
the parent heex node (fragment) starts at EOL of line 3; after the
previous commit, it now starts at BOL of line 4. To fix the
indentation, I changed the anchor to the beginning of the elixir
(rather than heex) node at point, which is at EOL at line 3.
* lisp/progmodes/heex-ts-mode.el (heex-ts--indent-rules): Use the elixir
node that contains the heex code as the anchor, instead of the heex root
node.
Eli Zaretskii [Tue, 10 Sep 2024 12:14:47 +0000 (15:14 +0300)]
Fix use of Uniscribe font driver in MinGW build
This was inadvertently broken when Windows 9X support was
fixed in June 2024.
* src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper): Set
'uniscribe_available' non-zero in non-Cygwin builds. (Bug#73159)
eglot-test-rust-completion-exit-function: Fix failure in -Q session
* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Check for buffer liveness (https://debbugs.gnu.org/72765#29).
(eglot-test-rust-completion-exit-function): Don't expect snippet
expansion to happen (no yasnippet in batch mode).
Yuan Fu [Mon, 9 Sep 2024 00:28:26 +0000 (17:28 -0700)]
Fix elixir-ts-mode's range query
* lisp/progmodes/elixir-ts-mode.el:
(elixir-ts--treesit-range-rules): Add underscore in front of the name
capture, so Emacs won't put heex parser on it.
Eli Zaretskii [Sun, 8 Sep 2024 16:17:48 +0000 (19:17 +0300)]
Fix :type of some user options
* lisp/which-key.el:
* lisp/progmodes/python.el:
* lisp/play/animate.el:
* lisp/pixel-scroll.el:
* lisp/image/image-dired.el:
* lisp/htmlfontify.el: Change :type of user options from 'float'
to 'number' where integer values make sense. (Bug#73098)
Eli Zaretskii [Sat, 7 Sep 2024 15:38:40 +0000 (18:38 +0300)]
; Improve documentation of 'suspend-emacs'
* doc/lispref/os.texi (Suspending Emacs):
* src/keyboard.c (Fsuspend_emacs): Document possible failures
in sending STUFFSTRING to the shell. (Bug#73100).
Support for custom php.ini for the built-in PHP web server.
A new CONFIG attribute, which defaults to 'php-ts-mode-php-config',
allows an alternative php.ini file to be specified for the built-in web
server. The 'php-ts-mode-run-php-webserver' function, when called
interactively with a prefix argument, also requires this new attribute.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--parent-html-bol):
Fix docstring.
* lisp/progmodes/php-ts-mode.el (php-ts-mode-run-php-webserver):
New CONFIG attribute. Update docstring.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--webserver-read-args):
Support the new TYPE. Update docstring. (Bug#72966)
Eli Zaretskii [Sat, 7 Sep 2024 09:17:24 +0000 (12:17 +0300)]
Fix 'chart-space-usage' on MS-Windows
* lisp/emacs-lisp/chart.el (chart--file-size)
(chart--directory-size): New functions.
(chart-space-usage): Invoke 'du' correctly on MS-Windows. Provide
alternative implementation in Lisp when 'du' is not installed,
using 'chart--directory-size' and 'chart--file-size'. (Bug#72919)
Eli Zaretskii [Sat, 7 Sep 2024 08:27:03 +0000 (11:27 +0300)]
Fix alignment and documentation of vtable.el
* lisp/emacs-lisp/vtable.el (vtable--insert-header-line): Ensure
proper alignment between the columns in header-line and in the
body of the table. (Bug#73032)
* doc/misc/vtable.texi (Making A Table): Document the defaults of
the various keyword parameters.
Eli Zaretskii [Sat, 7 Sep 2024 08:15:43 +0000 (11:15 +0300)]
Remove low-level keyboard hook when attaching GDB to Emacs on Windows
This fixes the problem whereby attaching GDB to a running Emacs
on MS-Windows would slow down keyboard input, because the
low-level keyboard hook installed by Emacs at startup was still
installed, but with Emacs stopped, the hook code couldn't run,
and therefore the OS would time-out waiting for the hook to
return. Now when GDB is attached to Emacs, it will remove the
hook right away.
* src/.gdbinit: Call 'remove_w32_kbdhook' if the keyboard hook is
already installed.
* src/alloc.c (defined_WINDOWSNT): New enum.
(gdb_make_enums_visible): Add 'defined_WINDOWSNT'.
Eli Zaretskii [Sat, 7 Sep 2024 07:42:01 +0000 (10:42 +0300)]
Fix multisession.el when SQLite becomes unavailable
This is for the case when the user customizes multisession
to use SQLite, but then built-in SQLite support becomes
unavailable for some reason (e.g., upgrade the OS).
* lisp/emacs-lisp/multisession.el (multisession-backend-value)
(multisession--backend-set-value, multisession--backend-values)
(multisession--backend-delete): Call next method if built-in
SQLite support is not available. Suggested by Stefan Monnier
<monnier@iro.umontreal.ca>. (Bug#72788)
F. Jason Park [Mon, 12 Aug 2024 04:55:32 +0000 (21:55 -0700)]
Fix discrepancies in auth-source-pass vs netrc behavior
The option `auth-source-pass-extra-query-keywords' aims to make its
back end hew as close to the other built-in ones as possible, except
WRT features not yet implemented, such as arbitrary "attribute"
retrieval and new entry creation. This change only concerns behavior
exhibited when the option is enabled.
* lisp/auth-source-pass.el (auth-source-pass--match-parts): Account
for the case in which a query lacks a reference parameter for a
`:port' or `:user' but still requires one or both via the `:require'
keyword. Previously, such a query would fail even when an entry met
this requirement by simply specifying a field with any non-null value
corresponding to the required parameter.
(auth-source-pass--find-match-many): Account for the baseline case
where a matching entry lacks a secret and the user doesn't require
one. Although this function doesn't currently return so-called
"attributes" from the contents of a matching decrypted file, were it
to eventually, this case would no longer be academic.
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-extra-query-keywords--req-noparam-miss-netrc)
(auth-source-pass-extra-query-keywords--req-noparam-miss)
(auth-source-pass-extra-query-keywords--req-param-netrc)
(auth-source-pass-extra-query-keywords--req-param): New tests.
(auth-source-pass-extra-query-keywords--netrc-baseline): New test
asserting behavior of netrc backend when passed a lone `:host' as a
query parameter.
(auth-source-pass-extra-query-keywords--baseline): Reverse expected
outcome to match that of the netrc reference implementation.
(bug#72441)
Several users have asked me for a command which is just
find-file, but starting from the project root. In large
projects, where project-files is expensive, this will have
substantially better performance than project-find-file.
Also, it allows opening files which aren't included in
project-files without paying the further cost of running
project--files-in-directory (which is what happens when passing
INCLUDE-ALL=t to project-find-file).
Also, it may help with user confusion about why
project-find-file doesn't behave like find-file (which I've
encountered a few times).
This command is equivalent to C-x p o C-x C-f, but it's nice to
be able to bind it to a specific key.
Overall, this is easy enough to provide, so let's just do that.
Eli Zaretskii [Fri, 6 Sep 2024 06:34:20 +0000 (09:34 +0300)]
Rework fix of MinGW build due to Gnulib update
This commit finishes the rework started by reverting changes
to lib/sig2str.h, by adding Emacs-private additions to
signal.h.
* nt/inc/signal.h: New file, defines SIG2STR_MAX and
prototypes of 'sig2str' and 'str2sig'.