Mercurial > emacs
changeset 65121:64ac61f4b3b4
(Finding Overlays): Fix `find-overlay-prop' in `next-overlay-change' example.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 25 Aug 2005 11:04:38 +0000 |
parents | 8231429db292 |
children | 04a0656bc67c |
files | lispref/display.texi |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lispref/display.texi Thu Aug 25 11:03:32 2005 +0000 +++ b/lispref/display.texi Thu Aug 25 11:04:38 2005 +0000 @@ -1501,20 +1501,26 @@ @code{(point-min)}. @end defun - Here's an easy way to use @code{next-overlay-change} to search for the -next character which gets a non-@code{nil} @code{happy} property from + Here's a function which uses @code{next-overlay-change} to search +for the next character which gets a given property @code{prop} from either its overlays or its text properties (@pxref{Property Search}): @smallexample (defun find-overlay-prop (prop) (save-excursion (while (and (not (eobp)) - (not (get-char-property (point) 'happy))) + (not (get-char-property (point) prop))) (goto-char (min (next-overlay-change (point)) - (next-single-property-change (point) 'happy)))) + (next-single-property-change (point) prop)))) (point))) @end smallexample + Now you can search for a @code{happy} property like this: + +@smallexample +(find-overlay-prop 'happy) +@end smallexample + @node Width @section Width