aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2020-02-07 12:10:43 +0200
committerEli Zaretskii2020-02-07 12:10:43 +0200
commitac6ba689d1cdb2611a779f9eb032d5ce97c77742 (patch)
tree1e9f646f37a1a35263c965f53cbad73b61eadf1d
parent63fd6c9ef050f8077823b3a45c841dc255257f3b (diff)
downloademacs-ac6ba689d1cdb2611a779f9eb032d5ce97c77742.tar.gz
emacs-ac6ba689d1cdb2611a779f9eb032d5ce97c77742.zip
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.
-rw-r--r--doc/emacs/display.texi4
-rw-r--r--doc/lispref/frames.texi4
-rw-r--r--etc/NEWS8
-rw-r--r--src/xdisp.c26
4 files changed, 22 insertions, 20 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index dc6fe3a0327..4ecebc7a270 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1654,8 +1654,8 @@ Customization}). (The other attributes of this face have no effect;
1654the text shown under the cursor is drawn using the frame's background 1654the text shown under the cursor is drawn using the frame's background
1655color.) To change its shape, customize the buffer-local variable 1655color.) To change its shape, customize the buffer-local variable
1656@code{cursor-type}; possible values are @code{box} (the default), 1656@code{cursor-type}; possible values are @code{box} (the default),
1657@code{(box . @var{SIZE})} (box cursor becoming a hollow box under 1657@code{(box . @var{size})} (box cursor becoming a hollow box under
1658masked images larger than @var{SIZE} pixels in either dimension), 1658masked images larger than @var{size} pixels in either dimension),
1659@code{hollow} (a hollow box), @code{bar} (a vertical bar), @code{(bar 1659@code{hollow} (a hollow box), @code{bar} (a vertical bar), @code{(bar
1660. @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} (a 1660. @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} (a
1661horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n} 1661horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n}
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 70ebe2e87d7..caa08ffb1de 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -2220,9 +2220,9 @@ How to display the cursor. Legitimate values are:
2220@table @code 2220@table @code
2221@item box 2221@item box
2222Display a filled box. (This is the default.) 2222Display a filled box. (This is the default.)
2223@item (box . @var{SIZE}) 2223@item (box . @var{size})
2224Display a filled box. However, display it as a hollow box if point is 2224Display a filled box. However, display it as a hollow box if point is
2225under masked image larger than @var{SIZE} pixels in either dimension. 2225under masked image larger than @var{size} pixels in either dimension.
2226@item hollow 2226@item hollow
2227Display a hollow box. 2227Display a hollow box.
2228@item nil 2228@item nil
diff --git a/etc/NEWS b/etc/NEWS
index 2c5133e1d24..55c1a47fbfb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -65,10 +65,10 @@ It was declared obsolete in Emacs 27.1.
65* Changes in Emacs 28.1 65* Changes in Emacs 28.1
66 66
67** Support for '(box . SIZE)' cursor-type. 67** Support for '(box . SIZE)' cursor-type.
68By default, 'box' cursor always has a filled box shape. Unless you 68By default, 'box' cursor always has a filled box shape. But if you
69specify cursor-type to be '(box . SIZE)'. In such case, cursor 69specify cursor-type to be '(box . SIZE)', the cursor becomes a hollow
70becomes a hollow box if the point is under masked image larger than 70box if the point is on an image larger than 'SIZE' pixels in any
71'SIZE' pixels in any dimension. 71dimension.
72 72
73 73
74* Editing Changes in Emacs 28.1 74* Editing Changes in Emacs 28.1
diff --git a/src/xdisp.c b/src/xdisp.c
index 038b8e53669..e41ceaf0bb7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -30884,26 +30884,28 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
30884 if (!w->cursor_off_p) 30884 if (!w->cursor_off_p)
30885 { 30885 {
30886 if (glyph != NULL && glyph->type == XWIDGET_GLYPH) 30886 if (glyph != NULL && glyph->type == XWIDGET_GLYPH)
30887 return NO_CURSOR; 30887 return NO_CURSOR;
30888 if (glyph != NULL && glyph->type == IMAGE_GLYPH) 30888 if (glyph != NULL && glyph->type == IMAGE_GLYPH)
30889 { 30889 {
30890 if (cursor_type == FILLED_BOX_CURSOR) 30890 if (cursor_type == FILLED_BOX_CURSOR)
30891 { 30891 {
30892 /* Using a block cursor on large images can be very annoying. 30892 /* Using a block cursor on large images can be very
30893 So use a hollow cursor for "large" images. 30893 annoying. So use a hollow cursor for "large" images.
30894 If image is not transparent (no mask), also use hollow cursor. */ 30894 If image is not transparent (no mask), also use
30895 hollow cursor. */
30895 struct image *img = IMAGE_OPT_FROM_ID (f, glyph->u.img_id); 30896 struct image *img = IMAGE_OPT_FROM_ID (f, glyph->u.img_id);
30896 if (img != NULL && IMAGEP (img->spec)) 30897 if (img != NULL && IMAGEP (img->spec))
30897 { 30898 {
30898 /* Interpret "large" as >SIZExSIZE and >NxN 30899 /* Interpret "large" as >SIZExSIZE and >NxN where
30899 where SIZE is the value from cursor-type in form (box . SIZE), 30900 SIZE is the value from cursor-type of the form
30900 where N = size of default frame font size. 30901 (box . SIZE), where N = size of default frame
30901 So, setting cursor-type to (box . 32) should cover most of 30902 font size. So, setting cursor-type to (box . 32)
30902 the "tiny" icons people may use. */ 30903 should cover most of the "tiny" icons people may
30904 use. */
30903 if (!img->mask 30905 if (!img->mask
30904 || (CONSP (BVAR (b, cursor_type)) 30906 || (CONSP (BVAR (b, cursor_type))
30905 && img->width > max (*width, WINDOW_FRAME_COLUMN_WIDTH (w)) 30907 && img->width > max (*width, WINDOW_FRAME_COLUMN_WIDTH (w))
30906 && img->height > max (*width, WINDOW_FRAME_LINE_HEIGHT (w)))) 30908 && img->height > max (*width, WINDOW_FRAME_LINE_HEIGHT (w))))
30907 cursor_type = HOLLOW_BOX_CURSOR; 30909 cursor_type = HOLLOW_BOX_CURSOR;
30908 } 30910 }
30909 } 30911 }