From: Masatake YAMATO Date: Tue, 27 Apr 2004 21:00:31 +0000 (+0000) Subject: * subr.el (remove-overlays): Make arguments optional. X-Git-Tag: ttn-vms-21-2-B4~6547 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f24485f172efcd20394f6d5040305fe02c38e043;p=emacs.git * 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. --- diff --git a/etc/NEWS b/etc/NEWS index bc21ab9a997..6ad65268e4f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3413,6 +3413,9 @@ using the text properties (esp. the face) of the prompt string. ** 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 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ecf9cfeaf9c..c01308a4e1a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2004-04-28 Masatake YAMATO + + * 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 * info.el (info-apropos): Make it an index node. Align node names diff --git a/lisp/subr.el b/lisp/subr.el index 516b0fc781a..a9acc15606d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1528,9 +1528,13 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." (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 diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 2392ccdfb47..33f1f06ba9a 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -382,6 +382,7 @@ new value.") (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 @@ new value.") "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 @@ new value.") (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) diff --git a/man/ChangeLog b/man/ChangeLog index f8fd73368f9..2514ea979b8 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-04-28 Masatake YAMATO + + * widget.texi (Programming Example): Remove + overlays. + 2004-04-27 Jesper Harder * faq.texi, viper.texi, dired-x.texi, autotype.texi: lisp -> Lisp. diff --git a/man/widget.texi b/man/widget.texi index c919a394efe..457af8a07bb 100644 --- a/man/widget.texi +++ b/man/widget.texi @@ -341,6 +341,7 @@ Interface}). (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