From f5b575aec107879fa4b9729aeffcac5ee5716095 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 10 Aug 2021 17:28:03 -0500 Subject: Customize 'customize' ... somewhat. still needs work. --- init.el | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 86e1d82..e6ce498 100644 --- a/init.el +++ b/init.el @@ -163,11 +163,35 @@ (blink-cursor-mode +1)) (setup cus-edit + (:option custom-file (acdw/dir "custom.el") custom-magic-show nil custom-magic-show-button t custom-unlispify-tag-names nil - custom-variable-default-form 'edit)) + custom-variable-default-form 'edit) + + (defun unpackaged/custom-toggle-all-more-hide () + "Toggle all \"More/Hide\" widgets in current buffer." + (interactive) + (widget-map-buttons (lambda (widget _) + (pcase (widget-get widget :off) + ("More" (widget-apply-action widget))) + nil))) + (add-hook 'Custom-mode-hook #'unpackaged/custom-toggle-all-more-hide) + + (defun unpackaged/custom-set-at-point () + "Set current value of widget at point." + (interactive) + (cl-labels ((find-widget (widget property) + (if (widget-get widget property) + widget + (find-widget (widget-get widget :parent) property)))) + (when-let* ((widget (find-widget (widget-at) :custom-set))) + (when (eq (widget-get widget :custom-state) 'modified) + (widget-apply widget :custom-set))))) + + (:with-map custom-field-keymap + (:bind "C-c C-c" unpackaged/custom-set-at-point))) (setup debugger (:hook visual-line-mode) -- cgit 1.4.1-21-gabe81