about summary refs log tree commit diff stats
path: root/lisp/acdw-cus-edit.el
blob: c40f137ba323ee34fa0c3c201501848baad758f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;;; acdw-cus-edit.el -*- lexical-binding: t -*-

(defun acdw-cus/expand-widgets (&rest _)
  "Expand descriptions in `Custom-mode' buffers."
  (interactive)
  ;; "More/Hide" widgets (thanks alphapapa!)
  (widget-map-buttons (lambda (widget _)
                        (pcase (widget-get widget :off)
                          ("More" (widget-apply-action widget)))
                        nil))
  ;; "Show Value" widgets (the little triangles)
  (widget-map-buttons (lambda (widget _)
                        (pcase (widget-get widget :off)
                          ("Show Value"
                           (widget-apply-action widget)))
                        nil)))

(defvar acdw-cus/imenu-generic-expression ; thanks u/oantolin!
  '(("Faces" (rx (seq bol
                      (or "Show" "Hide") " "
                      (group (zero-or-more nonl))
                      " face: [sample]"))
     1)
    ("Variables" (rx (seq bol
                          (or "Show Value" "Hide") " "
                          (group (zero-or-more
                                  (not (any "\n:"))))))
     1))
  "Show faces and variables in `imenu'.")

(provide 'acdw/cus-edit)
;;; acdw-cus-edit.el ends here