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

97371 commits

Author SHA1 Message Date
Philipp Stephani
2d278a0f2e Use numeric time zone suffix in ERT explainer.
This is more robust since the time zone name is system-dependent.

* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): Use numeric time
zone suffix.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p):
Adapt test.
2025-03-26 03:32:46 +01:00
Stefan Monnier
ce0c1f4442 backtrace.el: Remove redundant put and :group
* lisp/emacs-lisp/backtrace.el: Remove redundant `:group` args.
Prefer # to quote function arguments.
(backtrace-mode): Remove redundant `put`.
2025-03-25 14:16:03 -04:00
Stefan Monnier
bb62e43563 bs.el: Janitorial work; most importantly use special-mode
* lisp/bs.el: Prefer # to quote function arguments.
(bs-mode-font-lock-keywords): Use backquote; quote face names; and use
a list of faces instead of two applications at the same spot.
(bs-sort-buffer-interns-are-last, bs-config--files-and-scratch)
(bs-configurations, bs--intern-show-never): Fix ^$-vs-\`\' confusion.
(bs-mode-map): Remove bindings made redundant by inheritance.
(bs--redisplay): Use `line-number-at-pos`.
(bs--goto-current-buffer): Use `regexp-opt`.
(bs-mode): Inherit from `special-mode`.
(bs--current-buffer, bs--up): Use `point-min`.
(bs--create-header-line): Remove redundant arg.
2025-03-25 14:06:32 -04:00
Stefan Monnier
bc2b815f09 bookmark.el: Cosmetic changes
* lisp/bookmark.el: Prefer # to quote function arguments.
(bookmark-watch-bookmark-file): Remove redundant `:group`.
(bookmark-bmenu-mode): Let `define-derived-mode` take care of
`mode-class` property.
2025-03-25 13:44:15 -04:00
Juri Linkov
050325da30 * lisp/treesit-x.el: New file.
* lisp/treesit.el (treesit--copy-queries): New function.
(treesit--install-language-grammar-1): Use it.

https://lists.gnu.org/archive/html/emacs-devel/2025-03/msg01312.html
2025-03-25 19:41:33 +02:00
Stefan Monnier
e67f03bf35 lisp/gnus/mm-encode.el (mm-default-buffer-type): Obey the mode hierarchy 2025-03-25 11:23:48 -04:00
Michael Albinus
a15534f32e * lisp/gnus/mm-encode.el (mm-default-buffer-type): Check `major-mode'. 2025-03-25 15:13:16 +01:00
Michael Albinus
2adc912d0e Use better attachment defaults for *diff* buffers
* lisp/gnus/mm-encode.el (mm-default-buffer-type): New defun.

