[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug fix lispref node "Finding Overlays"
From: |
Emilio Lopes |
Subject: |
bug fix lispref node "Finding Overlays" |
Date: |
Tue, 23 Aug 2005 17:16:45 +0200 |
User-agent: |
Emacs Gnus |
the example at the end of the referred node seems to be bogus. Here is
a possible fix:
2005-08-23 Emilio C. Lopes <address@hidden>
* display.texi (Finding Overlays): fixed `find-overlay-prop' in
example of `next-overlay-change'.
diff -rN -c old-emacs-darcs.eclig/lispref/display.texi
new-emacs-darcs.eclig/lispref/display.texi
*** old-emacs-darcs.eclig/lispref/display.texi Tue Aug 23 17:12:47 2005
--- new-emacs-darcs.eclig/lispref/display.texi Tue Aug 23 17:02:29 2005
***************
*** 1501,1520 ****
@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 address@hidden @code{happy} property 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)))
(goto-char (min (next-overlay-change (point))
! (next-single-property-change (point) 'happy))))
(point)))
@end smallexample
@node Width
@section Width
--- 1501,1526 ----
@code{(point-min)}.
@end defun
! 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) prop)))
(goto-char (min (next-overlay-change (point))
! (next-single-property-change (point) prop))))
(point)))
@end smallexample
+ Now one can simply write, for example:
+
+ @smallexample
+ (find-overlay-prop 'happy)
+ @end smallexample
+
@node Width
@section Width
- bug fix lispref node "Finding Overlays",
Emilio Lopes <=