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; 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
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 ( [])
	by (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 ([]:49213)
	by 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 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 ([]:62196)
	by 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 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;; s=gamma;
DomainKey-Signature: a=rsa-sha1; c=nofws;; s=gamma;
Received: by with SMTP id o8mr4252124qaq.227.1257786644309;
        Mon, 09 Nov 2009 09:10:44 -0800 (PST)
Received: from (SCARLETT.PSY.CMU.EDU [])
        by with ESMTPS id 23sm592242qyk.7.2009.
        (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 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.


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  

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 (i386-apple-darwin10.0.0, NS apple- 
  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  

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>

Recent messages:
Mark set

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


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

Making completion list...
Quit [2 times]

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.