Function: widget-specify-button
widget-specify-button is a byte-compiled function defined in
wid-edit.el.gz.
Signature
(widget-specify-button WIDGET FROM TO)
Documentation
Specify button for WIDGET between FROM and TO.
Source Code
;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
(defun widget-specify-button (widget from to)
"Specify button for WIDGET between FROM and TO."
(let ((overlay (make-overlay from to nil t nil))
(follow-link (widget-get widget :follow-link))
(help-echo (widget-get widget :help-echo)))
(widget-put widget :button-overlay overlay)
(when (functionp help-echo)
(setq help-echo 'widget-mouse-help))
(overlay-put overlay 'before-string #(" " 0 1 (invisible t)))
(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))
(overlay-put overlay 'mouse-face
;; Make new list structure for the mouse-face value
;; so that different widgets will have
;; different `mouse-face' property values
;; and will highlight separately.
(let ((mouse-face-value
(widget-apply widget :mouse-face-get)))
;; If it's a list, copy it.
(if (listp mouse-face-value)
(copy-sequence mouse-face-value)
;; If it's a symbol, put it in a list.
(list mouse-face-value)))))
(overlay-put overlay 'pointer 'hand)
(overlay-put overlay 'follow-link follow-link)
(overlay-put overlay 'help-echo help-echo)))