Function: widget-convert-text

widget-convert-text is a byte-compiled function defined in wid-edit.el.gz.

Signature

(widget-convert-text TYPE FROM TO &optional BUTTON-FROM BUTTON-TO &rest ARGS)

Documentation

Return a widget of type TYPE with endpoint FROM TO.

No text will be inserted to the buffer, instead the text between FROM and TO will be used as the widgets end points. If optional arguments BUTTON-FROM and BUTTON-TO are given, these will be used as the widgets button end points. Optional ARGS are extra keyword arguments for TYPE.

Source Code

;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
(defun widget-convert-text (type from to
				 &optional button-from button-to
				 &rest args)
  "Return a widget of type TYPE with endpoint FROM TO.
No text will be inserted to the buffer, instead the text between FROM
and TO will be used as the widgets end points.  If optional arguments
BUTTON-FROM and BUTTON-TO are given, these will be used as the widgets
button end points.
Optional ARGS are extra keyword arguments for TYPE."
  (let ((widget (apply 'widget-convert type :delete 'widget-leave-text args))
	(from (copy-marker from))
	(to (copy-marker to)))
    (set-marker-insertion-type from t)
    (set-marker-insertion-type to nil)
    (widget-put widget :from from)
    (widget-put widget :to to)
    (when button-from
      (widget-specify-button widget button-from button-to))
    widget))