the example at the end of the referred node seems to be bogus.  Here is
a possible fix:

2005-08-23  Emilio C. Lopes  <[EMAIL PROTECTED]>

        * 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 [EMAIL PROTECTED] @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
  




_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to