Function: widget-specify-inactive

widget-specify-inactive is a byte-compiled function defined in wid-edit.el.gz.

Signature

(widget-specify-inactive WIDGET FROM TO)

Documentation

Make WIDGET inactive for user modifications.

If WIDGET is already inactive, moves the :inactive overlay to the positions indicated by FROM and TO, either numbers or markers.

If WIDGET is not inactive, creates an overlay that spans from FROM to TO, and saves that overlay under the :inactive property for WIDGET.

Source Code

;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
(defun widget-specify-inactive (widget from to)
  "Make WIDGET inactive for user modifications.

If WIDGET is already inactive, moves the :inactive overlay to the positions
indicated by FROM and TO, either numbers or markers.

If WIDGET is not inactive, creates an overlay that spans from FROM to TO,
and saves that overlay under the :inactive property for WIDGET."
  (if (widget-get widget :inactive)
      (move-overlay (widget-get widget :inactive) from to)
    (let ((overlay (make-overlay from to nil t nil)))
      (overlay-put overlay 'face 'widget-inactive)
      ;; This is disabled, as it makes the mouse cursor change shape.
      ;; (overlay-put overlay 'mouse-face 'widget-inactive)
      (overlay-put overlay 'evaporate t)
      (overlay-put overlay 'priority 100)
      (overlay-put overlay 'modification-hooks '(widget-overlay-inactive))
      (widget-put widget :inactive overlay))))