all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Cursors:  Is superimposing the same glyph a feature?
Date: Sat, 16 Feb 2019 11:00:21 +0000	[thread overview]
Message-ID: <20190216110021.GA76552@breton.holly.idiocy.org> (raw)
In-Reply-To: <m2r2c8kwz8.wl%esq@lawlist.com>

[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]

On Fri, Feb 15, 2019 at 11:34:35PM -0800, Keith David Bershatsky wrote:
> 
> Here are my minimal settings in the .emacs file, and then I blew-up the size of the font to get a better screenshot:
> 
> (blink-cursor-mode -1)
> 
> (setq default-frame-alist (list '(cursor-type . (hbar . 1))
>                                 '(background-color . "black")
>                                 '(foreground-color . "white")))
> 
> You may need to blow-up the image and break-out the micrometer to
> discern that the letter "A" with the HBAR_CURSOR is somewhat wider,
> with more jagged edges, and the middle triangle is somewhat smaller
> (because the walls of the letter "A" are thicker). This phenomenon
> is more easily noticed with the naked eye when holding down the
> left/right arrow key (repeating) and watching the character at point
> become bold, and then the bold is removed when moving on to the next
> character at point.

I can see it too. I’d never noticed. I doubt very much it’s
intentional.

It looks like the NS port does the wrong thing here. At the moment it
redraws the glyph on top of the cursor as long as CURSOR_TYPE !=
NO_CURSOR, but looking at an X build, it looks as though HBAR_CURSOR,
for example, should cover the glyph.

So I reckon we should only redraw the glyph if the cursor is filled box or
hollow box.

Patch attached.
-- 
Alan Third

[-- Attachment #2: 0001-Prevent-redrawing-the-glyph-on-top-of-bar-cursors.patch --]
[-- Type: text/plain, Size: 1006 bytes --]

From 1638ac50070d6802329eae13eeba7926ed4c9149 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 16 Feb 2019 10:56:13 +0000
Subject: [PATCH] Prevent redrawing the glyph on top of bar cursors

* src/nsterm.m (ns_draw_window_cursor): Limit when we redraw the
glyph.
---
 src/nsterm.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index bbd2c84214..5d2b0a0812 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3126,8 +3126,9 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
           break;
         }
 
-      /* draw the character under the cursor */
-      if (cursor_type != NO_CURSOR)
+      /* Draw the character under the cursor.  Other terms only draw
+         the character on top of box cursors, so do the same here.  */
+      if (cursor_type == FILLED_BOX_CURSOR || cursor_type == HOLLOW_BOX_CURSOR)
         draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
 
       ns_reset_clipping (f);
-- 
2.20.1


  parent reply	other threads:[~2019-02-16 11:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16  7:34 Cursors: Is superimposing the same glyph a feature? Keith David Bershatsky
2019-02-16 10:05 ` Eli Zaretskii
2019-02-16 11:00 ` Alan Third [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-03-08  3:33 Keith David Bershatsky
2019-03-09  9:22 ` Alan Third
2019-02-16 16:28 Keith David Bershatsky
2019-02-15 16:27 Keith David Bershatsky
2019-02-15 18:31 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190216110021.GA76552@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.