From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: Strange problem with latest CVS Date: Wed, 21 Apr 2004 22:20:02 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040421.222002.226799445.jet@gyve.org> References: <20040420.134003.132913167.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1082556524 13461 80.91.224.253 (21 Apr 2004 14:08:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Apr 2004 14:08:44 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Apr 21 16:08:19 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BGIOg-0002d1-00 for ; Wed, 21 Apr 2004 16:08:18 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BGIOg-0004Om-00 for ; Wed, 21 Apr 2004 16:08:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BGHgD-0001V3-Vy for emacs-devel@quimby.gnus.org; Wed, 21 Apr 2004 09:22:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BGHfS-0001Od-Tn for emacs-devel@gnu.org; Wed, 21 Apr 2004 09:21:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BGHet-0001Ef-0a for emacs-devel@gnu.org; Wed, 21 Apr 2004 09:21:30 -0400 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BGHes-0001D8-Ar for emacs-devel@gnu.org; Wed, 21 Apr 2004 09:20:58 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3LDKsFe029334 for ; Wed, 21 Apr 2004 09:20:54 -0400 Original-Received: from ns.tokyo.redhat.com (ns.tokyo.redhat.com [172.16.33.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3LDKrp23463 for ; Wed, 21 Apr 2004 09:20:53 -0400 Original-Received: from localhost (gls07.tokyo.redhat.com [172.16.32.104]) by ns.tokyo.redhat.com (8.11.6/8.11.6) with ESMTP id i3LDKdl14178 for ; Wed, 21 Apr 2004 22:20:39 +0900 Original-To: emacs-devel@gnu.org In-Reply-To: X-Mailer: Mew version 4.0.62 on Emacs 21.3.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21987 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21987 > > 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