1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 00:31:01 -08:00
Commit graph

179351 commits

Author SHA1 Message Date
john muhl
c5656af2ff ; Add tests for 'lua-mode'
* test/lisp/progmodes/lua-mode-resources/font-lock.lua:
* test/lisp/progmodes/lua-mode-resources/hide-show.lua:
* test/lisp/progmodes/lua-mode-resources/indent.erts:
* test/lisp/progmodes/lua-mode-resources/movement.erts:
* test/lisp/progmodes/lua-mode-resources/which-function.lua:
* test/lisp/progmodes/lua-mode-tests.el: New file.
2025-08-25 09:59:04 +08:00
john muhl
38a0775742 * etc/NEWS: Mention 'lua-mode' merge. 2025-08-25 09:59:04 +08:00
john muhl
c042611106 Add warn to 'lua-mode' builtins
* lisp/progmodes/lua-mode.el (lua--builtins): Include warn.
2025-08-25 09:59:04 +08:00
john muhl
22e3ba30fa ; Improve compliance of 'lua-mode'
* lisp/progmodes/lua-mode.el: Fix byte-compiler warnings, placate
checkdoc and improve consistency of comment formatting.
2025-08-25 09:59:04 +08:00
john muhl
7fabc65484 ; Update comments & requires in 'lua-mode' 2025-08-25 09:59:04 +08:00
john muhl
8af0064a74 Remove trivial cl-* stuff from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-process-buffer, lua--signum):
Replace 'cl-assert'.
(lua-accumulate-indentation-info): Replace 'cl-dolist' with
'dolist'.
2025-08-25 09:59:04 +08:00
john muhl
426167a8f3 Replace big regexps w/ rx expressions in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-block-regexp)
(lua-indentation-modifier-regexp, lua-cont-eol-regexp)
(lua-cont-bol-regexp): Use rx.
2025-08-25 09:59:04 +08:00
john muhl
2e454bea03 ; Adjust code style in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-prefix-key)
(lua-goto-matching-block): Replace 'let...if' with 'if-let*'.
(lua--fill-paragraph, lua-goto-matching-block-token): Replace
'let...when' with 'when-let*'.
(lua-comment-start-pos): Replace 'unless..and' with 'if-let*'.
(lua-skip-ws-and-comments-backward)
(lua-skip-ws-and-comments-forward): Remove unnecessary 'setq'.
(lua-indent-line): Replace 'when...not' with 'unless'.
(lua-calculate-string-or-comment-indentation): Formatting.
(lua-find-matching-token-word): Remove a level of 'let' nesting,
replace 'when...not' with 'unless'.
(lua-indent-line): Combine 'setq's.
2025-08-25 09:59:04 +08:00
john muhl
bf9e502e70 Remove unnecessary 'progn' in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-accumulate-indentation-info)
(lua--goto-line-beginning-rightmost-closer): Delete.
2025-08-25 09:59:04 +08:00
john muhl
142f1b2a9b Replace 1-armed 'if' with 'when' in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua--customize-set-prefix-key)
(lua-electric-match, lua-prefix-key-update-bindings)
(lua-indent-line, lua-find-matching-token-word)
(lua-goto-matching-block-token, lua-last-token-continues-p)
(lua-is-continuing-statement-p)
(lua--goto-line-beginning-rightmost-closer, lua-start-process)
(lua-prompt-line): Replace.
2025-08-25 09:59:04 +08:00
john muhl
ee36cac7ba Prefer 'defvar-local' in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-default-command-switches)
(lua-electric-flag, lua--repl-buffer-p): Replace
'make-variable-buffer-local' with 'defvar-local'.
2025-08-25 09:59:04 +08:00
john muhl
fd6d5b65b5 Remove unnecessary 'setq' from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua--rx-bindings): Combine variable
definition and assignment.
2025-08-25 09:59:04 +08:00
john muhl
2fe72d48d3 Cleanup whitespace in 'lua-mode' 2025-08-25 09:59:04 +08:00
john muhl
6465b3cbec Cleanup defcustoms in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-mode-hook): Add options.
(lua-indent-level, lua-comment-start, lua-comment-start-skip)
(lua-default-application, lua-default-command-switches)
(lua-always-show, lua-documentation-function)
(lua-documentation-url, lua-prefix-key, lua-prompt-regexp)
(lua-indent-string-contents)
(lua-indent-nested-block-content-align)
(lua-indent-close-paren-align, lua-jump-on-traceback)
(lua-mode-hook, lua-mode, lua-luacheck-program): Delete group,
add version.
2025-08-25 09:59:04 +08:00
john muhl
b7d13f0de0 Remove unnecessary code from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-traceback-line-re)
(lua-start-process): compile.el has Lua support now.
2025-08-25 09:59:04 +08:00
john muhl
509c1af9fc Remove advice from 'lua-mode'
* lisp/progmodes/lua-mode.el (lua--compilation-find-file)
(compilation-find-file, lua--compilation-goto-locus)
(compilation-goto-locus): Delete.
2025-08-25 09:59:04 +08:00
john muhl
3fa5aa47be Use easy-menu in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-mode-menu): Delete.
(lua-mode-map): Use 'easy-menu-define'.
2025-08-25 09:59:04 +08:00
john muhl
0b1b967781 Remove obsolete code from 'lua-mode'
* lisp/progmodes/lua-mode.el: Remove Emacs<27 compatibility code.
(lua-emacs-menu): Remove XEmacs compatibility code.
2025-08-25 09:59:04 +08:00
Juergen Hoetzel
0d3504227a * lisp/progmodes/lua-mode.el: Import lua-mode. 2025-08-25 09:58:34 +08:00
Dmitry Gutov
bb0ede711e Have project-switch-to-buffer use a distinct completion category
* etc/NEWS: Mention the change.

