[...]
(defmethod selection-ranges ((text text)) (format-wish "senddatastring [~a tag ranges sel]" (widget-path text)) (read-data))
Just as a side note, in my changes I've implemented:
(defgeneric tag-ranges (txt tag)) (defmethod tag-ranges ((txt text) tag) (format-wish "senddatastring [~a tag ranges ~a]" (widget-path txt) (tag-to-string tag)) (tcl-string-to-list (read-data)))
which you can call as (tag-ranges txt :selection) and get the ranges as a list, instead of a string (which I found inconvenient).
--J.