]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finding Overlays): Fix `find-overlay-prop' in `next-overlay-change' example.
authorRichard M. Stallman <rms@gnu.org>
Thu, 25 Aug 2005 11:04:38 +0000 (11:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 25 Aug 2005 11:04:38 +0000 (11:04 +0000)
lispref/display.texi

index d4be7b54cc05e04b4dfad4d841b3d347c2df8eb0..8addb3b67ecc9f81ea300bb3814e7d11dd45370f 100644 (file)
@@ -1501,20 +1501,26 @@ end of an overlay, before @var{pos}.  If there is none, it returns
 @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