Subject: bug#17181: closed (Re: bug#17181: 24.4.50; previous-single-property-change: odd behavior)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 04 Apr 2014 02:29:06 +0000

Your bug report

#17181: 24.4.50; previous-single-property-change: odd behavior 

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
17181: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17181
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17181: 24.4.50; previous-single-property-change: odd behavior
From: Stefan Monnier <[email-masked]>
To: [email-masked] (T.V Raman)
Cc: [email-masked]
Date: Thu, 03 Apr 2014 22:27:56 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Subject: 24.4.50; previous-single-property-change: odd behavior
From: [email-masked] (T.V Raman)
To: [email-masked]
Date: Thu, 03 Apr 2014 17:47:28 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Function previous-single-property-change appears to have an odd bug, try
this in a new buffer:

M-x switch-to-buffer RET foo 
to create a  buffer in fundamental-mode.

Type 
foo RET
bar
Move to the beginning of the line with bar
Evaluate 
(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

get-text-property does show that there is no text-property 'test set at
positions 5, 4 etc -- 
previous-single-property-change behaves as I had expected if I evaluate
the same form with point on "a" 
ie it returns where the property changes from t to nil

It looks  like previous-single-property-change might have an off-by-one
bug in that it is examining property on preceding-char?

In GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2014-04-03 on lapdog
System Description:	Ubuntu 12.04.1 LTS

Configured using:
 `configure --prefix=/usr/local --without-compress-install'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  recentf-mode: t
  semantic-mode: t
  ido-everywhere: t
  display-time-mode: t
  jabber-activity-mode: t
  jabber-mode-line-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  dynamic-completion-mode: t
  shell-dirtrack-mode: t
  global-voice-lock-mode: t
  voice-lock-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  transient-mark-mode: t

Recent input:
C-e m ESC x a d SPC d e a TAB RET j a b b e r SPC r 
o TAB RET C-x C-j C-c C-e m C-e a C-x @ h s c d RET 
c d SPC / t m TAB RET C-x C-f b u g RET ESC < C-@ C-s 
G N U ESC m ESC m C-p C-@ ESC < C-x r s 1 C-x k RET 
C-x b f o o C-j C-e m c d RET C-x b f o o C-j ESC x 
f u n d TAB RET ESC < ESC x r e p o TAB t ESC DEL r 
e p o r t SPC e m TAB RET

Recent messages:
/tmp 
Mark activated
Copied 32 lines to register 1
Loading /home/raman/.recentf...done
Cleaning up the recentf list...done (0 removed)
Back to top level.
Loading voice-setup...done
~ 
Making completion list...
End of buffer 

Load-path shadows:
/home/raman/emacs/lisp/site-lisp/vm/lisp/tapestry hides /home/raman/emacs/lisp/emacspeak/lisp/tapestry
/home/raman/emacs/lisp/emacspeak/lisp/tetris hides /usr/local/share/emacs/24.4.50/lisp/play/tetris
/home/raman/.emacs.d/elpa/org-20140310/ob-octave hides /usr/local/share/emacs/24.4.50/lisp/org/ob-octave
/home/raman/.emacs.d/elpa/org-20140310/ob-python hides /usr/local/share/emacs/24.4.50/lisp/org/ob-python
/home/raman/.emacs.d/elpa/org-20140310/ob-ditaa hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ditaa
/home/raman/.emacs.d/elpa/org-20140310/org-element hides /usr/local/share/emacs/24.4.50/lisp/org/org-element
/home/raman/.emacs.d/elpa/org-20140310/ob-mscgen hides /usr/local/share/emacs/24.4.50/lisp/org/ob-mscgen
/home/raman/.emacs.d/elpa/org-20140310/org-list hides /usr/local/share/emacs/24.4.50/lisp/org/org-list
/home/raman/.emacs.d/elpa/org-20140310/ob-picolisp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-picolisp
/home/raman/.emacs.d/elpa/org-20140310/org-agenda hides /usr/local/share/emacs/24.4.50/lisp/org/org-agenda
/home/raman/.emacs.d/elpa/org-20140310/ob-emacs-lisp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-emacs-lisp
/home/raman/.emacs.d/elpa/org-20140310/org-pcomplete hides /usr/local/share/emacs/24.4.50/lisp/org/org-pcomplete
/home/raman/.emacs.d/elpa/org-20140310/ox-ascii hides /usr/local/share/emacs/24.4.50/lisp/org/ox-ascii
/home/raman/.emacs.d/elpa/org-20140310/ob-haskell hides /usr/local/share/emacs/24.4.50/lisp/org/ob-haskell
/home/raman/.emacs.d/elpa/org-20140310/ob-fortran hides /usr/local/share/emacs/24.4.50/lisp/org/ob-fortran
/home/raman/.emacs.d/elpa/org-20140310/ob-org hides /usr/local/share/emacs/24.4.50/lisp/org/ob-org
/home/raman/.emacs.d/elpa/org-20140310/org-compat hides /usr/local/share/emacs/24.4.50/lisp/org/org-compat
/home/raman/.emacs.d/elpa/org-20140310/ob-sql hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sql
/home/raman/.emacs.d/elpa/org-20140310/org-w3m hides /usr/local/share/emacs/24.4.50/lisp/org/org-w3m
/home/raman/.emacs.d/elpa/org-20140310/org-bibtex hides /usr/local/share/emacs/24.4.50/lisp/org/org-bibtex
/home/raman/.emacs.d/elpa/org-20140310/ob-plantuml hides /usr/local/share/emacs/24.4.50/lisp/org/ob-plantuml
/home/raman/.emacs.d/elpa/org-20140310/ob-maxima hides /usr/local/share/emacs/24.4.50/lisp/org/ob-maxima
/home/raman/.emacs.d/elpa/org-20140310/org-ctags hides /usr/local/share/emacs/24.4.50/lisp/org/org-ctags
/home/raman/.emacs.d/elpa/org-20140310/org-habit hides /usr/local/share/emacs/24.4.50/lisp/org/org-habit
/home/raman/.emacs.d/elpa/org-20140310/org-inlinetask hides /usr/local/share/emacs/24.4.50/lisp/org/org-inlinetask
/home/raman/.emacs.d/elpa/org-20140310/org-footnote hides /usr/local/share/emacs/24.4.50/lisp/org/org-footnote
/home/raman/.emacs.d/elpa/org-20140310/ob-eval hides /usr/local/share/emacs/24.4.50/lisp/org/ob-eval
/home/raman/.emacs.d/elpa/org-20140310/org-datetree hides /usr/local/share/emacs/24.4.50/lisp/org/org-datetree
/home/raman/.emacs.d/elpa/org-20140310/ob-C hides /usr/local/share/emacs/24.4.50/lisp/org/ob-C
/home/raman/.emacs.d/elpa/org-20140310/ob-core hides /usr/local/share/emacs/24.4.50/lisp/org/ob-core
/home/raman/.emacs.d/elpa/org-20140310/org-plot hides /usr/local/share/emacs/24.4.50/lisp/org/org-plot
/home/raman/.emacs.d/elpa/org-20140310/ob-lob hides /usr/local/share/emacs/24.4.50/lisp/org/ob-lob
/home/raman/.emacs.d/elpa/org-20140310/ob-clojure hides /usr/local/share/emacs/24.4.50/lisp/org/ob-clojure
/home/raman/.emacs.d/elpa/org-20140310/org-archive hides /usr/local/share/emacs/24.4.50/lisp/org/org-archive
/home/raman/.emacs.d/elpa/org-20140310/org-crypt hides /usr/local/share/emacs/24.4.50/lisp/org/org-crypt
/home/raman/.emacs.d/elpa/org-20140310/ob-R hides /usr/local/share/emacs/24.4.50/lisp/org/ob-R
/home/raman/.emacs.d/elpa/org-20140310/ob-ref hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ref
/home/raman/.emacs.d/elpa/org-20140310/ob-sh hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sh
/home/raman/.emacs.d/elpa/org-20140310/ob-screen hides /usr/local/share/emacs/24.4.50/lisp/org/ob-screen
/home/raman/.emacs.d/elpa/org-20140310/ob-ledger hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ledger
/home/raman/.emacs.d/elpa/org-20140310/org-eshell hides /usr/local/share/emacs/24.4.50/lisp/org/org-eshell
/home/raman/.emacs.d/elpa/org-20140310/org-table hides /usr/local/share/emacs/24.4.50/lisp/org/org-table
/home/raman/.emacs.d/elpa/org-20140310/org-info hides /usr/local/share/emacs/24.4.50/lisp/org/org-info
/home/raman/.emacs.d/elpa/org-20140310/ox-icalendar hides /usr/local/share/emacs/24.4.50/lisp/org/ox-icalendar
/home/raman/.emacs.d/elpa/org-20140310/org-faces hides /usr/local/share/emacs/24.4.50/lisp/org/org-faces
/home/raman/.emacs.d/elpa/org-20140310/org-loaddefs hides /usr/local/share/emacs/24.4.50/lisp/org/org-loaddefs
/home/raman/.emacs.d/elpa/org-20140310/ox-publish hides /usr/local/share/emacs/24.4.50/lisp/org/ox-publish
/home/raman/.emacs.d/elpa/org-20140310/org-attach hides /usr/local/share/emacs/24.4.50/lisp/org/org-attach
/home/raman/.emacs.d/elpa/org-20140310/ob-asymptote hides /usr/local/share/emacs/24.4.50/lisp/org/ob-asymptote
/home/raman/.emacs.d/elpa/org-20140310/ox-latex hides /usr/local/share/emacs/24.4.50/lisp/org/ox-latex
/home/raman/.emacs.d/elpa/org-20140310/ob-matlab hides /usr/local/share/emacs/24.4.50/lisp/org/ob-matlab
/home/raman/.emacs.d/elpa/org-20140310/ox-odt hides /usr/local/share/emacs/24.4.50/lisp/org/ox-odt
/home/raman/.emacs.d/elpa/org-20140310/ob-perl hides /usr/local/share/emacs/24.4.50/lisp/org/ob-perl
/home/raman/.emacs.d/elpa/org-20140310/ob-shen hides /usr/local/share/emacs/24.4.50/lisp/org/ob-shen
/home/raman/.emacs.d/elpa/org-20140310/ox-man hides /usr/local/share/emacs/24.4.50/lisp/org/ox-man
/home/raman/.emacs.d/elpa/org-20140310/ob-gnuplot hides /usr/local/share/emacs/24.4.50/lisp/org/ob-gnuplot
/home/raman/.emacs.d/elpa/org-20140310/ox-md hides /usr/local/share/emacs/24.4.50/lisp/org/ox-md
/home/raman/.emacs.d/elpa/org-20140310/ox-html hides /usr/local/share/emacs/24.4.50/lisp/org/ox-html
/home/raman/.emacs.d/elpa/org-20140310/ob-tangle hides /usr/local/share/emacs/24.4.50/lisp/org/ob-tangle
/home/raman/.emacs.d/elpa/org-20140310/ob-lilypond hides /usr/local/share/emacs/24.4.50/lisp/org/ob-lilypond
/home/raman/.emacs.d/elpa/org-20140310/ob-sass hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sass
/home/raman/.emacs.d/elpa/org-20140310/org-docview hides /usr/local/share/emacs/24.4.50/lisp/org/org-docview
/home/raman/.emacs.d/elpa/org-20140310/org-clock hides /usr/local/share/emacs/24.4.50/lisp/org/org-clock
/home/raman/.emacs.d/elpa/org-20140310/ox hides /usr/local/share/emacs/24.4.50/lisp/org/ox
/home/raman/.emacs.d/elpa/org-20140310/ob-js hides /usr/local/share/emacs/24.4.50/lisp/org/ob-js
/home/raman/.emacs.d/elpa/org-20140310/org-irc hides /usr/local/share/emacs/24.4.50/lisp/org/org-irc
/home/raman/.emacs.d/elpa/org-20140310/org-mhe hides /usr/local/share/emacs/24.4.50/lisp/org/org-mhe
/home/raman/.emacs.d/elpa/org-20140310/ob-exp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-exp
/home/raman/.emacs.d/elpa/org-20140310/org-entities hides /usr/local/share/emacs/24.4.50/lisp/org/org-entities
/home/raman/.emacs.d/elpa/org-20140310/ob-scala hides /usr/local/share/emacs/24.4.50/lisp/org/ob-scala
/home/raman/.emacs.d/elpa/org-20140310/ob-ocaml hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ocaml
/home/raman/.emacs.d/elpa/org-20140310/org-timer hides /usr/local/share/emacs/24.4.50/lisp/org/org-timer
/home/raman/.emacs.d/elpa/org-20140310/ob-makefile hides /usr/local/share/emacs/24.4.50/lisp/org/ob-makefile
/home/raman/.emacs.d/elpa/org-20140310/ob-sqlite hides /usr/local/share/emacs/24.4.50/lisp/org/ob-sqlite
/home/raman/.emacs.d/elpa/org-20140310/org-version hides /usr/local/share/emacs/24.4.50/lisp/org/org-version
/home/raman/.emacs.d/elpa/org-20140310/org-capture hides /usr/local/share/emacs/24.4.50/lisp/org/org-capture
/home/raman/.emacs.d/elpa/org-20140310/org-macs hides /usr/local/share/emacs/24.4.50/lisp/org/org-macs
/home/raman/.emacs.d/elpa/org-20140310/ob-table hides /usr/local/share/emacs/24.4.50/lisp/org/ob-table
/home/raman/.emacs.d/elpa/org-20140310/org-feed hides /usr/local/share/emacs/24.4.50/lisp/org/org-feed
/home/raman/.emacs.d/elpa/org-20140310/ob-lisp hides /usr/local/share/emacs/24.4.50/lisp/org/ob-lisp
/home/raman/.emacs.d/elpa/org-20140310/ob-keys hides /usr/local/share/emacs/24.4.50/lisp/org/ob-keys
/home/raman/.emacs.d/elpa/org-20140310/ob-io hides /usr/local/share/emacs/24.4.50/lisp/org/ob-io
/home/raman/.emacs.d/elpa/org-20140310/org-bbdb hides /usr/local/share/emacs/24.4.50/lisp/org/org-bbdb
/home/raman/.emacs.d/elpa/org-20140310/ox-org hides /usr/local/share/emacs/24.4.50/lisp/org/ox-org
/home/raman/.emacs.d/elpa/org-20140310/org-id hides /usr/local/share/emacs/24.4.50/lisp/org/org-id
/home/raman/.emacs.d/elpa/org-20140310/ob-css hides /usr/local/share/emacs/24.4.50/lisp/org/ob-css
/home/raman/.emacs.d/elpa/org-20140310/ob-latex hides /usr/local/share/emacs/24.4.50/lisp/org/ob-latex
/home/raman/.emacs.d/elpa/org-20140310/ob-dot hides /usr/local/share/emacs/24.4.50/lisp/org/ob-dot
/home/raman/.emacs.d/elpa/org-20140310/ox-texinfo hides /usr/local/share/emacs/24.4.50/lisp/org/ox-texinfo
/home/raman/.emacs.d/elpa/org-20140310/org-src hides /usr/local/share/emacs/24.4.50/lisp/org/org-src
/home/raman/.emacs.d/elpa/org-20140310/ob-scheme hides /usr/local/share/emacs/24.4.50/lisp/org/ob-scheme
/home/raman/.emacs.d/elpa/org-20140310/org-colview hides /usr/local/share/emacs/24.4.50/lisp/org/org-colview
/home/raman/.emacs.d/elpa/org-20140310/org-indent hides /usr/local/share/emacs/24.4.50/lisp/org/org-indent
/home/raman/.emacs.d/elpa/org-20140310/ob-awk hides /usr/local/share/emacs/24.4.50/lisp/org/ob-awk
/home/raman/.emacs.d/elpa/org-20140310/org-gnus hides /usr/local/share/emacs/24.4.50/lisp/org/org-gnus
/home/raman/.emacs.d/elpa/org-20140310/org-rmail hides /usr/local/share/emacs/24.4.50/lisp/org/org-rmail
/home/raman/.emacs.d/elpa/org-20140310/org hides /usr/local/share/emacs/24.4.50/lisp/org/org
/home/raman/.emacs.d/elpa/org-20140310/ox-beamer hides /usr/local/share/emacs/24.4.50/lisp/org/ox-beamer
/home/raman/.emacs.d/elpa/org-20140310/org-macro hides /usr/local/share/emacs/24.4.50/lisp/org/org-macro
/home/raman/.emacs.d/elpa/org-20140310/ob-calc hides /usr/local/share/emacs/24.4.50/lisp/org/ob-calc
/home/raman/.emacs.d/elpa/org-20140310/org-install hides /usr/local/share/emacs/24.4.50/lisp/org/org-install
/home/raman/.emacs.d/elpa/org-20140310/org-protocol hides /usr/local/share/emacs/24.4.50/lisp/org/org-protocol
/home/raman/.emacs.d/elpa/org-20140310/ob hides /usr/local/share/emacs/24.4.50/lisp/org/ob
/home/raman/.emacs.d/elpa/org-20140310/ob-java hides /usr/local/share/emacs/24.4.50/lisp/org/ob-java
/home/raman/.emacs.d/elpa/org-20140310/ob-comint hides /usr/local/share/emacs/24.4.50/lisp/org/ob-comint
/home/raman/.emacs.d/elpa/org-20140310/org-mobile hides /usr/local/share/emacs/24.4.50/lisp/org/org-mobile
/home/raman/.emacs.d/elpa/org-20140310/org-mouse hides /usr/local/share/emacs/24.4.50/lisp/org/org-mouse
/home/raman/.emacs.d/elpa/org-20140310/ob-ruby hides /usr/local/share/emacs/24.4.50/lisp/org/ob-ruby

Features:
(shadow mail-extr emacsbug recentf tree-widget misearch multi-isearch
tramp-cache pcmpl-unix emacspeak-wizards ...)

Memory information:
((conses 16 711827 119358)
 (symbols 48 62346 0)
 (miscs 40 1132 7712)
 (strings 32 160543 31006)
 (string-bytes 1 4958227)
 (vectors 16 61748)
 (vector-slots 8 893805 6594)
 (floats 8 1120 245)
 (intervals 56 13753 3653)
 (buffers 960 26)
 ...)

--