summaryrefslogtreecommitdiff
path: root/src/window.c
AgeCommit message (Collapse)Author
2026-05-22Save/restore old_buffer slot via window configurations (Bug#81097)Martin Rudalics
With Emacs 31 the old_buffer slot of a window gets overwritten with the buffer unshown in that window when that window is deleted. Fset_window_configuration triggers that when calling delete_all_child_windows. If a window configuration gets saved and restored in one and the same redisplay cycle, the change time stamps of the window and its frame will be equal and 'window-buffer-change-functions' may wrongly decide that the window's buffer has not changed because its buffer and old_buffer slots refer to the same buffer (Bug#81097). Fix that by saving and restoring the old_buffer slot. * src/window.c (struct saved_window): Add 'old_buffer' slot. (Fset_window_configuration): Restore old_buffer slot. (save_window_save): Save old_buffer slot.
2026-03-19; Fix documentation of window-dimension functionsEli Zaretskii
* doc/lispref/windows.texi (Window Sizes): * src/window.c (Fwindow_body_height, Fwindow_total_height) (Fwindow_total_width, Fwindow_body_width): Clarify that window dimensions are returned in canonical columns and lines. (Bug#80620)
2026-02-26; Fix doc-string of 'window-combination-resize'Martin Rudalics
* src/window.c (syms_of_window): Fix doc-string of 'window-combination-resize'.
2026-01-24Support cons cell for 'line-spacing'Daniel Mendler
* etc/NEWS: Announce the change. * src/dispextern.h (struct glyph_row): Add 'extra_line_spacing_above' member. (struct it): Add 'extra_line_spacing_above' member. * src/frame.h (struct frame): Add 'extra_line_spacing_above' member. Update comment for 'extra_line_spacing.' * src/buffer.c (syms_of_buffer): Update the docstring of 'line-spacing' to describe the cons cell usage. * src/buffer.h (struct buffer): Update comment for 'extra_line_spacing'. * src/frame.c (gui_set_line_spacing): Handle cons cell value for 'line-spacing'. Calculate and set 'extra_line_spacing_above' for both integer and float pairs. * src/xdisp.c (init_iterator): Initialize 'extra_line_spacing_above' from buffer or frame 'line-spacing', handling cons cells for both integer and float values. (gui_produce_glyphs): Use 'extra_line_spacing_above' to distribute spacing between ascent and descent. Update 'max_extra_line_spacing' calculation. (resize_mini_window): Take line spacing into account when resizing the mini window. Pass height of a single line to 'grow_mini_window' and 'shrink_mini_window'. * src/window.c (grow_mini_window, shrink_mini_window): Add unit argument which defines height of a single line. * src/window.h (grow_mini_window, shrink_mini_window): Adjust function prototypes accordingly with unit argument. * lisp/subr.el (total-line-spacing): New function to calculate total spacing from a number or cons cell. (posn-col-row): Use total-line-spacing. * lisp/simple.el (default-line-height): Use 'total-line-spacing'. * lisp/textmodes/picture.el (picture-mouse-set-point): Use 'total-line-spacing'. * lisp/window.el (window-default-line-height): Use 'total-line-spacing'. (window--resize-mini-window): Take 'line-spacing' into account. * test/lisp/subr-tests.el (total-line-spacing): New test. * test/src/buffer-tests.el (test-line-spacing): New test. * doc/emacs/display.texi (Display Custom): Document that 'line-spacing' can be a cons cell. (Line Height): Document the new cons cell format for 'line-spacing' to allow vertical centering. Co-authored-by: Przemysław Alexander Kamiński <alexander@kaminski.se> Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
2026-01-19; * src/window.c (Fwindow_cursor_info): Fix commentary of last change.Eli Zaretskii
2026-01-19Fix box cursor width returned for stretch glyphRadioNoiseE
* src/window.c (Fwindow_cursor_info): Return canonical character width when on stretch glyph and `x-stretch-cursor' is nil. (Bug#80211)
2026-01-03; * src/window.c (Fwindow_cursor_info): More cleanup.Eli Zaretskii
2026-01-03Unbreak a build --without-xEli Zaretskii
* src/window.c (Fwindow_cursor_info): Provide values for TTY frames. (Bug#80023)
2026-01-03; * src/window.c (Fwindow_cursor_info): Doc fix.Eli Zaretskii
2026-01-03New function 'window-cursor-info'RadioNoiseE
* src/window.c (Fwindow_cursor_info): New function. (syms_of_window): Defsubr it. * doc/lispref/windows.texi (Window Point): Document it. * etc/NEWS: Announce new function. (Bug#80023)
2026-01-01; Add 2026 to copyright years.Sean Whitton
2025-12-26December 2025 spelling fixesPaul Eggert
Some of the fixes are to continue to use American rather than British spelling. * doc/misc/modus-themes.org (my-modus-themes-engraved-faces): Fix misspelled ‘:foreground’s. * etc/themes/modus-themes.el (modus-themes-faces): Fix misspelled ‘modus-themes-bold’. * lisp/emacs-lisp/rx.el (rx--normalize-char-pattern): Rename from rx--normalise-char-pattern. (rx--optimize-or-args): Rename from rx--optimise-or-args. * lisp/frame.el (frame--special-parameters): Fix misspelled "right-divider-width". * lisp/net/tramp.el (tramp-fingerprint-prompt-regexp): Use American spelling “centered”, to match current libfprintf. * lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers): Rename from org-fold-core--optimise-for-huge-buffers. (org-fold-core-update-optimization): Rename from org-fold-core-update-optimisation, leaving an alias behind. (org-fold-core-remove-optimization): Rename from org-fold-core-remove-optimisation, leaving an alias behind. * lisp/org/org.el (org-advertized-archive-subtree): This alias is now obsolete. * lisp/play/zone.el (zone-ignored-buffers): Fix misspelling of ‘zone--buffer-encrypted-p’. * lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces): Fix misspelling of ‘csharp’ group. * lisp/vc/vc.el (vc-clonable-backends-custom-type): Rename from vc-cloneable-backends-custom-type, leaving an alias behind. * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--warn-arity-non-compiled-callee): Rename from bytecomp-tests--warn-arity-noncompiled-callee. (bytecomp-test-defface-spec): Reword a deliberate misspelling of “default” that is so common I don’t want it to pollute the spelling dictionary. * test/lisp/emacs-lisp/package-vc-tests.el: (package-vc-tests-preserve-artifacts): Rename from package-vc-tests-preserve-artifacts. * test/lisp/eshell/em-prompt-tests.el: (em-prompt-test/forward-backward-paragraph-1): Reword a deliberate misspelling of “goodbye” that is so common I don’t want it to pollute the spelling dictionary.
2025-11-22Fix thinko in 'window_set_parent_and_normal_sizes'Martin Rudalics
* src/window.c (window_set_parent_and_normal_sizes): When assigning normal sizes in a combination, take the direction from its parent's 'horizontal' slot and not from that of the first window in the combination.
2025-10-31Fix a bug in Fcombine_windowsMartin Rudalics
* src/window.c (window_set_parent_and_normal_sizes): New function. (Fcombine_windows): Improve doc-string. Use wset_... functions. Call window_set_parent_and_normal_sizes to fix a bug where it failed to assign new normal sizes. (Funcombine_window): Call window_set_parent_and_normal_sizes.
2025-10-18; Fix documentation of a recent commitEli Zaretskii
* src/window.c (Fcombine_windows, Funcombine_window): Doc fixes. * doc/lispref/windows.texi (Recombining Windows): Fix markup and wording.
2025-10-18Add functions 'combine-windows' and 'uncombine-window'Martin Rudalics
* src/window.c (make_parent_window, Fcombine_windows) (Funcombine_window): New functions. (Fsplit_window_internal): Use make_parent_window. * doc/lispref/windows.texi (Recombining Windows): Describe new functions 'combine-windows' and 'uncombine-window'. (Window Configurations): Explain "window clones". * etc/NEWS: Mention new functions 'combine-windows' and 'uncombine-window'.
2025-10-06Run buffer-local window change functions in their buffers nowMartin Rudalics
The buffer-local-versions of 'window-buffer-change-functions', 'window-size-change-functions', 'window-selection-change-functions' and 'window-state-change-functions' are now run with the respective buffer temporarily current. Also, the local version of 'window-buffer-change-functions' is run for the buffer removed from the window too. * src/window.c (run_window_change_functions_locally) (run_window_change_functions_globally): New functions replacing 'run_window_change_functions_1'. (run_window_change_functions): Run the buffer local versions of these hooks in their respective buffers. Run 'window-buffer-change-functions' for the buffer removed from the window too. (Vwindow_buffer_change_functions, Vwindow_size_change_functions) (Vwindow_selection_change_functions) (Vwindow_state_change_functions): Mention that the buffer-local versions are run with their buffer temporarily current. * doc/lispref/windows.texi (Window Hooks): Mention that buffer-local-versions of window change functions are run with their buffer temporarily current. Also say that 'window-buffer-change-functions' will be run for removed buffer too. * etc/NEWS: Advertise changes for the buffer-local versions of window change functions.
2025-03-17Implement dragging and resizing of tty child framesMartin Rudalics
* lisp/faces.el (face-spec-recalc): Don't set scroll-bar-foreground and scroll-bar-background parameters on ttys. * lisp/mouse.el (mouse-drag-frame-resize) (mouse-drag-frame-move): On ttys call 'mouse-position-in-root-frame' to get position of child frame to resize or drag. * lisp/xt-mouse.el (xterm-mouse-event): Handle events on child frame decorations as if they happened on the internal border to find out whether a user wants to drag or resize a child frame. * src/frame.c (frame_internal_border_part): Define for ttys too. (Fmouse_position_in_root_frame): New function. * src/frame.h (internal_border_part): Define for ttys too. * src/keyboard.c (internal_border_parts): Define for ttys too. (frame_border_side): New enum. (make_lispy_position): Handle events on tty child frames. (Fposn_at_x_y): Accept -1 for Y so we can handle a position on the top decoration of a tty child frame. * src/term.c (tty_frame_at): Handle case where X and Y denote a position on a tty child frame's decoration. * src/window.c (Fwindow_at): Handle case where X and Y denote a position on the decoration of a tty child frame which we pretend as belonging to that child frame (and not to its root).
2025-01-26Protect against GCing of last_mouse_windowPaul Eggert
* src/window.c (last_mouse_window): New global var. All static instances removed, and all their uses replaced with this global var. This fixes a very unlikely bug where last_mouse_window was GC’ed and a new window created in its place. It also fixes several places that assumed NIL_IS_ZERO without static_asserting it. (init_window_once): Initialize the new var.
2025-01-19Replace call[1-8] with callnStefan Kangas
Since the introduction of the 'calln' macro, the 'call1', 'call2', ..., 'call8' macros are just aliases for the former. This is slightly misleading and potentially unhelpful. The number of arguments N can also easily go out-of-synch with the used alias callN. There is no reason not to replace these aliases with using 'calln' directly. To reduce the risk for mistakes, the tool Coccinelle was used to make these changes. See <https://coccinelle.gitlabpages.inria.fr/website/>. * src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c: * src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c: * src/chartab.c, src/cmds.c, src/coding.c, src/composite.c: * src/data.c, src/dbusbind.c, src/dired.c, src/doc.c: * src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c: * src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c: * src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c: * src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c: * src/pgtkselect.c, src/print.c, src/process.c, src/sort.c: * src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c: * src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c: * src/xmenu.c, src/xselect.c, src/xterm.c: Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
2025-01-19Prefer 'list (...)' to 'listn (N, ...)'Stefan Kangas
* src/androidfns.c (Fandroid_query_battery): * src/buffer.c (make_lispy_itree_node): * src/keyboard.c (init_while_no_input_ignore_events): * src/window.c (Fset_window_configuration): * src/xterm.c (x_dnd_send_unsupported_drop): Prefer 'list (...)' to 'listn (N, ...)'. * admin/coccinelle/listn.cocci: New file.
2025-01-14Handle removal of selected tty child frameMartin Rudalics
* src/dispextern.h (root_frame): * src/frame.h (root_frame): Move declaration from dispextern.h to frame.h. (SET_FRAME_VISIBLE): Whend making the selected tty child frame invisible, use mru_rooted_frame to find a frame to switch to. * src/dispnew.c (root_frame): Move root_frame to frame.c. * src/frame.c (do_switch_frame): On ttys don't change the top frame when switching from a child frame to another frame with the same root. (root_frame): Move here from dispnew.c. (Fframe_root_frame): New Lisp function. (delete_frame): Whend deleting the selected tty child frame use, mru_rooted_frame to find a frame to switch to. * src/window.c (mru_rooted_frame): New function. * src/window.h (mru_rooted_frame): Declare it. * doc/lispref/frames.texi (Child Frames): Describe new function 'frame-root-frame'.
2025-01-10Have 'split-window' optionally resurrect deleted windowsMartin Rudalics
* src/window.c (Fwindow_old_buffer): Handle deleted window as argument. (make_parent_window): Remove function. (Fsplit_window_internal): New argument REFER for resurrecting deleted windows. Incorporate functionality of defunct make_parent_window. (Fdelete_window_internal, delete_all_child_windows): Store any deleted window's buffer in the window's old_buffer slot. (window_dead_windows_table): Make it a 'value' type hash table so the sequence number cannot affect its weakness. * lisp/window.el (split-window): New argument REFER. * doc/lispref/windows.texi (Resurrecting Windows): New section. (Splitting Windows): Explain new argument REFER. (Window Hooks): Rewrite description of 'window-old-buffer'. * etc/NEWS: Mention new REFER argument for 'split-window'.
2025-01-03Automatically redraw frames for filtered facesDaniel Colascione
Automatically redraw frames when we detect that a window parameter used in a face filter is changed. (Bug#75291) * src/window.c (Fset_window_parameter): redraw window, actually whole frame in this implementation, on face-relevant parameter change (syms_of_window): add window_auto_redraw_on_parameter_change * src/xfaces.c (evaluate_face_filter): record properties
2025-01-01Update copyright year to 2025Paul Eggert
Run "TZ=UTC0 admin/update-copyright".
2024-10-24Merge from origin/emacs-30Sean Whitton
f5451b6a066 ; Improve comment from last change 09e05f7ee4d Document and-let* vs. when-let* usage convention b7a375f5c49 Fix error when splicing Eshell globs and a glob expands t... 2289e162268 * etc/package-keyring.gpg: Update expiration and add new key 48024096fea Avoid crashes when scrolling images under winner-mode c35d6ba9f07 ; * doc/lispref/display.texi (Fontsets): Clarify wording. 88a1a32fc57 ; * doc/lispref/display.texi (Fontsets): Fix typo. 6be47058cd7 ; Add indexing for 'use-default-font-for-symbols' 681f70ea04a * src/lread.c (READ_AND_BUFFER): Reject negative chars (b... ac4151e0023 * test/Makefile.in: Do not show emacs-module-tests.log by... 4e0cb960dbd Fix 'php-ts-mode': better indentation and font locking
2024-10-21Avoid crashes when scrolling images under winner-modeEli Zaretskii
* src/window.c (window_scroll_pixel_based): Fix calculation of a window's vscroll. (Bug#73933)
2024-09-11For minibuffer windows record minibuffers only (Bug#72487)Martin Rudalics
* 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-08-24Merge from origin/emacs-30Eli Zaretskii
4211d85eec0 Fix rare segfaults due to freed fontsets 44c26140b6e ; Fix infloop in checkdoc-next-docstring 25f53721668 Avoid putting a dead buffer in the minibuffer window (Bug...
2024-08-23Avoid putting a dead buffer in the minibuffer window (Bug#72487)Martin Rudalics
* src/minibuf.c (minibuffer_unwind): Make sure that the buffer referenced by the first element of the list of previous buffers of the minibuffer window is live before assigning it to the minibuffer window (Bug#72487). * src/window.c (set_window_buffer): Assert that BUFFER is live.
2024-08-01Improve window/buffer handling codeMartin Rudalics
The purpose of these changes is to improve the code handling the display of buffers in windows, switching to previous and next buffers in windows and restoring a previous state after quitting or killing buffers. In particular it does: - Add a new window parameter 'quit-restore-prev' so a window can keep its initial 'quit-restore' parameter and undoing a sequence of quit window operations becomes more reliable (Bug#59862). - Optionally have 'kill-buffer' call 'quit-restore-window' for all windows showing the argument buffer (Bug#59862). - Add a new hook so it's possible to avoid that a window gets deleted implicitly by functions like 'kill-buffer' (Bug#71386). - Add a new option to make 'quit-restore-window' delete windows more aggressively (Bug#59862). - Immediately remove killed buffers from all windows' previous and next buffers. For windows that are already dead, use a weak hash table to be used by 'kill-buffer'. This avoids any special handling of such windows by the garbage collector. - Immediately remove 'quit-restore' and 'quit-restore-prev' window parameters that reference killed buffers. These parameters have no more use once their buffers got killed. - Make sure that internal windows do not have any previous and next buffers. This fixes a silly memory leak. - Make sure that after set_window_buffer and some wset_buffer calls the buffer now shown in the window does not appear in the lists of that window's previous and next buffers. The old behavior could make functions investigating these lists erroneously believe that there still existed some other buffer to switch to. * src/alloc.c (mark_discard_killed_buffers): Remove function. (mark_window): No more filter previous and next buffer lists. * src/window.h (struct window): Move up prev_buffers and next-buffers in structure; they are now treated by the collector as usual. * src/window.c (window_discard_buffer_from_alist) (window_discard_buffer_from_list) (window_discard_buffer_from_window) (window_discard_buffer_from_dead_windows) (Fwindow_discard_buffer): New functions. (set_window_buffer): Discard BUFFER from WINDOW's previous and next buffers. (make_parent_window): Make sure internal windows have no previous and next buffers. (make_window): Don't initialize window's previous and next buffers, they are handled by allocate_window now. (Fdelete_window_internal): Add WINDOW to window_dead_windows_table. (Fset_window_configuration): Remove resurrected window from window_dead_windows_table. Make sure buffers set by wset_buffer calls are not recorded in window's previous and next buffers. (delete_all_child_windows): Add deleted windows to window_dead_windows_table. (window_dead_windows_table): New weak hash table to record dead windows that are stored in saved window configurations. * src/buffer.c (Fkill_buffer): Call new function 'window_discard_buffer_from_dead_windows'. * lisp/window.el (window-deletable-functions): New hook. (window-deletable-p): Update doc-string. Run 'window-deletable-functions' (Bug#71386). (unrecord-window-buffer): New argument ALL. Move body to 'window-discard-buffer-from-window' so that if ALL is non-nil, WINDOW's 'quit-restore' and 'quit-restore-prev' parameters get removed too. (switch-to-prev-buffer): Don't care about killed buffers here; 'replace-buffer-in-windows' should have done that already. Use 'unrecord-window-buffer'. (switch-to-next-buffer): Don't care about killed buffers here; 'replace-buffer-in-windows' should do that now. (kill-buffer-quit-windows): New option. (delete-windows-on): Update doc-string. Handle new option 'kill-buffer-quit-windows'. Update 'unrecord-window-buffer' calls. (replace-buffer-in-windows): Update doc-string. Handle new option 'kill-buffer-quit-windows' (Bug#59862). Update call to 'unrecord-window-buffer'. (quit-restore-window-no-switch): New option. (quit-restore-window): Update doc-string. Handle additional values of BURY-OR-KILL so to not kill a buffer about to be killed by the caller. Handle 'quit-restore-prev' parameter (Bug#59862). Handle new option 'quit-restore-window-no-switch' (Bug#59862). (quit-windows-on): Update doc-string. Call 'quit-window-hook' and call 'quit-restore-window' directly so that the buffer does not get buried or killed by the latter. Update 'unrecord-window-buffer' call. (display-buffer-record-window): Update doc-string. Handle new `quit-restore-prev' parameter (Bug#59862). (switch-to-buffer): Call 'display-buffer-record-window' so a latter 'quit-restore-window' can use its parameters. * doc/lispref/windows.texi (Deleting Windows): Describe implicit deletion of windows and new hook 'window-deletable-functions'. (Buffers and Windows): Update description of 'replace-buffer-in-windows'. Describe new option 'kill-buffer-quit-windows'. (Quitting Windows): Describe 'quit-restore-prev' parameter and new option 'quit-restore-window-no-switch'. Update description of 'quit-restore-window'. (Window Parameters): Mention 'quit-restore-prev' parameter. * etc/NEWS: Add entries for 'window-deletable-functions', 'kill-buffer-quit-windows', 'quit-restore-window-no-switch'. mention new parameter 'quit-restore-prev' and new argument values for 'quit-restore-window'.
2024-07-16Make error messages adhere to our standardsStefan Kangas
* src/cygw32.c (chdir_to_default_directory): * src/fns.c (secure_hash): * src/keyboard.c (Finternal_handle_focus_in): * src/keymap.c (store_in_keymap): * src/pgtkfns.c (pgtk_set_scroll_bar_foreground) (pgtk_set_scroll_bar_background, Fx_export_frames) (Fpgtk_set_monitor_scale_factor, pgtk_get_defaults_value) (pgtk_set_defaults_value, Fpgtk_print_frames_dialog) (pgtk_get_monitor_scale_factor): * src/pgtkterm.c (pgtk_set_parent_frame): * src/process.c (network_interface_info, send_process): * src/w32.c (w32_read_registry): * src/w32fns.c (Fw32_read_registry): * src/window.c (Frecenter): * src/xfns.c (Fx_export_frames, Fx_print_frames_dialog) (x_set_mouse_color): Make 'error' message strings follow our guidelines. More specifically, they should not end in a period, and normally also be capitalized. See '(elisp) Programming Tips'.
2024-05-18New functions '(set-)window-cursor-type'Eshel Yaron
* src/window.h (struct window): Add 'cursor_type' slot. (wset_cursor_type): New inline function. * src/xdisp.c (get_window_cursor_type): Consult 'cursor_type'. * src/window.c (make_window): Initialize 'cursor_type' to t. (Fset_window_cursor_type, Fwindow_cursor_type): New functions. (syms_of_window): List their symbols. * doc/lispref/windows.texi (Window Point): Document them. * doc/lispref/frames.texi (Cursor Parameters): Mention new 'set-window-cursor-type'. * etc/NEWS: Announce new functions. (Bug#70622)
2024-05-18Merge from origin/emacs-29Eli Zaretskii
a4828155d8f ; * doc/lispintro/emacs-lisp-intro.texi (nthcdr): Whitesp... df1a9e42ba4 Document :box attribute caveats when used on display strings ca17bc8dd0b Improve documentation of 'movemail' d47aa33bcdb Replace incorrect link in Rmail chapter of Emacs manual 35138b90dd2 ; * doc/lispref/parsing.texi (Parsing Program Source): Im... 3dd09516c9a ; Improve documentation of 'set-fontset-font' 042b58b5ff4 ; * doc/emacs/search.texi (Word Search): Add index entry. 60b1768dc50 ; * src/window.c (Fwindow_scroll_bars): Doc fix.
2024-05-13; * src/window.c (Fwindow_scroll_bars): Doc fix.Eli Zaretskii
2024-04-27Fix ommissions in window scrolling commands that ought to clear vscrollPo Lu
* src/window.c (Fdelete_other_windows_internal) (window_scroll_for_long_lines, Frecenter, Fmove_to_window_line): Reset window vscroll, or, if force_start be set, just preserve_vscroll_p, after moving window start to a position computed from iterators for the window in question, so that vscroll may be reliably reset again after the conditions for redisplay's doing the same were corrected. (bug#70386)
2024-04-15Fix resetting the frame's 'frozen_window_starts' flagEli Zaretskii
* src/window.c (grow_mini_window, shrink_mini_window): Reimplement how the frame's 'frozen_window_starts' flag is set and reset, to make sure it is always reset when the mini-window gets to its normal one-line height. Patch by Martin Rudalics <rudalics@gmx.at> (Bug#70038)
2024-04-13; * src/window.c (shrink_mini_window): Revert inadvertent change.Eli Zaretskii
2024-04-13; Fix documentation of last change.Eli Zaretskii
* etc/NEWS: * doc/lispref/display.texi (Other Display Specs): * doc/lispref/text.texi (Special Properties): Fix last changes.
2024-03-30Merge from origin/emacs-29Eli Zaretskii
38faacf353f Improve documentation of <Delete> in user manual 9d3d77f12da Fix documentation of 'other-window-for-scrolling'
2024-03-25Fix documentation of 'other-window-for-scrolling'Eli Zaretskii
* src/window.c (Fother_window_for_scrolling): More accurate documentation of how "the other" window is looked for. Suggested by Karthik Chikmagalur <karthikchikmagalur@gmail.com>.
2024-03-16Document and announce 'marker-last-position'Martin Rudalics
* doc/lispref/markers.texi (Information from Markers): Document 'marker-last-position'. * etc/NEWS: Announce 'marker-last-position'. * src/window.c (window_restore_killed_buffer_windows): Minor doc-string fix. * doc/lispref/windows.texi (Window Configurations): Minor fix.
2024-03-16In window-related documentation write 'symbol' instead of 'constant'Martin Rudalics
Suggested by Michael Heerdegen <michael_heerdegen@web.de>. * src/window.c (window_restore_killed_buffer_windows): In doc-string write 'symbol' instead of 'constant'. * lisp/window.el (display-buffer--lru-window) (display-buffer-use-least-recent-window): In doc-strings write 'symbol' instead of 'constant'. * doc/lispref/windows.texi (Window Configurations): Write 'symbol' instead of 'constant'.
2024-03-15; Fix documentation of a recent change (bug#68235)Eli Zaretskii
* etc/NEWS: * doc/lispref/windows.texi (Window Configurations): Improve wording of 'window-restore-killed-buffer-windows's doc. * src/window.c (syms_of_window) <window-restore-killed-buffer-windows>: Doc fix. * etc/NEWS: * doc/lispref/buffers.texi (Buffer Names): Document 'buffer-last-name'.
2024-03-15Further adjustments for restoring killed buffer windows (Bug#68235)Martin Rudalics
* etc/NEWS: Announce 'window-restore-killed-buffer-windows'. * src/buffer.h (struct buffer) : New field last_name_. * src/buffer.c (Fbuffer_last_name): New function to return last name of buffer before it was killed or renamed. (bset_last_name, Fget_buffer_create, Fmake_indirect_buffer) (Frename_buffer, Fkill_buffer, init_buffer_once): Set buffer's last_name_ field accordingly. * src/window.c (window_restore_killed_buffer_windows): New variable replacing Vwindow_kept_windows_functions. (Fset_window_configuration): Use window_restore_killed_buffer_windows instead of Vwindow_kept_windows_functions. * lisp/window.el (window--state-put-2, window-state-put): Use 'window-restore-killed-buffer-windows' instead of 'window-kept-windows-functions'. * doc/lispref/windows.texi (Window Configurations): Describe 'window-restore-killed-buffer-windows' which replaces 'window-kept-windows-functions'.
2024-03-04Fix 'set-window-configuration' and 'window-state-put'Martin Rudalics
Fix some bugs with 'window-state-put' (Bug#69093). Add new hook 'window-kept-windows-functions' (Bug#68235). * doc/lispref/windows.texi (Window Configurations): Mention 'window-kept-windows-functions'. (Window Hooks): Describe new abnormal hook 'window-kept-windows-functions'. * src/marker.c (Fmarker_last_position): New function to return the last position of a marker even if its buffer is now dead. * src/window.c (Fset_window_configuration): If 'window-kept-windows-functions' is non-nil, do not delete any window whose buffer is now dead but remember all such windows in a list to pass to 'window-kept-windows-functions'. Run 'window-kept-windows-functions' if it is non-nil. (Vwindow_kept_windows_functions): New abnormal hook run by Fset_window_configuration and 'window-state-put' with two arguments - the frame whose configuration is restored and a list of entries for each window whose buffer was found dead during restoration. Each entry is a list of four elements, the window, the dead buffer, and the last know positions of the start and point of that window. * lisp/window.el (window-state-put-kept-windows) (window-state-put-selected-window): New variables. (window--state-put-2): Make sure buffer is live before restoring its state. Set 'window-state-put-selected-window' to state's selected window. If 'window-kept-windows-functions' is non-nil, do not delete any windows whose buffer is found dead but remember all such windows in a list to pass to 'window-kept-windows-functions'. (window-state-put): Run 'window-kept-windows-functions' if it is non-nil. Select window recorded in 'window-state-put-selected-window'.
2024-02-23Fix bug#69140Po Lu
* src/window.c (grow_mini_window): Don't adjust frame matrices or force redisplay if the provided window cannot be resized. (bug#69140)
2024-02-04* src/window.c (set_window_buffer): Flush the `base_line_number` cacheStefan Monnier
2024-01-25Prevent matrices from remaining invalid post mini-window resizePo Lu
* src/androidfns.c (android_create_tip_frame): Enable building with GLYPH_DEBUG. * src/window.c (resize_mini_window_apply): Garbage the frame if F->redisplay is already set to indicate that redisplay_internal should nevertheless return to it.
2024-01-06Merge from origin/emacs-29Eli Zaretskii
bf7034048c1 ; * doc/emacs/custom.texi (Changing a Variable): Update e... 466d1c98a9e Fix icons.el when icon does not exist as a file 2a861124e89 ; Improve documentation of 'buffer-match-p' dc9d02f8a01 * lisp/isearch.el (isearch-search-and-update): Let-bind '... 9308d9a74ab * src/comp.c (Fcomp__compile_ctxt_to_file): Fix hash tabl... a2a6619b282 Provide decent documentation for 'help-quick' ab66b749a27 ; * src/window.c (Fset_window_margins): Doc fix. 1a677d1429d treesit--pre-syntax-ppss: Fix args-out-of-range in intern...