unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* cursor-type as bar
@ 2006-03-07 15:03 Markus Gritsch
  2006-03-07 19:11 ` J. David Boyd
  2006-03-11 22:06 ` Juri Linkov
  0 siblings, 2 replies; 12+ messages in thread
From: Markus Gritsch @ 2006-03-07 15:03 UTC (permalink / raw)


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

Hi,

I would like to use a bar cursor, instead of a block cursor.
(setq default-frame-alist '((cursor-type . (bar . 2))))

The problem is, that the bar cursor is drawn like a block cursor, only 
using a smaller width. To really be usable, the bar cursor should be 
drawn *between* the characters, e.g. shifting it width/2 pixels to the left.

On the attached Emacs.png the 'u' is partially hiden by the bar-cursor. 
  It is even worse when the cursor is placed at the 'i', in which case 
the letter is hidden completely.  The attachment SciTE.png shows a 
screenshot of the OpenSource Scintilla text editing widget, which shifts 
a 2 pixel wide bar-cursor one pixel to the left.

Kind regards,
Markus

[-- Attachment #2: Emacs.png --]
[-- Type: image/png, Size: 6975 bytes --]

[-- Attachment #3: SciTE.png --]
[-- Type: image/png, Size: 10249 bytes --]

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-07 15:03 cursor-type as bar Markus Gritsch
@ 2006-03-07 19:11 ` J. David Boyd
  2006-03-07 20:46   ` J. David Boyd
  2006-03-11 22:06 ` Juri Linkov
  1 sibling, 1 reply; 12+ messages in thread
From: J. David Boyd @ 2006-03-07 19:11 UTC (permalink / raw)


Markus Gritsch <gritsch@iue.tuwien.ac.at> writes:

> Hi,
>
> I would like to use a bar cursor, instead of a block cursor.
> (setq default-frame-alist '((cursor-type . (bar . 2))))
>
> The problem is, that the bar cursor is drawn like a block cursor, only 
> using a smaller width. To really be usable, the bar cursor should be 
> drawn *between* the characters, e.g. shifting it width/2 pixels to the left.
>
> On the attached Emacs.png the 'u' is partially hiden by the bar-cursor. 
>  It is even worse when the cursor is placed at the 'i', in which case 
> the letter is hidden completely.  The attachment SciTE.png shows a 
> screenshot of the OpenSource Scintilla text editing widget, which shifts 
> a 2 pixel wide bar-cursor one pixel to the left.
>
> Kind regards,
> Markus
>

I'm using Emacs 22.0.50 on cygwin (windows xp), and the bar cursor does not
hide the letter 'i', as it is moved a tad to the left.

Dave

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-07 19:11 ` J. David Boyd
@ 2006-03-07 20:46   ` J. David Boyd
  2006-03-08  6:33     ` Markus Gritsch
  0 siblings, 1 reply; 12+ messages in thread
From: J. David Boyd @ 2006-03-07 20:46 UTC (permalink / raw)


david@adboyd.com (J. David Boyd) writes:

> Markus Gritsch <gritsch@iue.tuwien.ac.at> writes:
>
>> Hi,
>>
>> I would like to use a bar cursor, instead of a block cursor.
>> (setq default-frame-alist '((cursor-type . (bar . 2))))
>>
>> The problem is, that the bar cursor is drawn like a block cursor, only 
>> using a smaller width. To really be usable, the bar cursor should be 
>> drawn *between* the characters, e.g. shifting it width/2 pixels to the left.
>>
>> On the attached Emacs.png the 'u' is partially hiden by the bar-cursor. 
>>  It is even worse when the cursor is placed at the 'i', in which case 
>> the letter is hidden completely.  The attachment SciTE.png shows a 
>> screenshot of the OpenSource Scintilla text editing widget, which shifts 
>> a 2 pixel wide bar-cursor one pixel to the left.
>>
>> Kind regards,
>> Markus
>>
>
> I'm using Emacs 22.0.50 on cygwin (windows xp), and the bar cursor does not
> hide the letter 'i', as it is moved a tad to the left.
>
> Dave


Oops, sorry.  I'm using Emacs 22.0.50 on linux (mandriva le 2005), and the bar
cursor does not hide the letter 'i' ....

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-07 20:46   ` J. David Boyd
@ 2006-03-08  6:33     ` Markus Gritsch
  0 siblings, 0 replies; 12+ messages in thread
From: Markus Gritsch @ 2006-03-08  6:33 UTC (permalink / raw)
  Cc: emacs-devel

J. David Boyd wrote:
> david@adboyd.com (J. David Boyd) writes:
> 
>> Markus Gritsch <gritsch@iue.tuwien.ac.at> writes:
>>
>>> Hi,
>>>
>>> I would like to use a bar cursor, instead of a block cursor.
>>> (setq default-frame-alist '((cursor-type . (bar . 2))))
>>>
>>> The problem is, that the bar cursor is drawn like a block cursor, only 
>>> using a smaller width. To really be usable, the bar cursor should be 
>>> drawn *between* the characters, e.g. shifting it width/2 pixels to the left.
>>>
>>> On the attached Emacs.png the 'u' is partially hiden by the bar-cursor. 
>>>  It is even worse when the cursor is placed at the 'i', in which case 
>>> the letter is hidden completely.  The attachment SciTE.png shows a 
>>> screenshot of the OpenSource Scintilla text editing widget, which shifts 
>>> a 2 pixel wide bar-cursor one pixel to the left.
>>>
>>> Kind regards,
>>> Markus
>>>
>> I'm using Emacs 22.0.50 on cygwin (windows xp), and the bar cursor does not
>> hide the letter 'i', as it is moved a tad to the left.
> 
> Oops, sorry.  I'm using Emacs 22.0.50 on linux (mandriva le 2005), and the bar
> cursor does not hide the letter 'i' ....

Could you please provide screenshots?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-07 15:03 cursor-type as bar Markus Gritsch
  2006-03-07 19:11 ` J. David Boyd
@ 2006-03-11 22:06 ` Juri Linkov
  2006-03-12  9:45   ` Markus Gritsch
  2006-03-12 12:47   ` Richard Stallman
  1 sibling, 2 replies; 12+ messages in thread
From: Juri Linkov @ 2006-03-11 22:06 UTC (permalink / raw)
  Cc: emacs-devel

> I would like to use a bar cursor, instead of a block cursor.
> (setq default-frame-alist '((cursor-type . (bar . 2))))

I use the same cursor type and have the same problem.

> The problem is, that the bar cursor is drawn like a block cursor, only
> using a smaller width.

Actually, the way currently the bar cursor is drawn is worse than drawing
the block cursor.  The block cursor inverts the colors of the underlying
character, but the bar cursor partially or completely overlaps it.

> To really be usable, the bar cursor should be drawn *between* the
> characters, e.g. shifting it width/2 pixels to the left.

I agree this would be much better, but what to do if the distance between
the characters in pixels is less than the width of the bar cursor?
It seems overlapping is unavoidable.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-11 22:06 ` Juri Linkov
@ 2006-03-12  9:45   ` Markus Gritsch
  2006-03-12 12:47   ` Richard Stallman
  1 sibling, 0 replies; 12+ messages in thread
From: Markus Gritsch @ 2006-03-12  9:45 UTC (permalink / raw)
  Cc: emacs-devel

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

Juri Linkov wrote:
>>I would like to use a bar cursor, instead of a block cursor.
>>(setq default-frame-alist '((cursor-type . (bar . 2))))
> 
> I use the same cursor type and have the same problem.
> 
>>The problem is, that the bar cursor is drawn like a block cursor, only
>>using a smaller width.
> 
> Actually, the way currently the bar cursor is drawn is worse than drawing
> the block cursor.  The block cursor inverts the colors of the underlying
> character, but the bar cursor partially or completely overlaps it.
> 
>>To really be usable, the bar cursor should be drawn *between* the
>>characters, e.g. shifting it width/2 pixels to the left.
> 
> I agree this would be much better, but what to do if the distance between
> the characters in pixels is less than the width of the bar cursor?
> It seems overlapping is unavoidable.

Yes, I agree.  Even when shifting the cursor so that it is located 
between the characters there will be some overlaping in certain cases. 
However, I would not invert the colors of the underlying character.

I tried to find the location where the cursor is drawn, and made the 
following experimental change, where the cursor is shifted by a 
hardcoded value of 1 to the left.

--- w32term_orig.c      2006-03-12 10:17:44.019393600 +0100
+++ w32term.c   2006-03-09 20:20:07.546683200 +0100
@@ -5021,7 +5021,7 @@

        if (kind == BAR_CURSOR)
         {
-         w32_fill_area (f, hdc, cursor_color, x,
+         w32_fill_area (f, hdc, cursor_color, x - 1,
                          WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
                          width, row->height);
         }

The problem is, that when moving the cursor, both caracters, left and 
right of the caret must be repainted.  Currently only the character 
where the cursor was before moving it gets updated.  The result can be 
seen in the attachment.  Unfortunately I was not able to find out, how 
to redraw also the character before the one which gets already repainted.

Kind regards,
Markus

[-- Attachment #2: shiftedLeft.png --]
[-- Type: image/png, Size: 5323 bytes --]

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-11 22:06 ` Juri Linkov
  2006-03-12  9:45   ` Markus Gritsch
@ 2006-03-12 12:47   ` Richard Stallman
  2006-04-12  7:22     ` Markus Gritsch
  1 sibling, 1 reply; 12+ messages in thread
From: Richard Stallman @ 2006-03-12 12:47 UTC (permalink / raw)
  Cc: gritsch, emacs-devel

    > To really be usable, the bar cursor should be drawn *between* the
    > characters, e.g. shifting it width/2 pixels to the left.

    I agree this would be much better, but what to do if the distance between
    the characters in pixels is less than the width of the bar cursor?

I thought the bar cursor WAS drawn between the characters.
If that is not the case, it is a bug--would someone please fix it?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-03-12 12:47   ` Richard Stallman
@ 2006-04-12  7:22     ` Markus Gritsch
  2006-04-12 22:32       ` Kim F. Storm
  0 siblings, 1 reply; 12+ messages in thread
From: Markus Gritsch @ 2006-04-12  7:22 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel

Richard Stallman wrote:
>     To really be usable, the bar cursor should be drawn *between* the
>     characters, e.g. shifting it width/2 pixels to the left.
> 
> I thought the bar cursor WAS drawn between the characters.
> If that is not the case, it is a bug--would someone please fix it?

Just being curious: Is there any progress with this issue?

Kind regards,
Markus

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-04-12  7:22     ` Markus Gritsch
@ 2006-04-12 22:32       ` Kim F. Storm
  2006-04-13 16:38         ` Richard Stallman
  0 siblings, 1 reply; 12+ messages in thread
From: Kim F. Storm @ 2006-04-12 22:32 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel

Markus Gritsch <gritsch@iue.tuwien.ac.at> writes:

> Richard Stallman wrote:
>>     To really be usable, the bar cursor should be drawn *between* the
>>     characters, e.g. shifting it width/2 pixels to the left.
>> I thought the bar cursor WAS drawn between the characters.
>> If that is not the case, it is a bug--would someone please fix it?
>
> Just being curious: Is there any progress with this issue?

I looked at it briefly.

The problem is that the current code expects the cursor to be drawn
inside a single "character cell".  Consequently, to distribute a bar
cursor of width > 1 evenly between two cells requires non-trivial
changes to the redisplay code (and the changes must be made to each of
the X, w32, mac ports).

IMO, we shall not do anything about it before the release.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2006-04-12 22:32       ` Kim F. Storm
@ 2006-04-13 16:38         ` Richard Stallman
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Stallman @ 2006-04-13 16:38 UTC (permalink / raw)
  Cc: juri, gritsch, emacs-devel

    The problem is that the current code expects the cursor to be drawn
    inside a single "character cell".  Consequently, to distribute a bar
    cursor of width > 1 evenly between two cells requires non-trivial
    changes to the redisplay code (and the changes must be made to each of
    the X, w32, mac ports).

    IMO, we shall not do anything about it before the release.

I agree, but could you please add a TODO item?
This is a serious drawback to the bar cursor.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
@ 2007-10-17 15:18 Markus Gritsch
  2007-10-18  5:02 ` Richard Stallman
  0 siblings, 1 reply; 12+ messages in thread
From: Markus Gritsch @ 2007-10-17 15:18 UTC (permalink / raw)
  To: Kim F. Storm, emacs-devel

Kim F. Storm writes:
> Markus Gritsch <address@hidden> writes:
>
> > Richard Stallman wrote:
> >>     To really be usable, the bar cursor should be drawn *between* the
> >>     characters, e.g. shifting it width/2 pixels to the left.
> >> I thought the bar cursor WAS drawn between the characters.
> >> If that is not the case, it is a bug--would someone please fix it?
> >
> > Just being curious: Is there any progress with this issue?
>
> I looked at it briefly.
>
> The problem is that the current code expects the cursor to be drawn
> inside a single "character cell".  Consequently, to distribute a bar
> cursor of width > 1 evenly between two cells requires non-trivial
> changes to the redisplay code (and the changes must be made to each of
> the X, w32, mac ports).
>
> IMO, we shall not do anything about it before the release.

Now since the release is over, is there any chance this gets fixed?  I
tried looking at the code in xdisp.c and w32term.c, but since I am no
C programmer, I am not able to do something useful there myself :/

Kind regards,
Markus

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cursor-type as bar
  2007-10-17 15:18 Markus Gritsch
@ 2007-10-18  5:02 ` Richard Stallman
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Stallman @ 2007-10-18  5:02 UTC (permalink / raw)
  To: Markus Gritsch; +Cc: emacs-devel, storm

    Now since the release is over, is there any chance this gets fixed?  I
    tried looking at the code in xdisp.c and w32term.c, but since I am no
    C programmer, I am not able to do something useful there myself :/

I would be glad to see someone work on putting the bar cursor in between
characters.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-10-18  5:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-07 15:03 cursor-type as bar Markus Gritsch
2006-03-07 19:11 ` J. David Boyd
2006-03-07 20:46   ` J. David Boyd
2006-03-08  6:33     ` Markus Gritsch
2006-03-11 22:06 ` Juri Linkov
2006-03-12  9:45   ` Markus Gritsch
2006-03-12 12:47   ` Richard Stallman
2006-04-12  7:22     ` Markus Gritsch
2006-04-12 22:32       ` Kim F. Storm
2006-04-13 16:38         ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-10-17 15:18 Markus Gritsch
2007-10-18  5:02 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).