emacs-devel
[Top][All Lists]
Advanced

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

Re: Strange problem with latest CVS


From: Masatake YAMATO
Subject: Re: Strange problem with latest CVS
Date: Wed, 21 Apr 2004 22:20:02 +0900 (JST)

>     > Why would you use it again once the widgets exist
>     > in the buffer?
> 
>     In order to reset the widgets.
> 
> In that case, the example code should start by explicitly deleting the
> overlays it previously made, if it was called before.
> 
> Would you like to fix the example code in the manual?

The patch for the manual is obvious.

How do you think arugments for `remove-overlays' optional?
So if one wants to remove all overlays in the buffer, like
the example of widget.texi, one has to just call
(remove-overlays).

Masatake YAMATO

Index: man/widget.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/man/widget.texi,v
retrieving revision 1.24
diff -u -r1.24 widget.texi
--- man/widget.texi     2 Nov 2003 07:01:18 -0000       1.24
+++ man/widget.texi     21 Apr 2004 13:17:00 -0000
@@ -341,6 +341,7 @@
   (make-local-variable 'widget-example-repeat)
   (let ((inhibit-read-only t))
     (erase-buffer))
+  (remove-overlays)
   (widget-insert "Here is some documentation.\n\nName: ")
   (widget-create 'editable-field
                 :size 13
Index: lisp/subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.385
diff -u -r1.385 subr.el
--- lisp/subr.el        20 Apr 2004 20:56:32 -0000      1.385
+++ lisp/subr.el        21 Apr 2004 13:17:00 -0000
@@ -1512,9 +1512,13 @@
       (overlay-put o1 (pop props) (pop props)))
     o1))
 
-(defun remove-overlays (beg end name val)
+(defun remove-overlays (&optional beg end name val)
   "Clear BEG and END of overlays whose property NAME has value VAL.
-Overlays might be moved and or split."
+Overlays might be moved and or split.
+If BEG is nil, `(point-min)' is used. If END is nil, `(point-max)' 
+is used."
+  (unless beg (setq beg (point-min)))
+  (unless end (setq end (point-max)))
   (if (< end beg)
       (setq beg (prog1 end (setq end beg))))
   (save-excursion




reply via email to

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