all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mouse cursor on modeline
@ 2007-06-25  2:41 Masatake YAMATO
  2007-06-25  4:37 ` Nick Roberts
  2007-07-01 20:40 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Masatake YAMATO @ 2007-06-25  2:41 UTC (permalink / raw)
  To: emacs-devel

Hi, I've tried to fix a bug reported in two years ago.

In http://lists.gnu.org/archive/html/emacs-devel/2005-05/msg01306.html Luc Teirlinck 
wrote the way how to reproduce the bug interactively.

> Nick Roberts wrote:
> 
>     > But shouldn't the cursor change to a hand cursor rather than an arrow
>     > cursor when hoovering over a mouse-face?
> 
>    Following the change, if you have just line-number-mode on ,then the arrow
>    pointer still displays over this area (I think this may be an existing
>    bug not an introduced one).
> 
> You mean the fact that if you start on the line number, where a double
> arrow is displayed, then move slightly to the right, it changes into a
> single sided slanted arrow for a short distance before turning into a
> double sided arrow again?  That behavior is already present in an old
> CVS version from February 7 I still have around.



In http://lists.gnu.org/archive/html/emacs-devel/2005-05/msg01313.html I wrote
the way how to reproduce the bug rather non-interactively.

>    (pp (format-mode-line mode-line-position))
>    #("All L6   " 0 3
>      (help-echo "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
>      3 5
>      (help-echo "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
>      5 6
>      (help-echo "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
>      6 9 nil)
>
> "6 9 nil" becomes the hole.
> I'll take more time about this issue.

Could you review and test this patch?

Regards,
Masatake YAMATO


2007-06-25  Masatake YAMATO  <jet@gyve.org>

	* xdisp.c (display_mode_element): Pass `props' to `store_mode_line_string'.
	Fill glyph's object field to inherit `props' from elt after calling 
	display_string.

--- xdisp.c	22  6月 2007 03:20:51 +0900	1.1156
+++ xdisp.c	25  6月 2007 11:21:07 +0900	
@@ -17190,11 +17190,33 @@
 	  n += store_mode_line_noprop ("", field_width - n, 0);
 	  break;
 	case MODE_LINE_STRING:
-	  n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil);
+	  n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, props);
 	  break;
 	case MODE_LINE_DISPLAY:
-	  n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n,
-			       0, 0, 0);
+	  {
+	    int nglyphs_before, nwritten;
+	    nglyphs_before = it->glyph_row->used[TEXT_AREA];
+	    nwritten = display_string ("", Qnil, Qnil, 0, 0, it, field_width - n,
+				       0, 0, 0);
+
+	    /* Fill glyph's object field to inherit `props' from elt. */
+	    if (nwritten > 0)
+	      {
+		struct glyph *glyph
+		  = (it->glyph_row->glyphs[TEXT_AREA]
+		     + nglyphs_before);
+		int i;
+		int charpos = 0;
+
+
+		for (i = 0; i < nwritten; ++i)
+		  {
+		    glyph[i].object = elt;
+		    glyph[i].charpos = charpos;
+		  }
+		n += nwritten;
+	      }
+	  }
 	  break;
 	}
     }

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

* Re: mouse cursor on modeline
  2007-06-25  2:41 mouse cursor on modeline Masatake YAMATO
@ 2007-06-25  4:37 ` Nick Roberts
  2007-07-01 20:40 ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Roberts @ 2007-06-25  4:37 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: emacs-devel

 > Could you review and test this patch?

I've tested it and it certainly seems to do the right thing.

As an aside I use the line number in the mode line as a button for goto-line
and this patch widens the button (which is fine).

-- 
Nick                                           http://www.inet.net.nz/~nickrob

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

* Re: mouse cursor on modeline
  2007-06-25  2:41 mouse cursor on modeline Masatake YAMATO
  2007-06-25  4:37 ` Nick Roberts
@ 2007-07-01 20:40 ` Richard Stallman
  2007-07-09  9:44   ` Masatake YAMATO
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-07-01 20:40 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: emacs-devel

I have been looking at this patch, and I wonder whether ELT
is the right thing to use here:

+		for (i = 0; i < nwritten; ++i)
+		  {
+		    glyph[i].object = elt;
+		    glyph[i].charpos = charpos;
+		  }
+		n += nwritten;

Is that right in all cases, for each of the possible types of ELT?

If it is right in each case, then you need a comment to explain,
for each type, why this code is correct.

Aside from that, I have a feeling that the code could be written
more simply.

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

* Re: mouse cursor on modeline
  2007-07-01 20:40 ` Richard Stallman
@ 2007-07-09  9:44   ` Masatake YAMATO
  0 siblings, 0 replies; 4+ messages in thread
From: Masatake YAMATO @ 2007-07-09  9:44 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

> I have been looking at this patch, and I wonder whether ELT
> is the right thing to use here:
> 
> +		for (i = 0; i < nwritten; ++i)
> +		  {
> +		    glyph[i].object = elt;
> +		    glyph[i].charpos = charpos;
> +		  }
> +		n += nwritten;
> 
> Is that right in all cases, for each of the possible types of ELT?
> 
> If it is right in each case, then you need a comment to explain,
> for each type, why this code is correct.
> 
> Aside from that, I have a feeling that the code could be written
> more simply.

Thank you for reviwing. I'll revise my patch.

Masatake YAMATO

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

end of thread, other threads:[~2007-07-09  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-25  2:41 mouse cursor on modeline Masatake YAMATO
2007-06-25  4:37 ` Nick Roberts
2007-07-01 20:40 ` Richard Stallman
2007-07-09  9:44   ` Masatake YAMATO

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.