unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: ata <alptekin.aker@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: posn-at-point and display properties
Date: Thu, 24 Feb 2011 01:14:45 -0800 (PST)	[thread overview]
Message-ID: <84e4aaf7-8cc7-4322-bb79-15527043b4be@o14g2000prb.googlegroups.com> (raw)

I believe this to be a bug, but I'm not certain, so I'm posting here
first.  For reference, I'm using 23.2.1 on MacOS.

When posn-at-point is called with an argument POS that's within a text
interval with a non-nil display property, the column it reports is the
column after whatever is displayed.  But (and this is what's confusing
me) it reports the same column for a POS at the start of such an
interval.  Thus, when the cursor is positioned immediately *before* a
display, posn-at-point will return a column for point that is at the
*end* of the display.

This can lead navigation commands to behave in unintuitive fashion.
For example, it will cause next-line to jump columns when line-move-
visual is non-nil. Evaluation of the following form illustrates the
problem:

(progn
  (goto-char 1)
  (insert "foo foo foo\n" "bar bar bar\n")
  (put-text-property 5 8 'display "XXX")
  (goto-char 5); point is now before XXX, in column 4
  (setq col1 (current-column))
  (setq line-move-visual t)
  (next-line); point is now on the next line, in column 7
  (setq col2 (current-column)))

col1
 => 4
col2
 => 7

The same problem arises with pos-visible-in-window-p, and seems
ultimately traceable to pos_visible_p from xdisp.c.

Is this behavior intended, or should I submit a bug report?


                 reply	other threads:[~2011-02-24  9:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=84e4aaf7-8cc7-4322-bb79-15527043b4be@o14g2000prb.googlegroups.com \
    --to=alptekin.aker@gmail.com \
    --cc=help-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.
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).