Commit graph

95641 commits

Author SHA1 Message Date
Spencer Baugh
ae4171efdc Support numeric indexing in let-alist
let-alist is very useful.  But sometimes an alist contains a list in
the middle, which contains yet more alists.  Previously, this was
somewhat painful to deal with, and required something like:

(let-alist alist
  (let-alist (nth 0 .a)
    (let-alist (nth 3 .b)
       .c)))

Now, the following works:

(let-alist alist
  .a.0.b.3.c)

* lisp/emacs-lisp/let-alist.el (let-alist--access-sexp): Properly
parse numbers to handle lists.  (Bug#66509)
(let-alist--list-to-sexp): Use nth to handle numbers.
(let-alist): Update docs.
2024-09-19 03:54:59 +02:00
Juri Linkov
03a9919318 Additional fix for kill-region-dwim (bug#69097)
* lisp/simple.el (kill-region): Restore the original logic of
raising the error unless both 'beg' and 'end' are non-nil
since 'end' is always non-nil.
2024-09-18 20:37:44 +03:00
Juri Linkov
9026bfb571 More fixes for kill-region-dwim (bug#69097)
* lisp/simple.el (kill-region-dwim): Move the default nil
to the top of choices.
(kill-region): Set the FORCE argument of 'mark' to non-nil
if kill-region-dwim is non-nil.  That allows everyone to use
non-nil kill-region-dwim even if mark-even-if-inactive is nil.
Don't check 'last-command' if kill-region-dwim is non-nil.
That allows everyone to type C-w twice in a row to delete
two previous words.
2024-09-18 20:20:19 +03:00
Juri Linkov
3924730200 ; Small fix for 'grep-change-to-grep-edit-mode'
* lisp/progmodes/grep.el (grep-change-to-grep-edit-mode):
Use 'substitute-command-keys' like in 'occur-edit-mode'.
2024-09-18 19:59:35 +03:00
Manuel Giraud
5e377f4fcc Make `dired-do-open' work on more *nix systems
* lisp/dired-aux.el (dired-do-open): Make `dired-do-open' work
on more *nix systems (bug#73004).
2024-09-18 19:51:44 +03:00
F. Jason Park
50deb59aae Only conditionally resolve hosts in nsm-should-check
Libraries like `socks' need to run `nsm-verify-connection' without
performing DNS lookups.  This change allows them to achieve this by
binding `nsm-trust-local-network' to nil around calls to that function.

* lisp/net/nsm.el (nsm-should-check): Rework in a functionally
equivalent way, except forgo calling both `network-lookup-address-info'
and `network-interface-list' unless the various conditions regarding
`nsm-trust-local-network' are first satisfied.  Replace `mapc' with
`dolist' to align with modern sensibilities.   (Bug#53941)
2024-09-17 17:55:50 -07:00
Eshel Yaron
f1794a17b6
New user option 'completion-preview-ignore-case'
Completion Preview mode implicitly assumed that
'completion-ignore-case' is nil, and while it can also work
with 'completion-ignore-case' non-nil, the results are a bit
different than what you get with 'completion-at-point'.  Add
an option that controls case sensitivity explicitly and
specifically for Completion Preview mode, and clarify the
behavior when case differences are ignored.  (Bug#73234)

* lisp/completion-preview.el
(completion-preview-ignore-case): New user option.
2024-09-17 20:45:14 +02:00
Dmitry Gutov
8eb66cca78 Rename project-{find-file-in-root,root-find-file}
* lisp/progmodes/project.el (project-root-find-file):
Rename from 'project-find-file-in-root' (bug#73044).
2024-09-17 12:59:56 +03:00
Stefan Kangas
4464062f4e Remove some XEmacs compat code from cperl-mode.el
The 'initialize-new-tags-table' function is unconditionally available
after 'etags' has been loaded, which is done further up.

* lisp/progmodes/cperl-mode.el (cperl-write-tags): Remove XEmacs compat
code.
2024-09-15 14:02:36 +02:00
Mattias Engdegård
2cd5774689 * lisp/simple.el (kill-region-dwim): Rectify choice label. 2024-09-15 11:24:29 +02:00
Po Lu
7793b2fe2a Merge from savannah/emacs-30
709ce2aff1 Port to Haiku R1/beta5
21efdd5ef3 Fix c++-ts-mode font-lock for latest c++ grammar (bug#73191)
ffc00eac53 ; Set Transient's version and add admin/MAINTAINERS entry
3822a5e5d1 * admin/update-copyright: Print reminder to do manual upd...
43b678d3d2 * admin/notes/years: Update.
38de992a5a * etc/TODO: New item "support indentation guides".

# Conflicts:
#	admin/notes/years
#	doc/misc/transient.texi
#	lisp/progmodes/c-ts-mode.el
#	lisp/transient.el
2024-09-15 08:54:50 +08:00
Yuan Fu
21efdd5ef3
Fix c++-ts-mode font-lock for latest c++ grammar (bug#73191)
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--keywords): Add "thread_local" keyword.
(c-ts-mode--test-virtual-named-p): New function.
(c-ts-mode--font-lock-settings): Use named/anonymous "virtual" depending
on the grammar.
2024-09-14 11:09:45 -07:00
Jonas Bernoulli
ffc00eac53
; Set Transient's version and add admin/MAINTAINERS entry
* admin/MAINTAINERS: Add entry for externally maintained Transient
package.
* doc/misc/transient.texi: Bump version strings.
* lisp/transient.el: Bump version in Version header.
* lisp/transient.el (transient-version): New constant.
2024-09-14 19:23:40 +02:00
Sean Whitton
a6631eaec3 ; * lisp/simple.el (kill-region-dwim): Try to simplify docstring. 2024-09-14 17:09:48 +01:00
Philip Kaludercic
7451bd6e39 Allow 'kill-region' to kill the last word when there is no region
* etc/NEWS: Document the new user option.
* lisp/simple.el (kill-region-dwim): New option.
(kill-region): Respect 'kill-region-dwim'.  (Bug#69097)
2024-09-14 17:01:40 +01:00
David Fussner
b44c00669a Provide a modified xref backend for TeX buffers
In addition to providing a new `xref' backend, the patch also improves
the general handling of expl3 syntax.  Expl3 is the next-generation
LaTeX specification, and has for some time been available by default in
the LaTeX kernel.  The new syntax co-exists in many files with the
standard LaTeX2e syntax, so we try at least minimally to separate the
way modes handle the two specifications, both to reduce
visually-disturbing interference between them and also to improve the
`xref' backend.  (Bug#53749)

* lib-src/etags.c (TeX_commands): Improve parsing of commands in TeX
buffers.
(TEX_defenv): Expand list of commands to tag by default in TeX buffers.
(TeX_help):
* doc/emacs/maintaining.texi (Tag Syntax): Document new tagged commands.
(Identifier Search): Add note about semantic-symref-filepattern-alist,
auto-mode-alist, and xref-find-references.

* lisp/textmodes/tex-mode.el (tex-font-lock-suscript): Test for
underscore in expl3 files and regions, disable subscript face there.
(tex-common-initialization): Set up xref backend for in-tree TeX modes.
Detect expl3 files, and in others set up a list of expl3 regions.
(tex-expl-buffer-parse): New function called in previous.
(tex-expl-buffer-p): New variable to hold the result of previous.
(tex-expl-region-set): New function added to
'syntax-propertize-extend-region-functions' hook.
(tex-expl-region-list): New variable to hold the result of previous.
(tex--xref-backend): New function to identify the xref backend.
(tex--thing-at-point, tex-thingatpt--beginning-of-symbol)
(tex-thingatpt--end-of-symbol, tex--bounds-of-symbol-at-point):
New functions to return 'thing-at-point' for xref backend.
(tex-thingatpt-exclude-chars): New variable to do the same.
(xref-backend-identifier-at-point): New TeX backend method to provide
symbols for processing by xref.
(xref-backend-identifier-completion-table)
(xref-backend-identifier-completion-ignore-case)
(xref-backend-definitions, xref-backend-apropos): Placeholders to
call the standard 'etags' xref backend methods.
(xref-backend-references): Wrapper to call the default xref backend
method, finding as many relevant files as possible and using a bespoke
syntax-propertize-function when required.
(tex--collect-file-extensions, tex-xref-syntax-function): Helper
functions for previous.
(tex-find-references-syntax-table, tex--buffers-list)
(tex--xref-syntax-fun, tex--old-syntax-function): New variables for
the same.
2024-09-14 17:05:33 +02:00
Eli Zaretskii
98e582e74a Fix indentation of Fortran do-loops
* lisp/progmodes/fortran.el (fortran-calculate-indent): Fix regexp
for do-loops.  Reported by Ken Mankoff <km@kenmankoff.com>.
(Bug#73218)
2024-09-14 17:18:57 +03:00
Eli Zaretskii
0cf9886cdf Merge from origin/emacs-30
d509a35699 Fix regression in widget-move (bug#72995)
ef0276de82 ; * lisp/cus-edit.el (setopt): Doc fix.  (Bug#73098)
b115c2d5eb ; * lisp/minibuffer.el (completion-pcm--merge-completions...
3cda1fdc3b Correctly include fixed strings before a prefix wildcard ...
57d93d0259 ; * lisp/treesit.el (treesit-major-mode-setup): Doc fix.
ad289f364e ; Improve documentation of 'easy-menu-define'
3cad7cc8dc Set treesit-primary-parser for c and elixir ts mode
2f243fb91d ; Minor doc fix in treesit.el
6a6d7925c9 Fix range handling so it works for multibyte buffer (bug#...
76faf7e609 Revert "Read more on each call to treesit's buffer reader"
c70bd0e3fe Fix tree-sitter indent preset prev-adaptive-prefix
272df33fb8 ; * CONTRIBUTE: Minor copyedits.
8e1187e336 Improve NEWS entries
ca3932121a Don't fail uniquify-tests in non-version-controlled sourc...
79f68597ab ; * etc/ORG-NEWS: Fix typo.
d66b70f360 * doc/misc/auth.texi: Minor copy edits.
2c6b7b2da9 ; * admin/MAINTAINERS: Remove some entries for Artur Mala...
11e7ae3964 Fix bug#72254

# Conflicts:
#	etc/NEWS
2024-09-14 07:55:01 -04:00
Sean Whitton
f6417ba91b New commands unix-word-rubout, unix-filename-rubout
* lisp/simple.el (forward-unix-word): New function.
(unix-word-rubout, unix-filename-rubout): New commands.
* etc/NEWS: Announce the new commands.
2024-09-14 12:16:51 +01:00
Stephen Berman
d509a35699 Fix regression in widget-move (bug#72995)
* lisp/wid-edit.el (widget-move): Avoid advancing point only if it
is at the start of a widget at BOB.

* test/lisp/wid-edit-tests.el (widget-test-widget-move-bug72995): New test.
2024-09-14 12:42:49 +02:00
Visuwesh
db1eb8a282 Make the *grep* buffer editable
* 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)
2024-09-14 12:41:29 +03:00
Eli Zaretskii
ef0276de82 ; * lisp/cus-edit.el (setopt): Doc fix. (Bug#73098) 2024-09-14 12:33:36 +03:00
Eli Zaretskii
b115c2d5eb ; * lisp/minibuffer.el (completion-pcm--merge-completions): Fix comments. 2024-09-14 12:26:54 +03:00
Spencer Baugh
3cda1fdc3b Correctly include fixed strings before a prefix wildcard in PCM
In 03ac16ece4 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.
2024-09-14 12:24:08 +03:00
Eli Zaretskii
57d93d0259 ; * lisp/treesit.el (treesit-major-mode-setup): Doc fix. 2024-09-14 12:02:56 +03:00
Eli Zaretskii
ad289f364e ; 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)
2024-09-14 11:55:08 +03:00
Spencer Baugh
7c767ec781 Update completion-styles defcustom for variable overrides
In 69ec333eab I allowed
completion-styles to contain a list of bindings.  Now the
'defcustom' type also supports this.
Since the type is somewhat unusual (a value in the list can be
either a symbol or a list) I had to add a new widget to support
it.
* lisp/minibuffer.el (completion--styles-type): Update to allow
setting variable overrides.
(completion-styles, completion-category-overrides)
(completion-pcm-leading-wildcard): Update :version.

* lisp/wid-edit.el (widget-single-or-list-to-internal)
(single-or-list): Add.
2024-09-14 11:45:51 +03:00
Yuan Fu
3cad7cc8dc
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.
2024-09-14 00:46:05 -07:00
Yuan Fu
2f243fb91d
; Minor doc fix in treesit.el
* lisp/treesit.el (treesit-outline-search): Mention parameters.
(treesit-major-mode-setup): Mention outline setup.
2024-09-14 00:28:23 -07:00
Yuan Fu
c70bd0e3fe
Fix tree-sitter indent preset prev-adaptive-prefix
* lisp/treesit.el (treesit-simple-indent-presets): Use looking-at so the
call to match-string has the match data to work with.
2024-09-14 00:28:22 -07:00
Michael Albinus
0d07bc1a2d * lisp/net/tramp.el (tramp-wait-for-regexp): Deactivate (sit-for 0.005). 2024-09-14 08:57:19 +02:00
Eli Zaretskii
7376623a24 Improve accuracy of character categories
* lisp/international/characters.el: Assign 'digit' category to all
the characters whose Unicode 'general-category' is Nd.

* admin/unidata/blocks.awk: Add code to assign 'symbol' category
to all characters belonging to the 'symbol' script.

* etc/NEWS: Announce the above changes
2024-09-13 14:31:28 +03:00
Eli Zaretskii
04e8ad6489 Update Emacs sources for Unicode 16.0
* lisp/international/ucs-normalize.el (check-range): Update ranges
of character codes with decompositions.
* lisp/international/mule-cmds.el (ucs-names): Update unused
ranges.
* lisp/international/fontset.el (script-representative-chars)
(otf-script-alist, setup-default-fontset): Add new scripts.
* lisp/international/characters.el:
* admin/unidata/blocks.awk:
* test/manual/BidiCharacterTest.txt:
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part2): Update for Unicode
16.0.

* etc/NEWS: Announce support for Unicode 16.0.
2024-09-12 21:12:09 +03:00
Manuel Giraud
31e8500b06 Human readable last display time of killed buffer
* lisp/midnight.el (clean-buffer-list): Upon killing a buffer,
add a human readable last displayed information.  (Bug#73150)
2024-09-12 12:30:36 +03:00
Manuel Giraud
06de3ae412 Simple typo in `clean-buffer-list'
* lisp/midnight.el (clean-buffer-list): `delay' is always an
integer here.  (Bug#73144)
2024-09-12 12:28:06 +03:00
Michael Albinus
f283144658 Allow to disable symbolic links check in Dired
* doc/emacs/dired.texi (Misc Dired Features):
* doc/misc/tramp.texi (Frequently Asked Questions):
Explain dired-check-symlinks.

* etc/NEWS: Describe dired-check-symlinks.
Fix typos.

* lisp/dired.el (dired-check-symlinks): New defcustom.
(dired-font-lock-keywords): Use it.  (Bug#73046)
2024-09-11 17:42:24 +02:00
Paul Nelson
833158c0b7 Add Ediff feature for copying all differences
* lisp/vc/ediff-util.el (ediff-diff-to-diff): With universal
prefix, copy all differences.

* doc/misc/ediff.texi (Quick Help Commands): Document the new feature.
* etc/NEWS: Announce the new feature.

(Bug#72866)
2024-09-11 10:44:25 +02:00
Martin Rudalics
fc3a7f4529 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'.
2024-09-11 10:36:14 +02:00
fpi
8332b4dd07 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.
2024-09-11 10:04:23 +02:00
Po Lu
76487b7454 Merge from savannah/emacs-30
ee3e3a6311 ; Update version number of exec/configure.ac
c5925b6ba5 Fix heex-ts-mode indentation following previews elixir-mo...
c3383be5f0 ; * admin/make-tarball.txt: Improve last change.
8ddb54117f ; * admin/make-tarball.txt: Remove now unnecessary config...
7e194d33f9 * lisp/ldefs-boot.el: Update.
9019536ea6 Fix use of Uniscribe font driver in MinGW build
5c55c860db Avoid crashes in redisplay in batch-mode testing
ba2190e1ae ; * etc/NEWS: Fix indentation.
818c0cc9a5 eglot-test-rust-completion-exit-function: Fix failure in ...
f47297782b ; * doc/lispref/searching.texi (Rx Notation): Simplify rx...
03e5698167 Clarify the semantics of 'string-pixel-width'
9f0603207b ; * src/treesit.c: Minor cleanups of recent changes.
e0d3f74395 * src/treesit.c (treesit_debug_print_parser_list): Fix fo...
bed38ded73 ; * src/treesit.c (treesit_debug_print_parser_list): Fix ...
18c6487dbd ; * src/treesit.c: Add a prototype so there's no warning ...
bf23382f1f Read more on each call to treesit's buffer reader
3435464452 Fix the range handling in treesit.c
3fcec09f75 Add debugging function for treesit.c
0fd259d166 Fix elixir-ts-mode's range query
2329b36b1f ; project-files-relative-names: Update docstring (bug#72701)
e55e2e1c6b Make json-serialize always return a unibyte string (bug#7...
89c99891b2 ; * doc/lispref/os.texi (Suspending Emacs): Fix last change.
4f044d0d3d ; Improve documentation of 'suspend-emacs'
2024-09-11 13:21:58 +08:00
Yuan Fu
c5925b6ba5
Fix heex-ts-mode indentation following previews elixir-mode change
After the previous fix in elixir-ts-mode (0fd259d166), 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.
2024-09-10 20:07:20 -07:00
Andrea Corallo
7e194d33f9 * lisp/ldefs-boot.el: Update. 2024-09-10 23:39:34 +02:00
Michael Albinus
652a8a0838 Avoid 100% CPU load in Tramp
* lisp/net/tramp.el (tramp-wait-for-regexp): Add (sit-for 0.005)
prior calling `tramp-accept-process-output'.  This avoids 100% CPU
load.  (Bug#73046)
2024-09-10 10:04:01 +02:00
Eshel Yaron
466db35877
; Revise new command 'project-find-file-in-root'
* lisp/progmodes/project.el (project-find-file-in-root):
Call 'find-file' directly, not via 'call-interactively'.
Move interactive behavior to 'interactive' spec.
2024-09-09 19:43:21 +02:00
Michael Albinus
7d7aa65f63 ; Fix last change 2024-09-09 15:35:55 +02:00
Michael Albinus
d33d8c089b Silence compiler error
* lisp/net/tramp.el (tramp-file-name*): Embed `function-put' calls
with `tramp--with-startup'.
(tramp-active-command-completion-p)
* lisp/net/tramp-cache.el (tramp-get-hash-table): Remove declare
form.  Add `tramp-suppress-trace' function property.
2024-09-09 15:22:35 +02:00
Eli Zaretskii
03e5698167 Clarify the semantics of 'string-pixel-width'
* doc/lispref/display.texi (Size of Displayed Text):
* lisp/emacs-lisp/subr-x.el (string-pixel-width):
* src/xdisp.c (Fwindow_text_pixel_size, Fbuffer_text_pixel_size):
Doc fixes.  (Bug#73129)
2024-09-09 14:28:12 +03:00
Mattias Engdegård
95371fa754 ; * lisp/emacs-lisp/chart.el (chart--directory-size): Simpler regexp
The empty regexp matches any string.
2024-09-09 10:30:02 +02:00
Yuan Fu
0fd259d166
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.
2024-09-08 20:52:20 -07:00
Dmitry Gutov
2329b36b1f ; project-files-relative-names: Update docstring (bug#72701) 2024-09-09 00:00:45 +03:00