aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add mirroring for special glyphs (bug#80440)Manuel Giraud8 days1-25/+171
| | | | | | | | | | | | | | | | | See initial discussion here: https://lists.gnu.org/archive/html/emacs-devel/2026-02/msg00400.html * lisp/international/characters.el (pairs): Populate special-mirror-table. * src/xdisp.c (produce_special_glyphs): Add two arguments. One to identify the paragraph direction and one to identify that the glyph is produced on the left hand side of a window. Mirror glyph defined in the display table according to the new special-mirror-table. Bidi mirroring always takes precedence. (init_iterator, insert_left_trunc_glyphs, display_line) (display_string): Call 'produce_special_glyphs' with new arguments. (syms_of_xdisp) <special-mirror-table>: New char-table. * etc/NEWS: Announce the change.
* Show a message in locked frames in single-kboard modeSean Whitton11 days1-25/+75
| | | | | | | | | | | | | | | | * src/keyboard.c (kbd_buffer_get_event): Pass the event's frame up to the caller by means of a new 'struct frame **' argument. (read_event_from_main_queue): Show a message in locked frames in single-kboard mode (bug#79892). * src/xdisp.c (log_message): Factor out of message3. (message3): Call it. (message3_nolog): Rename to ... (message3_frame_nolog): ... this. New 'struct frame *' argument which causes temporarily switching to another frame when displaying the message. (message3_frame, message3_nolog): New functions. * src/lisp.h: Declare message3_frame and message3_frame_nolog. * admin/notes/multi-tty: Remove notes on showing a message.
* Fix handling of window-specific overlays in buffer iteration for displayEli Zaretskii2026-02-141-22/+41
| | | | | | | | | | | | | | | | | | | | | * src/xdisp.c (compute_display_string_pos): Pay attention to 'display' properties that come from overlays, in case the overlays are window-specific. Call 'handle_display_prop' with the argument OVERLAY non-nil, if the property is from an overlay. (compute_display_string_end): Accept an additional argument, a pointer to the window; all callers changed. Pay attention to 'display' properties that come from overlays, in case the overlays are window-specific. In particular, if the property comes from an overlay, use that overlay's end position as the next place where the 'display' property changes, effectively disregarding any properties on buffer text that is replaced by this overlay's 'display' property. (handle_single_display_spec): Always use the end position of the overlay which determined the 'display' property as the end of the property, to make sure we obey windows-specific overlays. * src/bidi.c (bidi_fetch_char): Adapt to the above change. * src/dispextern.h: Adjust prototype of 'compute_display_string_end'. (Bug#80255)
* Minor improvements in vertical cusror motionEli Zaretskii2026-02-011-2/+4
| | | | | | | | | | | * src/xdisp.c (move_it_vertically_backward): Zero out cached value of line height, to avoid using stale and incorrect values. (try_window_reusing_current_matrix): Fix conditions for changes in tab-line height. Reported by Michael Heerdegen <michael_heerdegen@mailbox.org> in https://lists.gnu.org/archive/html/help-gnu-emacs/2026-01/msg00163.html This improves the scrolling a little bit, but doesn't solve the problem entirely.
* Support cons cell for 'line-spacing'Daniel Mendler2026-01-241-12/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* Inhibit looping in resize_mini_window (Bug#80017)Martin Rudalics2025-12-301-2/+7
| | | | | | * src/xdisp.c (redisplay_window): Don't call resize_mini_window when the minibuffer is active and minibuffer-only frames shall be resized automatically since that can loop infinitely (Bug#80017).
* December 2025 spelling fixesPaul Eggert2025-12-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix builds without toolkit menu barsPo Lu2025-12-091-1/+1
| | | | | | | | * src/keyboard.c (make_lispy_event): Call x_y_to_column_row when building internal menu bar events. * src/xdisp.c (x_y_to_column_row): Provide DX and DY parameters to x_y_to_column_row.
* Fix some C symbol extern visibilityPaul Eggert2025-12-081-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make some C symbols static if they don’t need to be extern. Also, remove a couple of functions that were discovered to be unused as a result of this process, and mark two extern functions intended to be usable from GDB. * src/buffer.c (previous_overlay_change): * src/composite.c (composition_lisp_table): * src/fileio.c (file_name_directory): * src/frame.c (check_tty): * src/insdel.c (adjust_markers_for_insert): * src/keyboard.c (unread_switch_frame, read_char) (requeued_events_pending_p): * src/sysdep.c (renameat_noreplace) [!HAVE_ANDROID]: * src/textconv.c (get_conversion_field) [!HAVE_ANDROID]: * src/treesit.c (TREESIT_BOB_LINECOL, TREESIT_TS_POINT_1_0) (treesit_buf_tracks_linecol_p, make_treesit_parser) (make_treesit_node): * src/xdisp.c (x_y_to_hpos_vpos): * src/xfaces.c (load_color) [!MSDOS]: * src/xfns.c (x_real_pos_and_offsets): * src/xterm.c (x_dnd_do_unsupported_drop): Now static. Move up if necessary. * src/coding.c (utf8_string_p): * src/keyboard.c (detect_input_pending_ignore_squeezables): Remove; unused. * src/frame.c (gui_set_alpha): * src/textconv.c (start_batch_edit, end_batch_edit, commit_text) (finish_composing_text, set_composing_text) (set_composing_region, textconv_set_point_and_mark) (delete_surrounding_text, request_point_update) (textconv_barrier, replace_text, get_extracted_text) (get_surrounding_text): * src/xdisp.c (gui_union_rectangles): * src/xterm.c (xi_frame_selected_for): Define only if needed. * src/treesit.c (treesit_debug_print_parser_list) (treesit_debug_print_linecol): Declare EXTERNALLY_VISIBLE. * src/xdisp.c (x_y_to_column_row): New function, defined only if needed. All external callers to x_y_to_hpos_vpos changed.
* Avoid extra newline in user-error logged in *Messages*Eli Zaretskii2025-11-151-0/+9
| | | | | | | | * src/xdisp.c (reset_message_log_need_newline): New function. * src/lisp.h: Add prototype of 'reset_message_log_need_newline'. * src/print.c (print_error_message): Call 'reset_message_log_need_newline' to prevent message3 from outputting a newline after "user-error:". (Bug#79840)
* (redisplay_internal): Fix `follow-mode` (bug#79306)Stefan Monnier2025-09-051-2/+2
| | | | | * src/xdisp.c (redisplay_internal): Don't increment `redisplay_counter` if we ail out before starting an actual redisplay.
* Fix last change in 'next_element_from_display_vector'Eli Zaretskii2025-08-261-2/+8
| | | | | | | * src/xdisp.c (next_element_from_display_vector): Only switch the iterator from unibyte to multibyte, never in the other direction, and not if the original character came from a unibyte buffer. (Bug#79317)
* Fix use of display-table for mode-line displayEli Zaretskii2025-08-251-0/+4
| | | | | | * src/xdisp.c (next_element_from_display_vector): Fix handling non-ASCII characters in display-table cells corresponding to ASCII characters. (Bug#79311)
* Fix assertion violations caused by recent redisplay changesEli Zaretskii2025-08-251-2/+0
| | | | | * src/xdisp.c (push_it): Don't rest the string_from_prefix_prop_p flag. (Bug#79304)
* Attempt to fix assertion violations in bug#79304Eli Zaretskii2025-08-251-21/+8
| | | | | | | | | | The following changes make the changes for bug#79275 less radical, closer to their previous shape, while still fixing that bug. * src/xdisp.c (push_prefix_prop, get_it_property): Restore original code that determined the object and position on it. (get_line_prefix_it_property): Take FROM_BUFFER from the actual object of the prefix property.
* Fix line-prefix display when there's a 'display' string at BOLEli Zaretskii2025-08-231-19/+67
| | | | | | | | | | | | | | | | | | | | | | * 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)
* ; * src/xdisp.c: Fix typo.Michael Albinus2025-07-161-1/+1
|
* ; Fix wording.Sean Whitton2025-07-151-1/+1
|
* ; Fix recently introduced "ELisp".Sean Whitton2025-07-151-1/+1
|
* Add `redisplay_counter` to catch nested redisplays and abort outer oneStefan Monnier2025-07-151-1/+21
| | | | | | | | | | | | | | | | The redisplay code is not re-entrant. To allow running ELisp code from within redisplay, we have some hacks (e.g. `inhibit-redisplay`) that try to avoid the resulting breakage. This commit adds another one of those hacks, which tries to get closer to the core of the problem, thereby making it "safe" to override `inhibit-redisplay`, e.g. to debug jit-lock code. * src/dispextern.h (redisplay_counter): Declare. * src/xdisp.c (redisplay_counter): Define. (redisplay_internal) Increment it. (dsafe__call): Use it, in case `inhibit-redisplay` is overridden. * src/eval.c (call_debugger): Use it as well to refine the test we already had.
* * src/xdisp.c (tab-bar-truncate): New variable (bug#78953).Juri Linkov2025-07-141-1/+13
| | | | (tab_bar_height): Use it.
* Prevent redisplay slowdown with non-zero vscrollEli Zaretskii2025-06-171-3/+5
| | | | | | | * src/xdisp.c (try_scrolling): Don't loop when the partially-visible cursor line is at the top of the window. This looping are pointless, and just makes redisplay slow for no reason. (Bug#78766)
* Improve documentation for display property functionsJim Porter2025-06-101-11/+13
| | | | | | | | | | | | | | | Specifically, use the term "display specification" more consistently to distinguish from "display property", which is the full value of the 'display' text property. * src/xdisp.c (find_display_property): Rename PROP to SPEC. (Fget_display_property): Rename PROP to SPEC and improve docstring. * lisp/emacs-lisp/subr-x.el (add-display-text-property): Rename PROP to SPEC and improve docstring. * doc/lispref/display.texi (Display Property): Reword documentation to more-consistently refer to display specifications.
* Fix vertical-motion when an image is at EOL under word-wrapJD Smith2025-06-071-4/+15
| | | | | | * src/xdisp.c (move_it_in_display_line_to): Fix return value under word-wrap when a screen line ends with an image that "just fits". (Bug#67604)
* Add line-column tracking for tree-sitterYuan Fu2025-05-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add line-column tracking for tree-sitter parsers. Copied from comments in treesit.c: Technically we had to send tree-sitter the line and column position of each edit. But in practice we just send it dummy values, because tree-sitter doesn't use it for parsing and mostly just carries the line and column positions around and return it when e.g. reporting node positions[1]. This has been working fine until we encountered grammars that actually utilizes the line and column information for parsing (Haskell)[2]. [1] https://github.com/tree-sitter/tree-sitter/issues/445 [2] https://github.com/tree-sitter/tree-sitter/issues/4001 So now we have to keep track of line and column positions and pass valid values to tree-sitter. (It adds quite some complexity, but only linearly; one can ignore all the linecol stuff when trying to understand treesit code and then come back to it later.) Eli convinced me to disable tracking by default, and only enable it for languages that needs it. So the buffer starts out not tracking linecol. And when a parser is created, if the language is in treesit-languages-require-line-column-tracking, we enable tracking in the buffer, and enable tracking for the parser. To simplify things, once a buffer starts tracking linecol, it never disables tracking, even if parsers that need tracking are all deleted; and for parsers, tracking is determined at creation time, if it starts out tracking/non-tracking, it stays that way, regardless of later changes to treesit-languages-require-line-column-tracking. To make calculating line/column positons fast, we store linecol caches for begv, point, and zv in the buffer (buf->ts_linecol_cache_xxx); and in the parser object, we store linecol cache for visible beg/end of that parser. In buffer editing functions, we need the linecol for start/old_end/new_end, those can be calculated by scanning newlines (treesit_linecol_of_pos) from the buffer point cache, which should be always near the point. And we usually set the calculated linecol of new_end back to the buffer point cache. We also need to calculate linecol for the visible_beg/end for each parser, and linecol for the buffer's begv/zv, these positions are usually far from point, so we have caches for all of them (in either the parser object or the buffer). These positions are far from point, so it's inefficient to scan newlines from point to there to get up-to-date linecol for them; but in the same time, because they're far and outside the changed region, we can calculate their change in line and column number by simply counting how much newlines are added/removed in the changed region (compute_new_linecol_by_change). * doc/lispref/parsing.texi (Using Parser): Mention line-column tracking in manual. * etc/NEWS: Add news. * lisp/treesit.el: (treesit-languages-need-line-column-tracking): New variable. * src/buffer.c: Include treesit.h (for TREESIT_EMPTY_LINECOL). (Fget_buffer_create): (Fmake_indirect_buffer): Initialize new buffer fields. (Fbuffer_swap_text): Add new buffer fields. * src/buffer.h (ts_linecol): New struct. (buffer): New buffer fields. (BUF_TS_LINECOL_BEGV): (BUF_TS_LINECOL_POINT): (BUF_TS_LINECOL_ZV): (SET_BUF_TS_LINECOL_BEGV): (SET_BUF_TS_LINECOL_POINT): (SET_BUF_TS_LINECOL_ZV): New inline functions. * src/casefiddle.c (casify_region): Record linecol info. * src/editfns.c (Fsubst_char_in_region): (Ftranslate_region_internal): (Ftranspose_regions): Record linecol info. * src/insdel.c (insert_1_both): (insert_from_string_1): (insert_from_gap_1): (insert_from_buffer): (replace_range): (del_range_2): Record linecol info. * src/treesit.c (TREESIT_BOB_LINECOL): (TREESIT_EMPTY_LINECOL): (TREESIT_TS_POINT_1_0): New constants. (treesit_debug_print_linecol): (treesit_buf_tracks_linecol_p): (restore_restriction_and_selective_display): (treesit_count_lines): (treesit_debug_validate_linecol): (treesit_linecol_of_pos): (treesit_make_ts_point): (Ftreesit_tracking_line_column_p): (Ftreesit_parser_tracking_line_column_p): New functions. (treesit_tree_edit_1): Accept real TSPoint and pass to tree-sitter. (compute_new_linecol_by_change): New function. (treesit_record_change_1): Rename from treesit_record_change, handle linecol if tracking is enabled. (treesit_linecol_maybe): New function. (treesit_record_change): New wrapper around treesit_record_change_1 that handles some boilerplate and sets buffer state. (treesit_sync_visible_region): Handle linecol if tracking is enabled. (make_treesit_parser): Setup parser's linecol cache if tracking is enabled. (Ftreesit_parser_create): Enable tracking if the parser's language requires it. (Ftreesit__linecol_at): (Ftreesit__linecol_cache_set): (Ftreesit__linecol_cache): New functions for debugging and testing. (syms_of_treesit): New variable Vtreesit_languages_require_line_column_tracking. * src/treesit.h (Lisp_TS_Parser): New fields. (TREESIT_BOB_LINECOL): (TREESIT_EMPTY_LINECOL): New constants. * test/src/treesit-tests.el (treesit-linecol-basic): (treesit-linecol-search-back-across-newline): (treesit-linecol-col-same-line): (treesit-linecol-enable-disable): New tests. * src/lisp.h: Declare display_count_lines. * src/xdisp.c (display_count_lines): Remove static keyword.
* Show drag cursor on all window lines (mode, tab, header)Jared Finder2025-04-151-14/+19
| | | | | | | | | | | * lisp/ruler-mode.el (ruler-mode-map): Remove down-mouse-1 binding that conflicts with dragging header line. * src/xdisp.c (note_mode_line_or_margin_highlight): Renamed to... (note_line_or_margin_highlight): ...new name since it applies to any window line (mode, tab, header). Set drag cursor for window top lines. (note_mouse_highlight): Update call to new name (bug#76084).
* Disable clearing echo-area when 'inhibit-message' is non-nilEli Zaretskii2025-04-131-1/+1
| | | | | | | | | * src/xdisp.c (clear_message): Don't clear echo-area if 'inhibit-message' is non-nil. * etc/NEWS: * doc/lispref/display.texi (Displaying Messages): Document the above change. (Bug#77257)
* ; * src/xdisp.c (display_mode_line, display_mode_element): Fix comments.Eli Zaretskii2025-04-051-8/+8
|
* Fix mouse highlighting for compact mode lines (bug#77336)Pengji Zhang2025-04-051-39/+106
| | | | | | | | | | | | | | | | | When 'mode-line-compact' is non-nil, the mode line string is displayed as a whole. That confuses the computation of ranges of mouse highlighting on the mode line because all the glyphs have the same Lisp object source. As such, in this commit we instead split the mode line string by sources, and display those elements one by one, so the boundaries of each element could be correctly detected for the purpose of mouse highlighting. * src/xdisp.c (display_mode_line): Display mode line elements one by one when 'mode-line-compact' is non-nil. (display_mode_element): Record source element number of the stored string via a text property. (Fformat_mode_line): Initialize 'mode_line_elt_no' to 0. (syms_of_xdisp): New symbol for the text property.
* Fix display of wide characters in display margins on TTY framesEli Zaretskii2025-04-021-1/+13
| | | | | | * src/xdisp.c (display_line): Remove incomplete glyph sequence of the last multi-column character, if not all of its glyphs fit in the marginal area. (Bug#77452)
* More thorough fix for image slices on mode/header-lineEli Zaretskii2025-04-021-9/+0
| | | | | | | | * src/xdisp.c (note_mode_line_or_margin_highlight): Remove correction of DX and DY due to image slices, as this is now done in 'mode_line_string'. * src/dispnew.c (mode_line_string): Make DX and DY account for image slices. (Bug#77429)
* Fix :map property on sliced images on mode line and header lineEli Zaretskii2025-04-011-0/+9
| | | | | | * src/xdisp.c (note_mode_line_or_margin_highlight): Fix coordinates for image slices wrt ':map' keyword when the image is on the mode line or header line. (Bug#77429)
* Fix display of overlay arrow immediately after invisible textEli Zaretskii2025-03-301-1/+10
| | | | | | | * src/xdisp.c (overlay_arrow_at_row): Allow the overlay arrow's marker position to be anywhere between the row's start and end charpos. This keeps the overlay arrow on display even when the preceding text is invisible. (Bug#54843)
* Fix vertical cursor motion with wide images and line numbersEli Zaretskii2025-03-261-3/+5
| | | | | | * src/xdisp.c (produce_image_glyph): When cropping an image that exceeds the window's right edge, account for the screen estate taken by line-number display. (Bug#77217)
* Avoid infinite loop with images under 'display-line-numbers-mode'Eli Zaretskii2025-03-211-5/+5
| | | | | | | * 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)
* Implement surrogate menu bars for tty child framesMartin Rudalics2025-03-171-25/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/menu-bar.el (popup-menu): When asked to pop up MENU from a tty child frame try to use menu of its root frame. (menu-bar-open): When FRAME is a child frame and 'tty-menu-open-use-tmm' is nil, navigate menu bar of its root frame. * src/keymap.c (Fcurrent_active_maps): Accept live window as POSITION argument and use its buffer as current when processing the key sequence. Needed for tty child frames so the root frame's menu bar can be updated according to the selected window's buffer when navigating the menu bar from keyboard. * src/xdisp.c (prepare_menu_bars): If the selected window's frame is a tty child frame without menu bar, that frame's root frame has a menu bar and 'tty-menu-open-use-tmm' is nil, prepare to update the menu bar of the root frame as surrogate. (update_menu_bar): New argument W denoting the window that should be considered as selected. For a tty child frame using F as surrogate menu bar frame this specifies the child frame's selected window and its buffer shall be used for updating the menu bar of the root frame instead of the buffer of the root frame's selected window. (redisplay_window): Instead of setting redisplay_menu_p flag always call display_menu_bar right away. This facilitates to call display_menu_bar for a tty child frame with its root frame as surrogate menu bar frame. (display_tty_menu_item): If the selected frame is a tty child frame, overwrite its root frame's glyph matrix (and not that of the child frame) when displaying a menu item. (Qtty_menu_open_use_tmm): Define symbol.
* Avoid rare segfaults in 'combine_updates_for_frame'Eli Zaretskii2025-03-161-1/+4
| | | | | * src/xdisp.c (redisplay_internal): Don't add to 'tty_root_frames' frames that are not yet completely made. (Bug#77046)
* mouse-face properties on tab-bar tab captions (bug#76394)shipmints2025-03-061-17/+114
| | | | | | | | | | | | | * etc/NEWS: Announce 'tab-bar' 'mouse-face' support. * src/xdisp.c (note_tab_bar_highlight): Handle mouse-face property. * lisp/tab-bar.el (tab-bar-tab-highlight): New face. (tab-bar-tab-name-format-mouse-face): New function adds the 'mouse-face' 'tab-bar-tab-highlight' to the tab name. (tab-bar-tab-name-format-functions): Add 'tab-bar-tab-name-format-mouse-face'.
* Fix images on the mode line under 'mode-line-compact'Eli Zaretskii2025-03-061-9/+25
| | | | | | * src/xdisp.c (display_mode_line): When 'mode-line-compact' is in effect, don't remove spaces that have a 'display' property on them. (Bug#76761)
* Fix redisplay of tab bar when its text properties changeEli Zaretskii2025-03-061-1/+4
| | | | | * src/xdisp.c (update_tab_bar): Use 'equal-including-properties' to compare previous with the current tab-bar items. (Bug#76760)
* Merge from origin/emacs-30Eli Zaretskii2025-03-011-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f88dc0f2f9d ; Fix documentation of 'buffer-text-pixel-size' 734986349fd ; Minor Android documentation improvements a90da899034 ; Fix up emacs-lisp-mode docstring 58c7acb5554 ; Fix completion-fail-discreetly docstring typo. 02c830ba22b Fix ert-font-lock macro signatures 0c6b8643aec Fix a typo in 'window_text_pixel_size' 8a8c25eaccd ; Add Rudolf Schlatte to authors.el 94c0ea39a5a * doc/misc/efaq.texi (New in Emacs 30): Fix typo. (Bug#7... 0be5f9115ec ; * etc/images/README (Files): Add an entry for last-page... 63adf9dcf53 ; Reflow some cl-lib docstrings 99253f79703 ; * etc/TODO: New section "Make it easier to contribute". # Conflicts: # lisp/emacs-lisp/cl-macs.el
| * Fix a typo in 'window_text_pixel_size'Eli Zaretskii2025-02-241-1/+3
| | | | | | | | | | | | This typo caused strange mis-behaviors in buffers with non-ASCII characters. * src/xdisp.c (window_text_pixel_size): Fix typo. (Bug#76519)
* | Handle multibyte mode line spec chars (bug#76517)Pip Cet2025-02-251-1/+10
| | | | | | | | | | | | * src/xdisp.c (display_mode_element): Make 'c' an 'int'. Use 'string_char_and_length' to fetch the character from a multibyte string, not 'SREF'.
* | ; Fix typosStefan Kangas2025-02-221-1/+1
| |
* | ; * src/xdisp.c (maybe_produce_line_number): Fix last change (bug#76362).Eli Zaretskii2025-02-171-1/+2
| |
* | Prevent buffer overflow in line-numbering codeEli Zaretskii2025-02-151-2/+13
| | | | | | | | | | | | * src/xdisp.c (maybe_produce_line_number): Limit the value of 'display-line-numbers-width' to what can be shown in the window, and set dimension of the lnum_buf[] accordingly. (Bug#75969)
* | Fix handling of visibility on tty frames (Bug#76031)Martin Rudalics2025-02-101-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/frame.h (FRAME_REDISPLAY_P): Remove. Use the new function frame_redisplay_p instead. Extern frame_redisplay_p. * src/frame.c (frame_redisplay_p): New function to replace FRAME_REDISPLAY_P macro. (make_terminal_frame): Don't tinker with frame visibility and don't make the new frame the terminal's top frame. (do_switch_frame): Make sure frame switched to and any of its ancestors are visible. Don't reset the visibility of other frames. (other_frames): Do not assume tty frames are by default visible. (Fmake_frame_invisible): When making the selected tty frame invisible, explicitly select the next visible frame. * src/dispnew.c (Fredraw_display): Use frame_redisplay_p instead of FRAME_REDISPLAY_P. * src/xdisp.c (clear_garbaged_frames, echo_area_display) (prepare_menu_bars, redisplay_internal, display_and_set_cursor) (gui_clear_cursor): Use frame_redisplay_p instead of FRAME_REDISPLAY_P. * src/keyboard.c (tty_read_avail_input): When storing an event and the selected frame is a child frame whose root is its terminal's top frame, set the frame_or_window slot to the child frame since otherwise the next switch frame event will select the top frame instead.
* | Fix min-width display spec handling (bug#76014)Gerd Möllmann2025-02-041-5/+7
| | | | | | | | | | * src/xdisp.c (display_min_width): Take into account that the output may already be longer than the specified min-width.
* | Fix mouse pointer inside mouse-face on text with 'pointer' propertyEli Zaretskii2025-02-021-17/+18
| | | | | | | | | | | | | | | | * src/dispnew.c (gui_update_window_end): Don't consider mouse face overwritten. * src/xdisp.c (show_mouse_face): Accept an additional argument; redefine the mouse cursor only if that argument is 'true'. All callers changed. (Bug#75931)