From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: mouse cursor on modeline Date: Mon, 25 Jun 2007 11:41:59 +0900 (JST) Message-ID: <20070625.114159.103113663.jet@gyve.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1182739338 809 80.91.229.12 (25 Jun 2007 02:42:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2007 02:42:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 25 04:42:16 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I2eWt-0000L6-LP for ged-emacs-devel@m.gmane.org; Mon, 25 Jun 2007 04:42:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2eWt-0000em-0C for ged-emacs-devel@m.gmane.org; Sun, 24 Jun 2007 22:42:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2eWp-0000eh-Cl for emacs-devel@gnu.org; Sun, 24 Jun 2007 22:42:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2eWn-0000eV-SW for emacs-devel@gnu.org; Sun, 24 Jun 2007 22:42:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2eWn-0000eS-MU for emacs-devel@gnu.org; Sun, 24 Jun 2007 22:42:09 -0400 Original-Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I2eWn-0000LD-7d for emacs-devel@gnu.org; Sun, 24 Jun 2007 22:42:09 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l5P2g2sk028935 for ; Sun, 24 Jun 2007 22:42:02 -0400 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l5P2g1rh009925 for ; Sun, 24 Jun 2007 22:42:02 -0400 Original-Received: from localhost (gps06.tokyo.redhat.com [172.16.32.89]) by pobox.tokyo.redhat.com (8.12.11.20060308/8.12.8) with ESMTP id l5P2fx8M020838 for ; Mon, 25 Jun 2007 11:42:00 +0900 X-Mailer: Mew version 5.2 on Emacs 22.1.50 / Mule 5.0 (SAKAKI) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:73788 Archived-At: 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 * 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; } }