* lisp/gnus/mml.el (mml-attach-buffer): Use it.
2025-03-25 11:45:29 +01:00
James Cherti
40bf281c64 outline-move-subtree-down/up: Fix for non-nil outline-blank-line
* lisp/outline.el (outline-move-subtree-down):
Include blank line when outline-blank-line is t
(bug#77238).

Copyright-paperwork-exempt: yes
2025-03-25 09:45:37 +02:00
Stefan Monnier
7ec0ee742d (built-in-class--make): Take list of types rather than classes
Consolidate the conversion from types to classes into
`built-in-class--make` instead of duplicating it in ever caller.

* lisp/emacs-lisp/cl-preloaded.el (built-in-class--make): Take list of
types rather than classes.
(cl--define-built-in-type): Simplify accordingly.
2025-03-25 02:09:48 -04:00
Philipp Stephani
8be7e98557 Add an ERT explainer for 'time-equal-p'.
* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): New explainer
function.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p): New
test.
2025-03-25 00:12:20 +01:00
Stefan Monnier
cf6d0b48d8 lisp/loadup.el (max-lisp-eval-depth): Bump up a bit
This is to accommodate the deep backquoted thingy in `cus-start.el`.
2025-03-24 17:31:35 -04:00
Stefan Monnier
f66c92a793 Expose some lambdas currently hidden in quoted data
* lisp/language/chinese.el ("Chinese-GB", "Chinese-BIG5")
("Chinese-CNS", "Chinese-EUC-TW", "Chinese-GBK"):
* lisp/isearch.el (isearch-menu-bar-map):
* lisp/international/mule-cmds.el (language-info-custom-alist):
* lisp/font-lock.el (cpp-font-lock-keywords):
* lisp/cus-start.el (<toplevel>): Expose lambda-expressions to the compiler.
2025-03-24 17:14:26 -04:00
Stefan Monnier
c26862a6c9 (byte-compile-maybe-guarded): Make its code edebuggable
* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Hoist
subexpression out of `if`.
(byte-compile-variadic-numeric, byte-compile--cond-vars)
(byte-compile--cond-switch-prefix, byte-compile-file-form-defalias):
Obey `lexical-binding` when evaluating the code we're compiling.
(byte-compile--maybe-guarded): New function, extracted from
`byte-compile-maybe-guarded`.
(byte-compile-maybe-guarded): Use it so we can edebug the code.
2025-03-24 17:12:16 -04:00
Stefan Monnier
e343055f63 (buffer-local-set-state): Optimize away unused data
* lisp/subr.el (buffer-local-set-state--get): Simplify by making it
take only the vars rather than the pairs.
(buffer-local-set-state): Adjust accordingly so we don't needlessly keep
part of the source code in the compiled code.
2025-03-24 17:08:26 -04:00
Eshel Yaron
119931a9ce
; Populate completions list before scrolling it
This fixes a regression introduced in b12a3a03ae, where
repeating a completion command (e.g. TAB in the minibuffer)
would no longer scroll through all available completions.