* lisp/minibuffer.el (completion-category-defaults):
Add an entry for it.

* lisp/progmodes/project.el (project--buffers-completion-table):
Return category 'project-buffer'.
2025-08-24 03:23:48 +03:00
Dmitry Gutov
0e37977546 Follow-up to previous changes in project--read-project-buffer
* lisp/progmodes/project.el (project--buffers-completion-table):
New function, use it to implement the no-internal/internal
fallback logic from 'internal-complete-buffer', apply the
category and cycle-sort-function (bug#77312).
(project--read-project-buffer): Use it.  Skip 'read-buffer' in
favor of 'completing-read'.  But make sure to honor
read-buffer-completion-ignore-case and use format-prompt when
the function is available.  Unify two execution paths.
2025-08-24 03:23:48 +03:00
Dmitry Gutov
b2186b5c20 Add NEWS entry for project-switch-buffer change from bug#77312 2025-08-24 03:23:48 +03:00
Eli Zaretskii
d3d93bc382 ; * lisp/ldefs-boot.el: Update. 2025-08-23 10:34:23 -04:00
Eli Zaretskii
9ef78272f6 Merge from origin/emacs-30
b3ed4876b6 ; Improve documentation of Edebug
fdad3417dc ; Fix typo in 'cursor-type' widget
2025-08-23 10:30:47 -04:00
Eli Zaretskii
26329bed6e ; * etc/symbol-releases.eld (dired-click-to-select-mode): Add. 2025-08-23 16:34:43 +03:00
Eli Zaretskii
90c44826f5 Improve and clarify documentation of 'dired-click-to-select-mode'
* lisp/dired.el (dired-click-to-select-mode)
(dired-post-do-command):
* doc/emacs/dired.texi (Marks vs Flags): Improve documentation of
'dired-click-to-select-mode'.
2025-08-23 16:33:45 +03:00
Jeremy Bryant
5d23fc9467 * doc/lispref/control.texi (cond* Macro): Update bind* entry
Update manual to match docstring of (bind*) clause, including
the qualifier `all subsequent clauses'.  (Bug#79246)
2025-08-23 16:03:46 +03:00
Eli Zaretskii
8e9277042c Use better temporary file names under 'file-precious-flag'
* lisp/files.el (basic-save-buffer-2): Use a more meaningful
temporary file name under 'file-precious-flag'.  (Bug#79252)

* etc/NEWS: Announce the change in behavior.
2025-08-23 15:09:31 +03:00
Eli Zaretskii
45bc42bddf Rmail can fetch email from several inboxes with different passwords
* lisp/mail/rmail.el (rmail--remote-password-host)
(rmail--remote-password-user): New variables.
(rmail-get-remote-password): Use them to ask for the password
whenever we need to fetch email from an inbox whose user or host
are different from the last ones.  (Bug#79214)
2025-08-23 14:55:09 +03:00
Spencer Baugh
aae9eddb58 flymake: stop trying to automatically fall back to margins
The code to automatically fallback to margins is not correct: it
relies implicitly on the buffer being displayed in a window
while flymake-mode is running.  If the buffer is created while
not displayed, we will always automatically fallback to margins,
which is incorrect.
Avoid the regression by simply disabling this code.  I'll try
again to fall back automatically in the future.  (Bug#79244)

* doc/misc/flymake.texi (Customizable variables): Remove section
about automatic fallback to margins.
* etc/NEWS: Un-announce removed feature.
* lisp/progmodes/flymake.el (flymake-indicator-type)
(flymake-mode): Stop automatically falling back to
margins. (bug#77313)
2025-08-23 14:44:35 +03:00
Eli Zaretskii
60a2923d50 ; * lisp/play/doctor.el (llm): Add. 2025-08-23 14:25:06 +03:00
Eli Zaretskii
b3ed4876b6 ; Improve documentation of Edebug
* doc/lispref/edebug.texi (Edebug Execution Modes, Jumping)
(Edebug Misc, Breaks, Breakpoints, Global Break Condition)
(Source Breakpoints, Edebug Views, Edebug Eval, Eval List)
(Printing in Edebug, Trace Buffer, Coverage Testing)
(Checking Whether to Stop, Edebug Display Update)
(Edebug Recursive Edit, Edebug and Macros)
(Instrumenting Macro Calls, Specification List, Edebug Options):
Improve indexing and cross-references.
2025-08-23 13:44:23 +03:00
Michael Albinus
1d88931a1c Minor fixes for file notifications on MS Windows
* lisp/filenotify.el (file-notify-rm-all-watches): Clear hash.

* test/lisp/filenotify-tests.el (file-notify--test-event-test):
Fix check.
(file-notify-test09-watched-file-in-watched-dir): Adapt test.
2025-08-23 12:20:02 +02:00
Eli Zaretskii
f3434a4f53 Fix line-prefix display when there's a 'display' string at BOL
* src/xdisp.c (push_it): Reset the 'string_from_prefix_prop_p' flag.
(try_window_id): Disable this optimization if the last unchanged
at-beg row begins with a display or overlay string and there;s a
line/wrap-prefix property on the row.
(push_prefix_prop): Accept an additional argument FROM_BUFFER to
indicate that the prefix property was found on buffer text
underlying a display or overlay property, and set up the position
to pop to accordingly.  Reset the 'string_from_display_prop_p' flag
of the iterator after pushing IT to set up for iterating the
prefix string.
(get_it_property): Use it->string, not it->object, as indication
that prefix property is on a string.
(get_line_prefix_it_property): Accept an additional argument:
pointer to a flag indicating that the prefix property was found on
buffer text underlying a display or overlay property.  Callers
adjusted.
(handle_line_prefix): Use the FROM_BUFFER flag to correctly handle
prefix properties on buffer text at the same position as a display
string.  (Bug#79275)
2025-08-23 11:34:10 +03:00
Harald Jörg
bc0202bc88 ; cperl-mode.el: Do not warn with valid character escapes
See https://github.com/emacs-mirror/emacs/pull/41.  This is a
one-liner, safely exempt from copyright paperwork.

* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): delete
valid character escapes from the list which causes warning-face
to be applied
2025-08-22 15:03:17 +02:00
Michael Albinus
ce9def14c6 Minor tramp.texi changes
* doc/misc/tramp.texi (File name syntax): Describe port for IPv6 address.
(Traces and Profiles): Fix default value of tramp-debug-buffer-limit.
2025-08-22 14:08:52 +02:00
Michael Albinus
64bb65c7d8 ; * admin/MAINTAINERS: Add myself for connection-local variables. 2025-08-22 14:08:26 +02:00
Michael Albinus
7658f4c30a Skip eglot-test-rust-completion-exit-function on emba 2025-08-22 13:18:08 +02:00
Harald Jörg
384483e263 ; cperl-mode.el: Indent labels only in code (Bug#79271)
* lisp/progmodes/cperl-mode.el (cperl-indent-line): Make sure that
labels are indented in code only

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts: Two
new testcases for non-indentable "labels" in a regex pattern and a
qw list
2025-08-22 12:42:00 +02:00
Eli Zaretskii
6571b632ed ; * admin/MAINTAINERS: Update entries for Dmitry and Spencer. 2025-08-22 09:57:28 +03:00
Harald Jörg
a419e92bc6 ; cperl-mode.el: Fix fontification error with signatures
This fixes the second issue in Bug#79269.

* lisp/progmodes/cperl-mode.el (cperl-init-faces): Move handling
of signatures with initializers from the "anchor" to the
"anchored" matcher

* test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl (sub_7):
Test case for Bug#79269, wrong face report

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-attrs-and-signatures): Make sure that the test
catches sub_7 for Bug#79269
2025-08-22 01:30:59 +02:00
Steven Allen
680ef7b5f0
Fix 'submit-emacs-patch' MIME type
* lisp/mail/emacsbug.el (submit-emacs-patch): Use the correct
MIME type for patches.  Otherwise, `mm-inline-media-tests' won't
recognize and fontify the patch.  (Bug#79287)
2025-08-21 22:02:02 +02:00
Elías Gabriel Pérez
ade6608e25 project: Improve pruning of zombie projects.
* etc/NEWS: Update 'project-prune-zombie-projects' entry.
* lisp/progmodes/project.el (project-prune-zombie-projects):
Change default value (bug#77566).
(project--ensure-read-project-list, project--write-project-list)
(project-prompt-project-dir, project-prompt-project-name):
Rework for use 'project-prune-zombie-projects' value.
(project-forget-zombie-projects): Move code...
(project--delete-zombie-projects): ... to this new function.
2025-08-21 20:22:33 +03:00
Spencer Baugh
3f7c16d858 Add minibuffer--completions-visible and use it
At various places, instead of just checking that there's any
window displaying a buffer named *Completions*, we should
additionally check that that *Completions* buffer is actually
for the current completion session.
minibuffer--completions-visible does that.

* lisp/comint.el (comint-complete-input-ring)
(comint-dynamic-list-completions): Call
minibuffer--completions-visible.
* lisp/minibuffer.el (minibuffer--completions-visible):
Add. (bug#77253)
(completion--do-completion, completions--post-command-update)
(completions--after-change, minibuffer-hide-completions)
(minibuffer-visible-completions)
(minibuffer-visible-completions--always-bind)
(minibuffer-visible-completions--filter)
(with-minibuffer-completions-window, minibuffer-complete-history)
(minibuffer-complete-defaults): Call
minibuffer--completions-visible.
* lisp/pcomplete.el (pcomplete-show-completions): Call
minibuffer--completions-visible.
* lisp/simple.el (switch-to-completions): Call
minibuffer--completions-visible.
* test/lisp/minibuffer-tests.el (completion-auto-help-test)
(completion-auto-select-test): Call
minibuffer--completions-visible.
2025-08-21 20:10:08 +03:00
Steven Allen
f0b987c32c rust-ts-mode: handle invalid rust syntax without signaling
Don't signal an error when encountering invalid rust syntax.  Without
this patch, invalid rust code would prevent a chunk of the buffer from
being highlighted (bug#79272).

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--fontify-scope):
(rust-ts-mode--fontify-pattern): Avoid calling `string-match-p' on nil
when a node is missing a parent.
* test/lisp/progmodes/rust-ts-mode-resources/font-lock-no-parent.rs:
Rust file that reproduces the issue.
* test/lisp/progmodes/rust-ts-mode-tests.el: Test case to reproduce the
issue.
2025-08-21 19:59:04 +03:00
Rahguzar
1a549762ed Correctly document the format of tabulated-list-groups
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups):
Correct format in doc string (bug#79220).

* doc/lispref/modes.texi (Tabulated List Mode):
Correct format in manual.
2025-08-21 19:44:48 +03:00
Harald Jörg
fdf5e5dc41 ; cperl-mode.el: fix indentation for multiline signatures
This fixes the first (and more important) part of Bug#79269.

* lisp/progmodes/cperl-mode.el (cperl-get-state): Replace
`beginning-of-defun' by `beginning-of-defun-raw'.  Also fix a typo
in the docstring.

* test/lisp/progmodes/cperl-mode-tests.el (test-indentation): Skip
tests unless in cperl-mode.  The test file cperl-indents.erts
explicitly invokes cperl-mode.  Due to different indentation
defaults the tests do not pass in perl-mode.

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts: Add
test cperl-subroutine-signatures for Bug#79269
2025-08-21 17:52:30 +02:00
Mattias Engdegård
c04553f655 Speed up JSON parsing by not maintaining line and column (bug#79192)
We use the current parsing position instead.  The line and column in the
error weren't used (nor very accurate to begin with) and the user can
easily compute them when needed.  The line number calculation is kept
just in case but deprecated, for removal in Emacs 32.

* src/json.c (struct json_parser, json_parser_init): Update parser state.
(json_signal_error): New position computation.
(json_skip_whitespace_internal): Remove.
(is_json_whitespace): New.
(json_skip_whitespace, json_skip_whitespace_if_possible)
(json_parse_unicode, json_parse_string, json_parse_number)
(json_parse_value): Simplify and rewrite for efficiency.
(count_chars, count_newlines)
(string_byte_to_pos, string_byte_to_line)
(buffer_byte_to_pos, buffer_byte_to_line): New.
(Fjson_parse_string, Fjson_parse_buffer): Adapt to new parser state.
* test/src/json-tests.el (json-tests--parse-string-error-pos)
(json-tests--parse-buffer-error-pos, json-parse-error-position): New.
* etc/NEWS: Note deprecation of line and column.
2025-08-21 16:42:45 +02:00
Mattias Engdegård
3b80b706e5 Free tar-mode helper buffers after use in package.el (bug#79280)
The auxiliary buffer used by tar-mode is normally destroyed when the
parent buffer is, but package.el uses tar-mode in temporary buffers
which inhibit kill-buffer-hook and this made package installation leave
orphaned buffers behind.

* lisp/emacs-lisp/package.el (package-untar-buffer)
(package-install-file): Switch away from tar-mode before the buffer is
killed, triggering a tar-data buffer purge.
2025-08-21 15:11:13 +02:00
Mattias Engdegård
14c2e5f1be Eliminate some gratuitous string mutation
* lisp/play/zone.el (zone-replace-char):
* lisp/international/quail.el (quail-get-translations):
* lisp/hippie-exp.el (he-capitalize-first): Clarify the code by removing
mutation that is probably not resizing but just in case.
2025-08-21 15:11:13 +02:00