emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coord conversion: frame->column_width set wrong?


From: jbyler+emacs-lists
Subject: Re: coord conversion: frame->column_width set wrong?
Date: Mon, 02 Aug 2004 16:44:32 -0400

On Sun, 25 Jul 2004 12:49:14 +0200, "Jan D." <address@hidden> said:
> address@hidden wrote:
> 
> > Tests:
> > (coordinates-in-window-p '( 0 . 0) (selected-window))
> > should return: (0 . 0)
> > bug condition returns: nil
> > 
> > (window-at 0 0)
> > should return: #<window 3 on *scratch*> (or similar)
> > bug condition returns: nil
> > 
> > (coordinates-in-window-p '( 1 . 1) (selected-window))
> > should return: (1 . 1)
> > bug condition returns: (0.8571428571428571 . 0.9230769230769231)
> > 
> 
> 
> > Name changes:
> > coordinates-in-window-p uses the macro
> > PIXEL_X_FROM_CANON_X -> FRAME_PIXEL_X_FROM_CANON_X
> > which calls 
> > CANON_X_UNIT -> FRAME_COLUMN_WIDTH
> > 
> > On a window system, CANON_X_UNIT was a wrapper for
> > FRAME_DEFAULT_FONT_WIDTH, defined in xterm.h, macterm.h, and w32term.h. 
> > FRAME_DEFAULT_FONT_WIDTH no longer exists, and in its place,
> > FRAME_COLUMN_WIDTH simply reads the field column_width from the frame
> > data structure.  This value gets initialized to 1 in make_frame, but I
> > couldn't find a place where it gets set based on the font.  Perhaps it
> > isn't being set at all?
> 
> It is being set in xterm.c, x_new_font:
>    FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f));
> 
> The inconsistency seems to have another cause, see the thread
> "Fix `window-at' and `coordinates-in-window-p'"
> 
>       Jan D.


Thanks!  This problem has been fixed in current CVS emacs, and all my
tests for coordinates-in-window-p and window-at on a "naked" frame now
work as expected.  I tested on RedHat 9 with the default toolkit, also
with GTK (--with-x-toolkit=gtk), and finally with -nw.

-Jesse
-----

The information contained in this electronic mail
and any attached document is the confidential and
proprietary business information of Forum Systems,
Inc. It is intended solely for the addressed
recipient listed above. It may not be distributed
in any manner without the express written consent
of Forum Systems, Inc.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]