* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
@ 2025-02-02 16:03 Gerd Möllmann
2025-02-02 16:51 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Gerd Möllmann @ 2025-02-02 16:03 UTC (permalink / raw)
To: 76014
With master, emacs -Q. Move the mouse to the "All" displayed in the
mode-line. The last 'l' is not highlighted.
This seems to be the case for a longer time.
cb0b6a405706f6367d9adfb3ee447590c2a0876f from around 4 months ago
already shows this. Emacs 30 works as expected.
Sorry, I can't bisect this at the moment.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
2025-02-02 16:03 bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line Gerd Möllmann
@ 2025-02-02 16:51 ` Eli Zaretskii
2025-02-03 5:53 ` Gerd Möllmann
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2025-02-02 16:51 UTC (permalink / raw)
To: Gerd Möllmann; +Cc: 76014
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Date: Sun, 02 Feb 2025 17:03:14 +0100
>
> With master, emacs -Q. Move the mouse to the "All" displayed in the
> mode-line. The last 'l' is not highlighted.
>
> This seems to be the case for a longer time.
> cb0b6a405706f6367d9adfb3ee447590c2a0876f from around 4 months ago
> already shows this. Emacs 30 works as expected.
>
> Sorry, I can't bisect this at the moment.
It happened sometime in August last year, so my prime suspect is
71505b723c9fb9de20f6d38be7c73d595e9be3ce, since that part of the mode
line uses 'min-width' display property.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
2025-02-02 16:51 ` Eli Zaretskii
@ 2025-02-03 5:53 ` Gerd Möllmann
2025-02-03 6:40 ` Gerd Möllmann
0 siblings, 1 reply; 7+ messages in thread
From: Gerd Möllmann @ 2025-02-03 5:53 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 76014
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Date: Sun, 02 Feb 2025 17:03:14 +0100
>>
>> With master, emacs -Q. Move the mouse to the "All" displayed in the
>> mode-line. The last 'l' is not highlighted.
>>
>> This seems to be the case for a longer time.
>> cb0b6a405706f6367d9adfb3ee447590c2a0876f from around 4 months ago
>> already shows this. Emacs 30 works as expected.
>>
>> Sorry, I can't bisect this at the moment.
>
> It happened sometime in August last year, so my prime suspect is
> 71505b723c9fb9de20f6d38be7c73d595e9be3ce, since that part of the mode
> line uses 'min-width' display property.
Confirmed, 71505b723c9fb9de20f6d38be7c73d595e9be3ce it is.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
2025-02-03 5:53 ` Gerd Möllmann
@ 2025-02-03 6:40 ` Gerd Möllmann
2025-02-04 5:12 ` Gerd Möllmann
0 siblings, 1 reply; 7+ messages in thread
From: Gerd Möllmann @ 2025-02-03 6:40 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 76014
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> Confirmed, 71505b723c9fb9de20f6d38be7c73d595e9be3ce it is.
Don't know if this is directly related, but playing with
(defun foo ()
(interactive)
(with-current-buffer (get-buffer-create "*foo*")
(erase-buffer)
(insert "12345")
(put-text-property (point-min) (point)
'display '(min-width (5)))
(put-text-property (point-min) (point)
'mouse-face 'highlight)
(insert "abc")
(display-buffer (current-buffer))))
shows that if the text, in this case "12345", is longer than min-width, a
space is added, and if it's equal to min-width, no space is added.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
2025-02-03 6:40 ` Gerd Möllmann
@ 2025-02-04 5:12 ` Gerd Möllmann
2025-02-04 13:46 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Gerd Möllmann @ 2025-02-04 5:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 76014
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
>> Confirmed, 71505b723c9fb9de20f6d38be7c73d595e9be3ce it is.
>
> Don't know if this is directly related, but playing with
>
> (defun foo ()
> (interactive)
> (with-current-buffer (get-buffer-create "*foo*")
> (erase-buffer)
> (insert "12345")
> (put-text-property (point-min) (point)
> 'display '(min-width (5)))
> (put-text-property (point-min) (point)
> 'mouse-face 'highlight)
> (insert "abc")
> (display-buffer (current-buffer))))
>
> shows that if the text, in this case "12345", is longer than min-width, a
> space is added, and if it's equal to min-width, no space is added.
That attached patch fixes both the above problem and the the one in the
mode-line.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-min-width-display-spec-handling-bug-76014.patch --]
[-- Type: text/x-patch, Size: 2026 bytes --]
From 711f21b659633fb05b81f43f3e81391e5988fe3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd@gnu.org>
Date: Tue, 4 Feb 2025 06:09:52 +0100
Subject: [PATCH] Fix min-width display spec handling (bug#76014)
* src/xdisp.c (display_min_width): Take into account that the output may
already be longer than the specified min-width.
---
src/xdisp.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index ed4a5564427..72311362035 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5650,7 +5650,7 @@ get_display_property (ptrdiff_t charpos, Lisp_Object prop, Lisp_Object object)
/* Handle 'display' property '(min-width (WIDTH))' at CHARPOS in OBJECT.
OBJECT can be a buffer (or nil, which means the current buffer) or a
- string. MIN_WIDTH is the value of min-width spec that we expect to
+ string. WIDTH_SPEC is the value of min-width spec that we expect to
process. */
static void
display_min_width (struct it *it, ptrdiff_t charpos,
@@ -5696,8 +5696,9 @@ display_min_width (struct it *it, ptrdiff_t charpos,
a stretch that ends beyond the visible portion of the
window if we are truncating screen lines. If we are
requested to do that, some Lisp program went awry. */
- if (!(it->line_wrap == TRUNCATE
- && it->current_x + width > it->last_visible_x))
+ if (width > 0
+ && !(it->line_wrap == TRUNCATE
+ && it->current_x + width > it->last_visible_x))
w = list1 (make_int (width));
}
else
@@ -5708,8 +5709,9 @@ display_min_width (struct it *it, ptrdiff_t charpos,
NULL, true, NULL);
width -= (it->current_x - it->min_width_start) /
FRAME_COLUMN_WIDTH (it->f);
- if (!(it->line_wrap == TRUNCATE
- && it->current_x + width > it->last_visible_x))
+ if (width > 0
+ && !(it->line_wrap == TRUNCATE
+ && it->current_x + width > it->last_visible_x))
w = make_int (width);
}
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
2025-02-04 5:12 ` Gerd Möllmann
@ 2025-02-04 13:46 ` Eli Zaretskii
2025-02-04 14:45 ` Gerd Möllmann
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2025-02-04 13:46 UTC (permalink / raw)
To: Gerd Möllmann; +Cc: 76014
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: 76014@debbugs.gnu.org
> Date: Tue, 04 Feb 2025 06:12:57 +0100
>
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
> > Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> >
> >> Confirmed, 71505b723c9fb9de20f6d38be7c73d595e9be3ce it is.
> >
> > Don't know if this is directly related, but playing with
> >
> > (defun foo ()
> > (interactive)
> > (with-current-buffer (get-buffer-create "*foo*")
> > (erase-buffer)
> > (insert "12345")
> > (put-text-property (point-min) (point)
> > 'display '(min-width (5)))
> > (put-text-property (point-min) (point)
> > 'mouse-face 'highlight)
> > (insert "abc")
> > (display-buffer (current-buffer))))
> >
> > shows that if the text, in this case "12345", is longer than min-width, a
> > space is added, and if it's equal to min-width, no space is added.
>
> That attached patch fixes both the above problem and the the one in the
> mode-line.
Thanks, feel free to install.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line
2025-02-04 13:46 ` Eli Zaretskii
@ 2025-02-04 14:45 ` Gerd Möllmann
0 siblings, 0 replies; 7+ messages in thread
From: Gerd Möllmann @ 2025-02-04 14:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 76014
Eli Zaretskii <eliz@gnu.org> writes:
> Thanks, feel free to install.
Pushed and closing.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-02-04 14:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02 16:03 bug#76014: 31.0.50; Wrong highlighting of "All" in mode-line Gerd Möllmann
2025-02-02 16:51 ` Eli Zaretskii
2025-02-03 5:53 ` Gerd Möllmann
2025-02-03 6:40 ` Gerd Möllmann
2025-02-04 5:12 ` Gerd Möllmann
2025-02-04 13:46 ` Eli Zaretskii
2025-02-04 14:45 ` Gerd Möllmann
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.