unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4426: 23.0.91; posn-at-point returns an incorrect value
@ 2009-09-14  9:18 IRIE Shinsuke
  2010-03-17  4:01 ` bug#4426: [PATCH] " IRIE Shinsuke
  0 siblings, 1 reply; 5+ messages in thread
From: IRIE Shinsuke @ 2009-09-14  9:18 UTC (permalink / raw)
  To: bug-gnu-emacs

I was going to acquire the width and height of a character the cursor
is over, by using the following code:

  (posn-object-width-height (posn-at-point))

However, I found that this code gives back a wrong result when a
header line is displayed such as tabbar-mode. This code returns the
size of another character, which is in the position different from the
exact one in the number of objects included in the header line.
For example, when the cursor is in the top left corner of the window,
the size of the object in the left end of the header line is obtained.

Steps to reproduce:

  1. Turn on tabbar-mode.

  2. Evaluate the following expressions in *scratch*:

       (defun char-w-h ()
         (message "%s" (posn-object-width-height (posn-at-point))))
       (add-hook 'post-command-hook 'char-w-h)

  3. Move a cursor from place to place in the window.


In GNU Emacs 23.0.91.1 (i486-pc-linux-gnu, GTK+ Version 2.16.0)
 of 2009-04-05 on palmer, modified by Debian
 (emacs-snapshot package, version 1:20090320-1ubuntu1)
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--build' 'i486-linux-gnu' '--host'
'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--localstatedir=/var'
'--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.91/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.91/site-lisp:/usr/share/emacs/site-lisp'
'--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu'
'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN
-DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed'
'CPPFLAGS=''

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: ja_JP.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tabbar-mwheel-mode: t
  tabbar-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-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:
u i r e SPC ' t C-p C-p C-p C-p C-p C-p C-p C-n C-n
C-n C-n C-n C-f C-f C-f C-f C-f C-f C-f C-f C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-n
C-n C-e a b b a r ) C-j ( t a b b a r - m o d e ) C-j
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-n C-p C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f
C-f C-f C-f C-f C-f C-n C-p C-p C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-n C-n C-n
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-n
C-n C-p C-p C-p C-p C-p C-n C-n C-b C-p C-p C-n C-a
C-f C-f C-f C-f C-f C-f C-p C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-a C-a C-f C-f C-f
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n ( r e m o v
e - h o o k SPC ' p o s t - c o m m a n d - h o o k
SPC ' c h a r - w - h ) C-j M-x r e p o r t - e m a
<tab> RET

Recent messages:
(7 . 14) [3 times]
(0 . 14)
(7 . 14)
(0 . 14)
(7 . 14)
(0 . 14)
(7 . 14)
(0 . 14)
(7 . 14) [3 times]
(0 . 14) [41 times]

-- 
IRIE Shinsuke, Ph.D.
irieshinsuke@yahoo.co.jp






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-08 11:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14  9:18 bug#4426: 23.0.91; posn-at-point returns an incorrect value IRIE Shinsuke
2010-03-17  4:01 ` bug#4426: [PATCH] " IRIE Shinsuke
2011-09-18  8:21   ` Lars Magne Ingebrigtsen
2011-09-18  9:22     ` Eli Zaretskii
2011-10-08 11:01     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).