From 22d38c37996d3aa0020b2affd1012248de7246ea Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 23 Sep 2021 17:08:47 -0500 Subject: Break out cus-edit functions --- lisp/acdw-cus-edit.el | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lisp/acdw-cus-edit.el (limited to 'lisp') diff --git a/lisp/acdw-cus-edit.el b/lisp/acdw-cus-edit.el new file mode 100644 index 0000000..c40f137 --- /dev/null +++ b/lisp/acdw-cus-edit.el @@ -0,0 +1,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 -- cgit 1.4.1-21-gabe81