diff options
author | Case Duckworth | 2021-09-23 17:08:47 -0500 |
---|---|---|
committer | Case Duckworth | 2021-09-23 17:09:23 -0500 |
commit | 22d38c37996d3aa0020b2affd1012248de7246ea (patch) | |
tree | 525becd5807efc606ba532794ab753cfaf620589 /lisp | |
parent | Merge branch 'main' of tildegit.org:acdw/emacs (diff) | |
download | emacs-22d38c37996d3aa0020b2affd1012248de7246ea.tar.gz emacs-22d38c37996d3aa0020b2affd1012248de7246ea.zip |
Break out cus-edit functions
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw-cus-edit.el | 32 |
1 files changed, 32 insertions, 0 deletions
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 @@ | |||
1 | ;;; acdw-cus-edit.el -*- lexical-binding: t -*- | ||
2 | |||
3 | (defun acdw-cus/expand-widgets (&rest _) | ||
4 | "Expand descriptions in `Custom-mode' buffers." | ||
5 | (interactive) | ||
6 | ;; "More/Hide" widgets (thanks alphapapa!) | ||
7 | (widget-map-buttons (lambda (widget _) | ||
8 | (pcase (widget-get widget :off) | ||
9 | ("More" (widget-apply-action widget))) | ||
10 | nil)) | ||
11 | ;; "Show Value" widgets (the little triangles) | ||
12 | (widget-map-buttons (lambda (widget _) | ||
13 | (pcase (widget-get widget :off) | ||
14 | ("Show Value" | ||
15 | (widget-apply-action widget))) | ||
16 | nil))) | ||
17 | |||
18 | (defvar acdw-cus/imenu-generic-expression ; thanks u/oantolin! | ||
19 | '(("Faces" (rx (seq bol | ||
20 | (or "Show" "Hide") " " | ||
21 | (group (zero-or-more nonl)) | ||
22 | " face: [sample]")) | ||
23 | 1) | ||
24 | ("Variables" (rx (seq bol | ||
25 | (or "Show Value" "Hide") " " | ||
26 | (group (zero-or-more | ||
27 | (not (any "\n:")))))) | ||
28 | 1)) | ||
29 | "Show faces and variables in `imenu'.") | ||
30 | |||
31 | (provide 'acdw/cus-edit) | ||
32 | ;;; acdw-cus-edit.el ends here | ||