|
From: | Johan Bockgård |
Subject: | Re: display property strangeness |
Date: | Sun, 13 Mar 2005 11:33:08 +0100 |
User-agent: | Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (usg-unix-v) |
"Chong Yidong" <address@hidden> writes: > This is a strange one. Evaluate the following two functions. Both of > them should do the same thing: replace each of the first 3 letters > in the buffer with the letter "A". > > (defun foo () > (interactive) > (let ((pos '(1 2 3))) > (while pos > (put-text-property (car pos) (1+ (car pos)) 'display "A") > (setq pos (cdr pos))))) > > (defun bar () > (interactive) > (progn (put-text-property 1 2 'display "A") > (put-text-property 2 3 'display "A") > (put-text-property 3 4 'display "A"))) In the former case all display properites are the same (`eq') string. In the latter case there are three different (`equal') strings. -- Johan Bockgård
[Prev in Thread] | Current Thread | [Next in Thread] |