From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Mouse highlighting and fonts Date: Mon, 26 May 2008 23:26:56 -0400 Message-ID: <87od6spgu7.fsf@stupidchicken.com> References: <878wy1giqs.fsf@stupidchicken.com> <87tzgog5kd.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1211858831 20011 80.91.229.12 (27 May 2008 03:27:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 May 2008 03:27:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 27 05:27:52 2008 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 1K0pqn-0008NB-CE for ged-emacs-devel@m.gmane.org; Tue, 27 May 2008 05:27:49 +0200 Original-Received: from localhost ([127.0.0.1]:43979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0pq2-0003TA-58 for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 23:27:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0ppx-0003Sr-LT for emacs-devel@gnu.org; Mon, 26 May 2008 23:26:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0ppx-0003Sf-5E for emacs-devel@gnu.org; Mon, 26 May 2008 23:26:57 -0400 Original-Received: from [199.232.76.173] (port=47079 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0ppx-0003Sc-04 for emacs-devel@gnu.org; Mon, 26 May 2008 23:26:57 -0400 Original-Received: from c-98-216-111-182.hsd1.ma.comcast.net ([98.216.111.182]:12992 helo=furry) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0ppw-0005kp-VD for emacs-devel@gnu.org; Mon, 26 May 2008 23:26:57 -0400 Original-Received: by furry (Postfix, from userid 1000) id 7BCF5C04D; Mon, 26 May 2008 23:26:56 -0400 (EDT) In-Reply-To: <87tzgog5kd.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 23 May 2008 15:53:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:97777 Archived-At: Chong Yidong writes: > BTW, another mouse-highlighting bug I reported earlier is still present. > Under certain circumstances, the area to the left and/or right of the > physical cursor doesn't acquire the proper mouse-face. > > This appears to be a long-standing bug, but one that didn't show up > until the new font code. That's because it arises as follows: when the > cursor glyph has a nonzero lbearing or rbearing (i.e., it overlaps with > its neighbors), the neighboring glyphs are redrawn, and this can > overwrite the mouse-face highlight. See xdisp.c:19934. This didn't > show up because previously, overlapping glyphs were generally not > encountered. > > I'll try to fix this once I get the time, unless someone else fixes it > first. I've checked in a rough fix into CVS. It turns out that fixing this properly is non-trivial, due to limitations in the way the glyph-drawing code. I think the fix handles most (all?) situations likely to happen in practice. It might lead to incorrect highlighting if a glyph's overhang is large enough to overlap two or more neighboring glyphs, and not all those glyphs are mouse-highlighted, but I can't find a test-case that demonstrates this. There is a remaining related bug: when the cursor falls inside a mouse-highlighted block, its foreground is sometimes drawn incorrectly. I think this is a bug elsewhere in the code, possibly related to the incorrect drawing of glyphs that I've noticed in other contexts unrelated to mouse highlighting. Currently I have no idea what causes this. Other than that, if anyone still has problems with mouse highlighting, please holler.