* bug fix lispref node "Finding Overlays"
@ 2005-08-23 15:16 Emilio Lopes
2005-08-24 10:32 ` Richard M. Stallman
0 siblings, 1 reply; 2+ messages in thread
From: Emilio Lopes @ 2005-08-23 15:16 UTC (permalink / raw)
the example at the end of the referred node seems to be bogus. Here is
a possible fix:
2005-08-23 Emilio C. Lopes <eclig@gmx.net>
* 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 non-@code{nil} @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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: bug fix lispref node "Finding Overlays"
2005-08-23 15:16 bug fix lispref node "Finding Overlays" Emilio Lopes
@ 2005-08-24 10:32 ` Richard M. Stallman
0 siblings, 0 replies; 2+ messages in thread
From: Richard M. Stallman @ 2005-08-24 10:32 UTC (permalink / raw)
Cc: emacs-devel
This change is good, and I will install it. But instead of this
+ Now one can simply write, for example:
I'll use this:
Now you can search for a @code{happy} property like this:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-24 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-23 15:16 bug fix lispref node "Finding Overlays" Emilio Lopes
2005-08-24 10:32 ` Richard M. Stallman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.