GNU bug report logs - #17181
24.4.50; previous-single-property-change: odd behavior

Previous Next

Package: emacs;

Reported by: raman <at> google.com (T.V Raman)

Date: Fri, 4 Apr 2014 00:49:01 UTC

Severity: normal

Tags: notabug

Found in version 24.4.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #12 received at 17181-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: raman <at> google.com (T.V Raman)
Cc: 17181-done <at> debbugs.gnu.org
Subject: Re: bug#17181: 24.4.50; previous-single-property-change: odd behavior
Date: Thu, 03 Apr 2014 22:27:56 -0400
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




This bug report was last modified 11 years and 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.