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: bug#129: Mouse highlighting fails for font sizes. Date: Thu, 10 Apr 2008 21:51:38 -0400 Message-ID: <871w5dw445.fsf@stupidchicken.com> References: <87lk3lh1de.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 1207878965 24165 80.91.229.12 (11 Apr 2008 01:56:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2008 01:56:05 +0000 (UTC) Cc: 129@emacsbugs.donarmstrong.com To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 11 03:56:37 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 1Jk8VF-00047y-OK for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2008 03:56:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jk8Ua-00015q-NN for ged-emacs-devel@m.gmane.org; Thu, 10 Apr 2008 21:55:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jk8US-00012t-S2 for emacs-devel@gnu.org; Thu, 10 Apr 2008 21:55:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jk8UL-0000zA-OA for emacs-devel@gnu.org; Thu, 10 Apr 2008 21:55:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jk8UL-0000z7-JZ for emacs-devel@gnu.org; Thu, 10 Apr 2008 21:55:37 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jk8UL-0002mz-HQ for emacs-devel@gnu.org; Thu, 10 Apr 2008 21:55:37 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 9565C4E3FC; Thu, 10 Apr 2008 21:51:38 -0400 (EDT) In-Reply-To: <87lk3lh1de.fsf@stupidchicken.com> (Chong Yidong's message of "Thu, 10 Apr 2008 16:59:57 -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:94925 Archived-At: Chong Yidong writes: > At some point, the Unicode-2 branch redisplay was changed to allow > mouse-highlighted text to have a different font size from the > unhighlighted characters. Unfortunately, this doesn't mesh well with > the existing code in note_mouse_highlight, which assumes the highlighted > glyphs overlap exactly with unhighlighted glyphs. > > (defface foo-face > '((t :height 1.5)) > "Face") > > (defface bar-face > '((t :height 1.0)) > "Face") > > (defun foo-test () > (interactive) > (switch-to-buffer "*Test*") > (erase-buffer) > (insert "Copying Conditions") > (put-text-property (point-min) (point-max) 'face 'foo-face) > (put-text-property (point-min) (point-max) 'mouse-face '(bar-face highlight))) After thinking some more, I think it's problematic to let mouse-highlighted text differ in size from the unhighlighted characters. Even if we fix the redisplay engine to correctly update the glyph row in such situations, there's the problem of how to decide when to perform highlighting. Consider a buffer containing the letters "A B" in a big font, which I schematically depict as -A- -B- Suppose the letter A has a mouse highlight face that contains a small font. So if we put the cursor over it, in the position marked ^, we see A -B- ^ Now, move the cursor slightly to the right, so that it moves off the highlighted A: A -B- ^ The highlighting disappears, and we see -A- -B- ^ But the mouse is now again on the letter A, which means we need to highlight! Is the benefit of allowing a different-sized mouse-face significant? If not, I propose imposing (or restoring) the restricting that only the foreground-color and background-color of the mouse-face takes effect; all other properties are ignored, and taken from the underlying face. What do you think?