Eli Zaretskii [Wed, 26 Mar 2025 12:31:41 +0000 (14:31 +0200)]
; Fix OOM kill in ert-tests
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Mark it 'unstable', as it
might run out of memory on GNU/Linux and on Windows.
Martin Rudalics [Wed, 26 Mar 2025 08:04:49 +0000 (09:04 +0100)]
Further amendments of child frame handling and documentation
* src/frame.c (frame_subsumes_p): New static function
(delete_frame): On ttys refuse to delete a frame that could be
used as surrogate minibuffer frame by surviving frames.
(store_frame_param): Make sure 'minibuffer' parameter does not
reference a deleted window. If on a tty it references a live
window, make sure its frame has the same root frame as the frame
where the parameter shall be installed. Also on ttys make sure
that storing the 'parent-frame' parameter does not assign a
surrogate minibuffer frame a different root frame than that of
any of its client frames. Further on ttys assert that making a
child a new root frame gives it the dimensions of the terminal.
(Fmouse_position_in_root_frame): Don't use XFRAME before
it's clear that FRAME is a frame.
* doc/lispref/elisp.texi (Top): Add menu for Child Frames section.
* doc/lispref/frames.texi (Buffer Parameters): Mention that
value 'child-frame' is not special for 'minibuffer' parameter on
text terminals.
(Visibility of Frames): Fix description of 'iconify-frame'.
(Raising and Lowering): 'minibuffer-auto-raise' is an option.
(Child Frames): Major rewrite using subsections. Explain new
and deviant features on text terminals - menu bar access,
reparenting, deleting, visibility and minibuffer-only child
frames.
* etc/NEWS: Remove remark that child frames cannot be
arbitrarily reparented on ttys.
Stefan Monnier [Tue, 25 Mar 2025 18:06:32 +0000 (14:06 -0400)]
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.
Stefan Monnier [Tue, 25 Mar 2025 17:43:53 +0000 (13:43 -0400)]
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.
Philipp Stephani [Tue, 25 Mar 2025 01:56:01 +0000 (02:56 +0100)]
Mimic behavior of 'aref' when signalling out-of-range errors.
The convention used by 'aref' and friends is that for
'args-out-of-range', the error data is a list (SEQ INDEX). Use the same
convention for the vector-related module functions.
* src/emacs-module.c (check_vec_index): Use vector and index as error
data.
Philipp Stephani [Tue, 25 Mar 2025 01:50:37 +0000 (02:50 +0100)]
Don't use 'args-out-of-range' error for too-small buffers.
'args-out-of-range' means that some index argument isn't valid for a
given sequence/range, which isn't the case here. Instead, define a new
error symbol to mean "user-supplied buffer is too small." Since we
never specified nor tested which error symbol was signalled in this
case, changing it shouldn't cause severe breakages.
* src/emacs-module.c (module_buffer_too_small): New helper function.
(module_copy_string_contents, module_extract_big_integer): Use it.
(syms_of_module): Define 'buffer-too-small' error symbol.
Stefan Monnier [Mon, 24 Mar 2025 21:12:16 +0000 (17:12 -0400)]
(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.
Stefan Monnier [Mon, 24 Mar 2025 21:08:26 +0000 (17:08 -0400)]
(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.
Sean Whitton [Mon, 24 Mar 2025 02:29:17 +0000 (10:29 +0800)]
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.
Stefan Kangas [Sun, 23 Mar 2025 23:33:37 +0000 (00:33 +0100)]
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.
Juri Linkov [Sun, 23 Mar 2025 17:48:28 +0000 (19:48 +0200)]
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.
Stephen Gildea [Sun, 23 Mar 2025 17:37:21 +0000 (10:37 -0700)]
; Move time-stamp release info from symbol-releases.eld to NEWS
Update the appropriate historical NEWS files with time-stamp feature
releases. Suggested by Stefan Monnier. All dates are from my notes.
* etc/symbol-releases.eld: Remove time-stamp,
reverting commit 69210eb84e of 17 March.
* etc/NEWS.19:
* etc/NEWS.20: Add 'time-stamp' feature paragraphs that
should have been written then.
* etc/NEWS.21: Add missing quotes, so symbol names can be identified.
Stefan Kangas [Sun, 23 Mar 2025 16:22:51 +0000 (17:22 +0100)]
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.
Stephen Gildea [Sun, 23 Mar 2025 00:07:05 +0000 (17:07 -0700)]
Consistent wording in top-level headers in NEWS.19
* etc/NEWS.19: Put the word "Emacs" in front of each version number.
This change lets 'help-fns--first-release' parse the headers, which
produces more accurate "probably introduced at" versions from
'describe-function' and 'describe-variable'.
Stefan Kangas [Sat, 22 Mar 2025 21:41:53 +0000 (22:41 +0100)]
Reduce code duplication in ns_set_appearance
* src/nsterm.h (ns_set_appearance_1): Declare.
* src/nsterm.m (ns_set_appearance_1): Break out new function...
(ns_set_appearance): ...here.
* src/nsfns.m (Fx_create_frame): Use above new function.
shipmints [Sun, 16 Feb 2025 19:30:45 +0000 (14:30 -0500)]
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.
Paul Eggert [Sat, 22 Mar 2025 18:19:41 +0000 (11:19 -0700)]
Remove ctags program
Remove our old ctags and suggest Universal Ctags instead.
This fixes a FIXME in lib-src/Makefile.in and speeds up compilation
quite a bit on my older CPU when I compile with --enable-gcc-warnings.
It also lessens installation and runtime footprint. (Bug#76322)
* .gitignore: Remove lib-src/ctags.
* admin/authors.el (authors-renamed-files-alist): Remove ctags.1.
* admin/check-man-pages: ctags.1 is no longer a special case.
* admin/quick-install-emacs (PUBLIC_LIBSRC_BINARIES): Remove ctags.
* cross/Makefile.in (LIBSRC_BINARIES): Remove lib-src/ctags.
* doc/man/ctags.1, lib-src/ctags.c: Remove.
* java/Makefile.in (CROSS_LIBSRC_BINS): Remove ctags.
* lib-src/Makefile.in (INSTALLABLES): Remove ctags${EXEEXT}.
(ctags${EXEEXT}): Remove.
* lib-src/etags.c (CTAGS): Remove. All uses replaced by ...
(ctags): ... this new static var.
(STDIN): Remove macro. All uses replaced by new STDIN_OPTION constant.
(CTAGS_OPTION, STDIN_OPTION): New contants.
(longopts): New --ctags option.
(ctags_default_C_help): New constant,
to override default_C_help at runtime.
(default_C_help): Now always the etags version.
(C_LANG_NAMES_INDEX): New macro.
(print_language_names): Do not assume etags.
(PROGRAM_NAME): Remove. All uses removed.
(print_help): Document --ctags if PRINT_UNDOCUMENTED_OPTIONS_HELP.
(main): Support new --ctags option, and support all [ce]tags options.
* test/manual/etags/Makefile (CTAGS_PROG):
Now etags --ctags, since there is no longer a ctags.
shipmints [Wed, 12 Mar 2025 16:14:50 +0000 (12:14 -0400)]
'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)
Eli Zaretskii [Sat, 22 Mar 2025 10:39:46 +0000 (12:39 +0200)]
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.
Martin Rudalics [Sat, 22 Mar 2025 08:34:53 +0000 (09:34 +0100)]
Fix and document frame parameters for text terminals and child frames
* src/frame.c (Fmake_frame_invisible): In doc-string describe
effect on text terminals. Set FRAME correctly when called with
nil value. Make frame invisible before calling mru_rooted_frame
or next_frame.
(Ficonify_frame): Make it work for child frames on text
terminals
(Fmodify_frame_parameters): Make value 'icon' for 'visibility'
work for child frames.
* src/dispnew.c (frame_ancestors_visible_p): New function.
(frames_with_root): If VISIBLE_ONLY is non-nil, return only
frames whose ancestors are all visible to avoid that redisplay
draws visibly orphaned child frames.
* doc/lispref/frames.texi (Frames): Move descriptions of top
frame and 'tty-top-frame' here.
(Frame Layout): Mention that on text terminals the outer border
can be emulated by setting the 'undecorated' frame parameter.
(Frame Position, Frame Parameters, Window Frame Parameters)
(Position Parameters, Size Parameters): Rewrite sections dealing
with the handling of frame parameters in text terminals.
(Layout Parameters): Move description of 'undecorated' parameter
here. Clarify semantics of 'menu-bar-lines' parameter.
(Frame Interaction Parameters): Move description of 'visibility'
parameter here. Mention which parameters are not implemented on
text terminals.
(Mouse Dragging Parameters): Describe how these work on text
terminals.
(Visibility of Frames): Rewrite section.
(Raising and Lowering): Describe for text terminals.
(Child Frames): Fix description of 'iconify-child-frame' option.
Stefan Kangas [Sat, 22 Mar 2025 08:05:08 +0000 (09:05 +0100)]
; Add index entry "code completion" to user manual
* doc/emacs/programs.texi (Symbol Completion): Improve indexing by
adding "code completion". This is the name that this feature goes by
elsewhere, so users are likely to look for it.
Stefan Kangas [Sat, 22 Mar 2025 06:01:14 +0000 (07:01 +0100)]
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'.
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.
Eli Zaretskii [Fri, 21 Mar 2025 16:20:21 +0000 (18:20 +0200)]
Avoid infinite loop with images under 'display-line-numbers-mode'
* src/xdisp.c (move_it_in_display_line_to, display_line): When
considering the first glyph on a glyph row, take into
consideration the glyphs produced for line-number display.
(Bug#77065)
David Ponce [Sun, 16 Mar 2025 10:31:21 +0000 (11:31 +0100)]
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'.
Stefan Monnier [Wed, 19 Mar 2025 19:47:11 +0000 (15:47 -0400)]
indent.erts (Code): Don't modify the global state
* test/lisp/progmodes/java-ts-mode-resources/indent.erts (Code):
Use `setq-local` and correspondingly move the remaining
assignment after activating the major mode.
Use 'view-mode-enter' instead of 'view-buffer' to ignore the 'special'
mode-class that prevents some modes from binding 'q' to 'exit-action'
that should call 'exit-recursive-edit' (bug#76745).