comparison lisp/text-props.el @ 1275:57b76886836d

[xemacs-hg @ 2003-02-08 02:29:52 by ben] fixes to hyper-apropos, menubar-items, text-props, update-elc, lread.c; see log msg in lisp/ChangeLog
author ben
date Sat, 08 Feb 2003 02:29:55 +0000
parents 3ecd8885ac67
children 308d34e9f07d
comparison
equal deleted inserted replaced
1274:2dcc22ec7640 1275:57b76886836d
232 (while (and start (< start end) 232 (while (and start (< start end)
233 (not (eq value (get-text-property start prop buffer-or-string)))) 233 (not (eq value (get-text-property start prop buffer-or-string))))
234 (setq start (next-single-property-change start prop buffer-or-string end))) 234 (setq start (next-single-property-change start prop buffer-or-string end)))
235 ;; we have to insert a special check for end due to the illogical 235 ;; we have to insert a special check for end due to the illogical
236 ;; definition of next-single-property-change (blame FSF for this). 236 ;; definition of next-single-property-change (blame FSF for this).
237 (if (eq start end) nil start)) 237 (if (and start (>= start end)) nil start))
238 238
239 (defun text-property-not-all (start end prop value &optional buffer-or-string) 239 (defun text-property-not-all (start end prop value &optional buffer-or-string)
240 "Check text from START to END to see if PROP is ever not `eq' to VALUE. 240 "Check text from START to END to see if PROP is ever not `eq' to VALUE.
241 If so, return the position of the first character whose PROP is not 241 If so, return the position of the first character whose PROP is not
242 `eq' to VALUE. Otherwise, return nil. 242 `eq' to VALUE. Otherwise, return nil.
246 start 246 start
247 (let ((retval (next-single-property-change start prop 247 (let ((retval (next-single-property-change start prop
248 buffer-or-string end))) 248 buffer-or-string end)))
249 ;; we have to insert a special check for end due to the illogical 249 ;; we have to insert a special check for end due to the illogical
250 ;; definition of previous-single-property-change (blame FSF for this). 250 ;; definition of previous-single-property-change (blame FSF for this).
251 (if (eq retval end) nil retval)))) 251 (if (and retval (>= retval end)) nil retval))))
252 252
253 ;; Older versions that only work sometimes (when VALUE is non-nil 253 ;; Older versions that only work sometimes (when VALUE is non-nil
254 ;; for text-property-any, and maybe only when VALUE is nil for 254 ;; for text-property-any, and maybe only when VALUE is nil for
255 ;; text-property-not-all). They might be faster in those cases, 255 ;; text-property-not-all). They might be faster in those cases,
256 ;; but that's not obvious. 256 ;; but that's not obvious.