Function: Custom-goto-first-choice

Custom-goto-first-choice is an interactive and byte-compiled function defined in cus-edit.el.gz.

Signature

(Custom-goto-first-choice)

Documentation

Move point to the first choice button in a menu.

If no such button can be found, move to the first menu item.

View in manual

Probably introduced at or before Emacs version 31.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun Custom-goto-first-choice ()
  "Move point to the first choice button in a menu.
If no such button can be found, move to the first menu item."
  (interactive)
  (catch 'done
    (dolist (ov (sort (overlays-in (point-min) (point-max))
		      :key #'overlay-start))
      (let ((button (overlay-get ov 'button)))
        (when (eq (plist-get (cdr button) :action)
		  'custom-toggle-hide-variable)
	  (goto-char (overlay-start ov))
          (when (plist-get (cdr button) :value)
            (widget-forward 1))
	  (throw 'done t))))))