GNU bug report logs - #4893
ns-face-at-pos incorrect

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: David Reitter <david.reitter@HIDDEN>; dated Mon, 9 Nov 2009 17:20:37 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug reassigned from package 'ns' to 'emacs,ns'. Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 9 Nov 2009 17:10:49 +0000
From david.reitter@HIDDEN Mon Nov  9 09:10:48 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,FOURLA,HAS_PACKAGE,
	IMPRONONCABLE_2 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA9HAkZg006477
	for <submit@HIDDEN>; Mon, 9 Nov 2009 09:10:48 -0800
Received: from mx10.gnu.org ([199.232.76.166]:49213)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <david.reitter@HIDDEN>)
	id 1N7XlO-0003Ju-Ck
	for emacs-pretest-bug@HIDDEN; Mon, 09 Nov 2009 12:10:46 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <david.reitter@HIDDEN>)
	id 1N7XlM-0002a7-R9
	for emacs-pretest-bug@HIDDEN; Mon, 09 Nov 2009 12:10:45 -0500
Received: from qw-out-1920.google.com ([74.125.92.144]:62196)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <david.reitter@HIDDEN>)
	id 1N7XlM-0002UV-Fi
	for emacs-pretest-bug@HIDDEN; Mon, 09 Nov 2009 12:10:44 -0500
Received: by qw-out-1920.google.com with SMTP id 5so637591qwc.24
        for <emacs-pretest-bug@HIDDEN>; Mon, 09 Nov 2009 09:10:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:content-type
         :content-transfer-encoding:subject:date:message-id:to:mime-version
         :x-mailer;
        bh=owiZSAUh0rfXHyF+RgFCJS1et6OoZINWoER5T9CiWPw=;
        b=bSOQM7UE5jMnUZrcej9h3g3esm+CHUMFs/1NwrPGNsVEo158m0on8qR2BpTjU2YDSk
         EIRRDyNeUjDOu10Hz1axo+vRuYI5PUcIYPdGrPgvq2BP3I1JulOdUXpuWQuseLKMXIyR
         dyaDKqgFmw56igECKKIAqyEg5OFvHpTtkXem4=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:content-type:content-transfer-encoding:subject:date:message-id
         :to:mime-version:x-mailer;
        b=QwEV2DfZFGJnZUPr5S6W0NngumCLgsp3YVgAsnybHaVk/H+a9axSeiE7/qLJ6orQzV
         YEc16+LwC50mW+cCxHzntEzz2WEVTU9YeA202pnMi9mFD73jzvPYzhCVfZriCjFOpTkA
         W7Ahse36boMxRGliG500uUo+7rbdThrn1LzSg=
Received: by 10.224.117.8 with SMTP id o8mr4252124qaq.227.1257786644309;
        Mon, 09 Nov 2009 09:10:44 -0800 (PST)
Received: from scarlett.psy.cmu.edu (SCARLETT.PSY.CMU.EDU [128.2.249.106])
        by mx.google.com with ESMTPS id 23sm592242qyk.7.2009.11.09.09.10.42
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Mon, 09 Nov 2009 09:10:43 -0800 (PST)
From: David Reitter <david.reitter@HIDDEN>
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Subject: ns-face-at-pos incorrect
Date: Mon, 9 Nov 2009 12:10:42 -0500
Message-Id: <6D35D2BC-E50F-4EBF-8FA3-FDDFC51E5479@HIDDEN>
To: emacs-pretest-bug@HIDDEN
Mime-Version: 1.0 (Apple Message framework v1076)
X-Mailer: Apple Mail (2.1076)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)

Package: ns

When I drag&drop a color from the NS color panel into a window, it  
doesn't always determine the correct face, especially further down  
(vertically) in the window.

There are several bugs in mouse-position in compute-motion, which I  
have reported separately.

NS-specific:

1. ns-face-at-pos calls `compute-motion' using (- (window-width  
window) 1) as width parameter.  Should it be nil?   I suspect (but  
haven't tried) that this may cause less problems when using variable- 
width fonts.

2. Calling compute-motion with the results of mouse-position in `ns- 
face-at-pos' makes faulty assumptions when there is a header line.    
As a consequence, we end up in the wrong spot.  I don't see an easy  
fix, since we can't make assumptions about the height of the header  
line.

As for `ns-set-foreground-at-mouse'&co , would it be sensible to give  
the ns-drag-color event (and friends) proper event parameters and then  
use (mouse-posn-property (event-end event))?  This seems cleaner to me.

[I hope these are sufficiently specific to understand and identify the  
code, if not reproduce.  Let me know if not, and I can file separate  
bug reports.]





In GNU Emacs 23.1.50.1 (i386-apple-darwin10.0.0, NS apple- 
appkit-1038.11)
  of 2009-10-08 on scarlett.local
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns' '--without-x' 'CC=gcc -arch  
i386''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: nil
   value of $XMODIFIERS: nil
   locale-coding-system: nil
   default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
   which-function-mode: t
   tooltip-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
<help-echo> C-x 5 2 <help-echo> <switch-frame> <help-echo>
<help-echo> <escape> : ( m o u s e - p o s i t i o
n ) <return> <help-echo> <down-mouse-1> <help-echo>
<mouse-1> <help-echo> <down-mouse-1> <mouse-1> <help-echo>
<down-mouse-1> <mouse-1> <help-echo> <escape> : <up>
<return> <help-echo> <help-echo> <switch-frame> <help-echo>
<help-echo> <help-echo> <escape> : <up> <return> <help-echo>
<down-mouse-1> <help-echo> <mouse-1> <help-echo> <down-mouse-1>
<mouse-1> <help-echo> <down-mouse-1> <mouse-1> <escape>
: <up> <return> <help-echo> <down-mouse-1> <mouse-1>
s-n C-x k <return> s-v C-x C-e <switch-frame> C-x C-f
<backspace> <backspace> t e s t <return> <help-echo>
C-y <down-mouse-1> <mouse-1> <escape> x n s - s h o
w - c o l o <tab> <return> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> c o l o <tab> <return> <ns-drag-color>
<ns-drag-color> <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> <down-mouse-1> <mouse-1> <escape> x e n l
a r <tab> <tab> C-g <escape> x z o o m <tab> <tab>
C-g <escape> x g r o w <tab> <tab> C-g <menu-bar> <help-menu>
<send-emacs-bug-report>

Recent messages:
Mark set

#<frame /Users/dr/test 0x7d5900>

Auto-saving...

#<frame /Users/dr/test 0x7d5900>

Making completion list...
Quit [2 times]
Quit

Load-path shadows:
None found.



Acknowledgement sent to David Reitter <david.reitter@HIDDEN>:
New bug report received and forwarded. Copy sent to owner@HIDDEN. Full text available.
Report forwarded to bug-submit-list@HIDDEN, owner@HIDDEN:
bug#4893; Package ns. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.