all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: raman@google.com (T.V Raman)
Cc: 17181-done@debbugs.gnu.org
Subject: bug#17181: 24.4.50; previous-single-property-change: odd behavior
Date: Thu, 03 Apr 2014 22:27:56 -0400	[thread overview]
Message-ID: <jwvwqf5ltl1.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <p91lhvlx6n3.fsf@lapdog.roam.corp.google.com> (T. V. Raman's message of "Thu, 03 Apr 2014 17:47:28 -0700")

tags 17181 notabug
thanks

> (put-text-property (point) (point-max) 'test t)
> Move point to the front of "bar" ie  point is at the beginning of the
> line.
> (get-text-property (point) 'test) returns T as expected.
> (point) evaluates to 6
> Consequently, I'd  expect 
> (previous-single-property-change (point) 'test) to return 5 
> instead you get: nil

Buffer positions are *between* characters.  `get-text-property' gets you
the value of the property on "the character after point".
`previous-single-property-change' gets you the nearest change on
*previous* characters.  The property above is nil between point-min and
point, so previous-single-property-change finds no change at all.

The off-by-one error is in your expectations :-(


        Stefan





  reply	other threads:[~2014-04-04  2:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  0:47 bug#17181: 24.4.50; previous-single-property-change: odd behavior T.V Raman
2014-04-04  2:27 ` Stefan Monnier [this message]
2014-04-04 15:18   ` T.V Raman

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=jwvwqf5ltl1.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=17181-done@debbugs.gnu.org \
    --cc=raman@google.com \
    /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.