changeset 55202:4c64ee838f41

* subr.el (remove-overlays): Make arguments optional. * wid-edit.el (widget-specify-button): Put evaporate to the overlay for sample. (widget-specify-sample): Put evaporate to the overlay for sample. (widget-specify-doc): Put evaporate to the overlay for documentation. * etc/NEWS: Write about remove-overlays's arguments. * man/widget.texi: Add remove-overlays to the example.
author Masatake YAMATO <jet@gyve.org>
date Tue, 27 Apr 2004 21:00:31 +0000
parents 7fff56f5b73c
children 7e5d16ca1ee2
files etc/NEWS lisp/ChangeLog lisp/subr.el lisp/wid-edit.el man/ChangeLog man/widget.texi
diffstat 6 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Tue Apr 27 15:13:04 2004 +0000
+++ b/etc/NEWS	Tue Apr 27 21:00:31 2004 +0000
@@ -3413,6 +3413,9 @@
 ** New function x-send-client-message sends a client message when
 running under X.
 
+** Arguments for remove-overlays are now optional, so that you can remove
+all overlays in the buffer by just calling (remove-overlay). 
+
 ** New packages:
 
 *** The new package gdb-ui.el provides an enhanced graphical interface to
--- a/lisp/ChangeLog	Tue Apr 27 15:13:04 2004 +0000
+++ b/lisp/ChangeLog	Tue Apr 27 21:00:31 2004 +0000
@@ -1,3 +1,13 @@
+2004-04-28  Masatake YAMATO  <jet@gyve.org>
+
+	* subr.el (remove-overlays): Make arguments
+	optional.
+
+	* wid-edit.el (widget-specify-button): Put evaporate to the 
+	overlay for sample.
+	(widget-specify-sample): Put evaporate to the overlay for sample.
+	(widget-specify-doc): Put evaporate to the overlay for documentation.
+
 2004-04-27  Jesper Harder  <harder@ifa.au.dk>
 
 	* info.el (info-apropos): Make it an index node.  Align node names
--- a/lisp/subr.el	Tue Apr 27 15:13:04 2004 +0000
+++ b/lisp/subr.el	Tue Apr 27 21:00:31 2004 +0000
@@ -1528,9 +1528,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
--- a/lisp/wid-edit.el	Tue Apr 27 15:13:04 2004 +0000
+++ b/lisp/wid-edit.el	Tue Apr 27 21:00:31 2004 +0000
@@ -382,6 +382,7 @@
       (setq help-echo 'widget-mouse-help))
     (overlay-put overlay 'button widget)
     (overlay-put overlay 'keymap (widget-get widget :keymap))
+    (overlay-put overlay 'evaporate t)
     ;; We want to avoid the face with image buttons.
     (unless (widget-get widget :suppress-face)
       (overlay-put overlay 'face (widget-apply widget :button-face-get))
@@ -401,6 +402,7 @@
   "Specify sample for WIDGET between FROM and TO."
   (let ((overlay (make-overlay from to nil t nil)))
     (overlay-put overlay 'face (widget-apply widget :sample-face-get))
+    (overlay-put overlay 'evaporate t)
     (widget-put widget :sample-overlay overlay)))
 
 (defun widget-specify-doc (widget from to)
@@ -408,6 +410,7 @@
   (let ((overlay (make-overlay from to nil t nil)))
     (overlay-put overlay 'widget-doc widget)
     (overlay-put overlay 'face widget-documentation-face)
+    (overlay-put overlay 'evaporate t)
     (widget-put widget :doc-overlay overlay)))
 
 (defmacro widget-specify-insert (&rest form)
--- a/man/ChangeLog	Tue Apr 27 15:13:04 2004 +0000
+++ b/man/ChangeLog	Tue Apr 27 21:00:31 2004 +0000
@@ -1,3 +1,8 @@
+2004-04-28  Masatake YAMATO  <jet@gyve.org>
+
+	* widget.texi (Programming Example): Remove
+	overlays.
+
 2004-04-27  Jesper Harder  <harder@ifa.au.dk>
 
 	* faq.texi, viper.texi, dired-x.texi, autotype.texi: lisp -> Lisp.
--- a/man/widget.texi	Tue Apr 27 15:13:04 2004 +0000
+++ b/man/widget.texi	Tue Apr 27 21:00:31 2004 +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