emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lispref/display.texi,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lispref/display.texi,v
Date: Sun, 04 Mar 2007 18:00:38 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       07/03/04 18:00:37

Index: display.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/display.texi,v
retrieving revision 1.249
retrieving revision 1.250
diff -u -b -r1.249 -r1.250
--- display.texi        14 Feb 2007 11:31:28 -0000      1.249
+++ display.texi        4 Mar 2007 18:00:37 -0000       1.250
@@ -1527,26 +1527,25 @@
 @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}):
+  As an example, here's a simplified (and inefficient) version of the
+primitive function @code{next-single-char-property-change}
+(@pxref{Property Search}).  It searches forward from position
address@hidden for the next position where the value of a given property
address@hidden, as obtained from either overlays or text properties,
+changes.
 
 @smallexample
-(defun find-overlay-prop (prop)
+(defun next-single-char-property-change (position prop)
   (save-excursion
+    (goto-char position)
+    (let ((propval (get-char-property (point) prop)))
     (while (and (not (eobp))
-                (not (get-char-property (point) prop)))
+                  (eq (get-char-property (point) prop) propval))
       (goto-char (min (next-overlay-change (point))
-                      (next-single-property-change (point) prop))))
+                        (next-single-property-change (point) prop)))))
     (point)))
 @end smallexample
 
-  Now you can search for a @code{happy} property like this:
-
address@hidden
-(find-overlay-prop 'happy)
address@hidden smallexample
-
 @node Width
 @section Width
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]