Function: widget-map-buttons

widget-map-buttons is a byte-compiled function defined in wid-edit.el.gz.

Signature

(widget-map-buttons FUNCTION &optional BUFFER MAPARG)

Documentation

Map FUNCTION over the buttons in BUFFER.

FUNCTION is called with the arguments WIDGET and MAPARG.

If FUNCTION returns non-nil, the walk is canceled.

The arguments MAPARG, and BUFFER default to nil and (current-buffer), respectively.

Source Code

;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
(defun widget-map-buttons (function &optional buffer maparg)
  "Map FUNCTION over the buttons in BUFFER.
FUNCTION is called with the arguments WIDGET and MAPARG.

If FUNCTION returns non-nil, the walk is canceled.

The arguments MAPARG, and BUFFER default to nil and (current-buffer),
respectively."
  (let ((cur (point-min))
	(widget nil)
	(overlays (if buffer
		      (with-current-buffer buffer (overlay-lists))
		    (overlay-lists))))
    (setq overlays (append (car overlays) (cdr overlays)))
    (while (setq cur (pop overlays))
      (setq widget (overlay-get cur 'button))
      (if (and widget (funcall function widget maparg))
	  (setq overlays nil)))))