* lisp/minibuffer.el (completion--in-region-1): Call
'completion--lazy-insert-strings' before scrolling
the completions list.
2025-03-24 16:32:12 +01:00
Sean Whitton
0cfe700e33 Merge from origin/emacs-30
0c32f7521b ; * admin/notes/spelling: More precisely qualify saying j...
bc51fabc10 Add a choice to 'dired-movement-style' to restore the pre...
10d534023a ; Fix some markup in doc/lispref/commands.texi.
c2c287b325 Improve docstring of should-error
2025-03-24 10:41:45 +08:00
Sean Whitton
3b38aa2cb5 Merge from origin/emacs-30
84abd43f42 * lisp/treesit.el (treesit-indent-region): Handle markers...
2025-03-24 10:41:43 +08:00
Sean Whitton
0503766495 log-edit: Don't add rear-nonsticky to font-lock-extra-managed-props
* lisp/vc/log-edit.el (log-edit-mode): Don't add rear-nonsticky
to font-lock-extra-managed-props (bug#77197).  Investigated by
Paul D. Nelson <ultrano@gmail.com>.  Fix due to Stefan Monnier.
2025-03-24 10:32:40 +08:00
Stefan Kangas
1b56e0f169 Improve docstring of cl-defstruct accessors
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Improve generated
docstring by not leaking the internal CL-X argument name, preferring X
instead.  Set property 'document-generalized-variable', used below.
* lisp/help-fns.el (help-fns--generalized-variable): When function has
non-nil property 'document-generalized-variable', document it as a
generalized variable.
2025-03-24 00:57:47 +01:00
Juri Linkov
bc51fabc10 Add a choice to 'dired-movement-style' to restore the previous behavior
* lisp/dired.el (dired-movement-style): Add new values
'bounded-files' and 'cycle-files' (bug#76596).
(dired--move-to-next-line): Use new values for users
who prefer the default behavior of Emacs 30.1.
2025-03-23 19:48:28 +02:00
Stefan Kangas
c2c287b325 Improve docstring of should-error
* lisp/emacs-lisp/ert.el (should-error): Improve docstring.
2025-03-23 17:46:07 +01:00
Andrea Corallo
d565a6747a Fix a nativecomp type propagation bug (bug#74771)
* lisp/emacs-lisp/comp.el (comp--add-cond-cstrs): Don't emit negated
cstr.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
2025-03-23 17:33:27 +01:00
Stefan Kangas
408ad273ee checkdoc: Delete redundant check for wide docstrings
With Emacs 28.1, wide docstrings are now flagged by the byte-compiler.
The logic in the byte-compiler for catching these issues is complex
and continuously evolving, particularly to avoid incorrectly flagging
`substitute-command-keys` substitutions.  Unfortunately, the checkdoc
implementation incorrectly flags correct docstrings as overly wide.

Rather than duplicating the byte-compiler logic in checkdoc, which
would introduce unnecessary maintenance overhead, we acknowledge that
this check is now redundant and remove it.  Users utilizing the
byte-compiler, whether manually or through `flymake`, will continue to
be warned about this issue.

* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Remove check for overly wide docstrings; duplicates byte-compiler
logic.
2025-03-23 17:22:51 +01:00
shipmints
81c21d89ed Ensure .dir-locals-2.el behavior as documented (bug#75890)
* lisp/files.el
(dir-locals--all-files): New &optional 'base-el-only' argument.
(dir-locals--base-file): New function.
(dir-locals-find-file): 'locate-dominating-file' only for the base
.dir-locals.el.

* test/lisp/files-tests.el
(files-test-dir-locals-2-solo): New test.
* test/lisp/files-resources/dir-locals-2-solo: New test support.
(files-test-dir-locals-2-paired): New test.
* test/lisp/files-resources/dir-locals-and-2: New test support.
2025-03-22 16:47:27 -04:00
Sora Takai
893c40c63e Make isearch lazy-highlights non-sticky at both ends (bug#77121)
Copyright-paperwork-exempt: yes
2025-03-22 21:16:46 +02:00
Juri Linkov
84abd43f42 * lisp/treesit.el (treesit-indent-region): Handle markers (bug#77077).
Ensure that markers are converted to integers for 'beg' and 'end'.
2025-03-22 20:37:35 +02:00
Michael Albinus
2658f4eab9 ; Another Tramp fix
* lisp/net/tramp.el (tramp-skeleton-file-truename):
Remove possible trailing slash.
2025-03-22 17:49:53 +01:00
Sean Whitton
764f23ef43 Merge from origin/emacs-30
1364bbc6a5 ; * admin/notes/spelling: Grammar fix
dc80a8f050 ; Add index entry "code completion" to user manual
0d9b14ed05 ; * doc/emacs/programs.texi (Program Modes): Add info abo...
f224475f57 ; admin/notes/spelling: Notes on abbreviation of "Emacs L...
86c354dd0d Fix OSX build without pdumper
2d12754ee2 ; Add indexing for Eglot in user manual
a30b9b640b ; Change some instances of cl to cl-lib in docs
b681d62436 ; Improve introduction to use-package manual
f1acefd86f ; Add cross-references to push and pop docstrings
2025-03-22 21:09:37 +08:00
Eli Zaretskii
42e116bb10 ; Fix last change (bug#76980)
* lisp/window.el (window--state-normalize-buffer-name): Doc fix.

* doc/lispref/windows.texi (Window Configurations): Add indexing.
2025-03-22 14:14:22 +02:00
shipmints
4266514dc8 'window-state-normalize-buffer-name' option for `uniquify' buffers
If 'window-state-normalize-buffer-name' is non-nil, 'window-state-get'
will normalize stored buffer names, making them easier to restore for
users that use 'uniquify' buffer naming.
* doc/lispref/windows.texi (Window Configurations): Document
'window-state-normalize-buffer-name'.
* lisp/window.el (window-state-normalize-buffer-name): New defvar.
(window--state-normalize-buffer-name): New function.
(window--state-get-1): Call 'window--state-normalize-buffer-name'
rather than 'buffer-name'.
* etc/NEWS: Announce 'window-state-normalize-buffer-name'.
(Bug#76980)
2025-03-22 14:10:37 +02:00
James Cherti
1aebb02611 ElDoc: Add more commands using 'eldoc-add-command-completions'
Add more commands to 'eldoc-add-command-completions' to fix
disappearing ElDoc help in the minibuffer for the following
cases:
- All modes: Added "comment-indent-new-line".
- All modes: Added "delete-char" for handling when the user presses delete.
- Python mode: Added "python-indent-dedent-line-backspace" for handling
  when the user presses backspace.
* lisp/emacs-lisp/eldoc.el (eldoc-remove-command-completions):
* lisp/progmodes/python.el (python-base-mode): Add more commands
to 'eldoc-add-command-completions'.

Copyright-paperwork-exempt: yes
2025-03-22 13:55:09 +02:00
Eli Zaretskii
098fe4b73b Improve 'C-u C-x =' for ligatures of ASCII characters
* lisp/composite.el (composition-find-pos-glyph): New function.
* lisp/descr-text.el (describe-char): Use it to get the font glyph
code of "trivial" compositions.
(describe-char-display): Accept an additional optional argument
and use it as the font glyph code for the character.
2025-03-22 12:39:46 +02:00
Michael Albinus
172e35afce Tramp: Improve handling of cyclic symlinks
* lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
Add FIXME.

* lisp/net/tramp.el (tramp-skeleton-file-exists-p)
(tramp-handle-file-directory-p): Protect against cyclic symlinks.

* test/lisp/net/tramp-tests.el (tramp-test18-file-attributes)
(tramp-test21-file-links): Adapt tests.
2025-03-22 09:52:22 +01:00
john muhl
cf7fdd374a ; Update version comment in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el: Update comment for version
0.3.0 of tree-sitter-lua grammar.  (Bug#77158)
2025-03-22 09:12:01 +02:00
Stefan Kangas
580c050f6d Make 'eieio-version' obsolete
EIEIO used to be developed externally as part of CEDET, but that is no
longer the case.  It now has the same version as Emacs itself.
https://sourceforge.net/p/cedet/git/ci/8aa920380f8178ed2514f06f13c403d80db16752/

* lisp/emacs-lisp/eieio.el: Change "Version" header to "Old-Version".
(eieio-version): Make both the variable and the function obsolete in
favor of 'emacs-version'.
2025-03-22 07:01:14 +01:00
Daniel Colascione
2fcf6b4086 xref: error -> user-error: reduce debug-on-error annoyance
* lisp/progmodes/xref.el (xref--next-error-function): Use user-error
instead of error.
2025-03-21 21:11:07 -04:00
Daniel Colascione
e5ee1d2a74 Adapt ediff to nonstandard layouts
Make ediff cope with having some of its windows (especially the control
window) not shown by a custom ediff-window-setup-function.
Modernize relevant adjacent code. After this change, one can write a
custom ediff-window-setup-function that doesn't show the control window.

* doc/misc/ediff.texi (Notes on Heavy-duty Customization): Refine
language to explain that the window setup function doesn't have to show
all windows.
* lisp/vc/ediff-util.el (ediff-select-control-window-on-setup):
New variable.
(ediff-setup, ediff-recenter, ediff-recenter-one-window)
(ediff-recenter-ancestor, ediff-toggle-read-only)
(ediff-operate-on-windows, ediff-jump-to-difference-at-point)
(ediff-default-suspend-function)
(ediff-clone-buffer-for-region-comparison)
(ediff-clone-buffer-for-window-comparison): Modernize control flow;
select only windows that exist.
* lisp/vc/ediff-wind.el (ediff-with-live-window): New convenience macro.
(ediff-window-setup-function): Explain relaxed contract.
2025-03-21 20:56:12 -04:00
Spencer Baugh
b21636580b minibuffer.el: Fix warnings and coding style in last change
* lisp/minibuffer.el: Cut lines to fit into 80 columns.
(completion--insert-strings): Simplify `if` to `or`.
(completion--insert-horizontal, completion--insert-one-column):
Fix warning about used var starting with `_`.  Avoid `apply-partially`.
2025-03-21 17:24:50 -04:00
Spencer Baugh
b12a3a03ae Lazily highlight and insert candidates in *Completions*
From profiling, the main bottleneck in completion over large
completion sets is display-completion-list, when there are many
available candidates.  For example, in my large monorepo, when
completing over the 589196 files or the 73897 branches, even
with the candidates narrowed down by typing some prefix to
complete, TAB (when it shows *Completions*) or ? is slow, mostly
in display-completion-list.

However, rendering all the completion candidates is unnecessary if
the *Completions* window is never scrolled to see those candiates.  By
eagerly inserting only some candidates and lazily highlighting and
inserting the remaining candidates only when necessary, performance is
much improved.

* lisp/minibuffer.el (completion--insert-strings): Insert
completions lazily. (bug#74561)
(completions--lazy-insert-button): Add.
(completion--insert-horizontal, completion--insert-one-column):
Throw a continuation when enough lines of completions are
inserted.
(completion--insert-vertical): Add ignored lines argument.
(minibuffer-completion-help): Set completion-lazy-hilit.
(with-minibuffer-completions-window): Call
completion--lazy-insert-strings.
(with-minibuffer-completions-window):
* lisp/simple.el (completion-setup-function): Preserve
buffer-locals required for lazy completion insertion.
(switch-to-completions): Call completion--lazy-insert-strings.
* etc/NEWS: Announce.
2025-03-21 17:06:19 -04:00
Eli Zaretskii
bbad5be9f0 Leave buffer with input-method help unmodified
* lisp/international/quail.el (quail-help): Leave "*Help*"
unmodified.  (Bug#77139)
2025-03-20 22:33:32 +02:00
Stefan Kangas
40a17ce3b2 Make compilation-filter-hook into a defcustom
* lisp/progmodes/compile.el (compilation-filter-hook): Make variable
into a defcustom.
2025-03-20 19:21:08 +01:00
Stefan Kangas
f0800612e5 ; Fix global-hl-line-highlight after recent commit 2025-03-20 19:05:29 +01:00
Elías Gabriel Pérez
77ad6518bb Allow specifying in which major modes to enable 'global-hl-line-mode'
* lisp/hl-line.el (global-hl-line-modes): New user option.
(global-hl-line-highlight): Obey the new variable.  (Bug#77022)

* etc/NEWS: Document new variable.
2025-03-20 15:01:30 +02:00
David Ponce
b1db48c0fc Fix `string-pixel-width' with alternate text properties
Fix possible wrong result of `string-pixel-width' with alternate
and default properties.  Create new regression tests.
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Like for
`face-remapping-alist', use in work buffer the value of
`char-property-alias-alist' and `default-text-properties'
local to the passed buffer, to correctly compute pixel width.
(Bug#77042)

* test/lisp/misc-tests.el: Add tests for `string-pixel-width'.
2025-03-20 14:55:23 +02:00
Vincenzo Pupillo
cace07f27d MariaDB and Mysql handle escaped aphostrophes in the same way
* lisp/progmodes/sql.el (sql-mode): MariaDB and Mysql both
handle escaped apostrophes in the same way.  (Bug#77088)
2025-03-20 14:47:18 +02:00
Eli Zaretskii
e53b90a5ce Improve 'gui-get-selection' on MS-Windows
* lisp/term/w32-win.el (w32--get-selection): Allow UTF8_STRING and
TEXT data types as well, since w32select.c handles that correctly.
2025-03-20 11:03:32 +02:00
Stefan Kangas
3488ae7c52 Recenter calendar-chinese-year-cache on 2028
* lisp/calendar/cal-china.el (calendar-chinese-year-cache): Recenter
on 2028.
2025-03-20 02:45:11 +01:00
Stefan Kangas
03053baebe ; Improve documentation of incf and decf
* doc/lispref/variables.texi (Setting Generalized Variables): Mention
incf and decf.
* lisp/emacs-lisp/gv.el (incf, decf): Add references to Info manual
documentation on generalized variables.
2025-03-19 21:29:50 +01:00
Stefan Kangas
f1acefd86f ; Add cross-references to push and pop docstrings
* lisp/subr.el (push, pop): Add cross-references to Info manual.
2025-03-19 21:29:16 +01:00