Commit ac6ba689 authored by Eli Zaretskii's avatar Eli Zaretskii

Minor fixes of the last commit

* src/xdisp.c (get_window_cursor_type): Fix indentation and
line-filling.
* doc/lispref/frames.texi (Cursor Parameters):
* doc/emacs/display.texi (Cursor Display):
* etc/NEWS: Fix wording and capitalization of the last change.
parent 63fd6c9e
Pipeline #4761 passed with stage
in 59 minutes and 18 seconds
......@@ -1654,8 +1654,8 @@ Customization}). (The other attributes of this face have no effect;
the text shown under the cursor is drawn using the frame's background
color.) To change its shape, customize the buffer-local variable
@code{cursor-type}; possible values are @code{box} (the default),
@code{(box . @var{SIZE})} (box cursor becoming a hollow box under
masked images larger than @var{SIZE} pixels in either dimension),
@code{(box . @var{size})} (box cursor becoming a hollow box under
masked images larger than @var{size} pixels in either dimension),
@code{hollow} (a hollow box), @code{bar} (a vertical bar), @code{(bar
. @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} (a
horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n}
......
......@@ -2220,9 +2220,9 @@ How to display the cursor. Legitimate values are:
@table @code
@item box
Display a filled box. (This is the default.)
@item (box . @var{SIZE})
@item (box . @var{size})
Display a filled box. However, display it as a hollow box if point is
under masked image larger than @var{SIZE} pixels in either dimension.
under masked image larger than @var{size} pixels in either dimension.
@item hollow
Display a hollow box.
@item nil
......
......@@ -65,10 +65,10 @@ It was declared obsolete in Emacs 27.1.
* Changes in Emacs 28.1
** Support for '(box . SIZE)' cursor-type.
By default, 'box' cursor always has a filled box shape. Unless you
specify cursor-type to be '(box . SIZE)'. In such case, cursor
becomes a hollow box if the point is under masked image larger than
'SIZE' pixels in any dimension.
By default, 'box' cursor always has a filled box shape. But if you
specify cursor-type to be '(box . SIZE)', the cursor becomes a hollow
box if the point is on an image larger than 'SIZE' pixels in any
dimension.
* Editing Changes in Emacs 28.1
......
......@@ -30884,26 +30884,28 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
if (!w->cursor_off_p)
{
if (glyph != NULL && glyph->type == XWIDGET_GLYPH)
return NO_CURSOR;
return NO_CURSOR;
if (glyph != NULL && glyph->type == IMAGE_GLYPH)
{
if (cursor_type == FILLED_BOX_CURSOR)
{
/* Using a block cursor on large images can be very annoying.
So use a hollow cursor for "large" images.
If image is not transparent (no mask), also use hollow cursor. */
/* Using a block cursor on large images can be very
annoying. So use a hollow cursor for "large" images.
If image is not transparent (no mask), also use
hollow cursor. */
struct image *img = IMAGE_OPT_FROM_ID (f, glyph->u.img_id);
if (img != NULL && IMAGEP (img->spec))
{
/* Interpret "large" as >SIZExSIZE and >NxN
where SIZE is the value from cursor-type in form (box . SIZE),
where N = size of default frame font size.
So, setting cursor-type to (box . 32) should cover most of
the "tiny" icons people may use. */
/* Interpret "large" as >SIZExSIZE and >NxN where
SIZE is the value from cursor-type of the form
(box . SIZE), where N = size of default frame
font size. So, setting cursor-type to (box . 32)
should cover most of the "tiny" icons people may
use. */
if (!img->mask
|| (CONSP (BVAR (b, cursor_type))
&& img->width > max (*width, WINDOW_FRAME_COLUMN_WIDTH (w))
&& img->height > max (*width, WINDOW_FRAME_LINE_HEIGHT (w))))
|| (CONSP (BVAR (b, cursor_type))
&& img->width > max (*width, WINDOW_FRAME_COLUMN_WIDTH (w))
&& img->height > max (*width, WINDOW_FRAME_LINE_HEIGHT (w))))
cursor_type = HOLLOW_BOX_CURSOR;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment