all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: IRIE Shinsuke <irieshinsuke@yahoo.co.jp>
To: bug-gnu-emacs@gnu.org
Subject: bug#4426: 23.0.91; posn-at-point returns an incorrect value
Date: Mon, 14 Sep 2009 18:18:47 +0900	[thread overview]
Message-ID: <4AAE0A77.3010807@yahoo.co.jp> (raw)

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






             reply	other threads:[~2009-09-14  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14  9:18 IRIE Shinsuke [this message]
2010-03-17  4:01 ` bug#4426: [PATCH] posn-at-point returns an incorrect value IRIE Shinsuke
2011-09-18  8:21   ` Lars Magne Ingebrigtsen
2011-09-18  9:22     ` Eli Zaretskii
2011-10-08 11:01     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AAE0A77.3010807@yahoo.co.jp \
    --to=irieshinsuke@yahoo.co.jp \
    --cc=4426@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.