diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/init.el b/init.el index 86e1d82..e6ce498 100644 --- a/init.el +++ b/init.el | |||
@@ -163,11 +163,35 @@ | |||
163 | (blink-cursor-mode +1)) | 163 | (blink-cursor-mode +1)) |
164 | 164 | ||
165 | (setup cus-edit | 165 | (setup cus-edit |
166 | |||
166 | (:option custom-file (acdw/dir "custom.el") | 167 | (:option custom-file (acdw/dir "custom.el") |
167 | custom-magic-show nil | 168 | custom-magic-show nil |
168 | custom-magic-show-button t | 169 | custom-magic-show-button t |
169 | custom-unlispify-tag-names nil | 170 | custom-unlispify-tag-names nil |
170 | custom-variable-default-form 'edit)) | 171 | custom-variable-default-form 'edit) |
172 | |||
173 | (defun unpackaged/custom-toggle-all-more-hide () | ||
174 | "Toggle all \"More/Hide\" widgets in current buffer." | ||
175 | (interactive) | ||
176 | (widget-map-buttons (lambda (widget _) | ||
177 | (pcase (widget-get widget :off) | ||
178 | ("More" (widget-apply-action widget))) | ||
179 | nil))) | ||
180 | (add-hook 'Custom-mode-hook #'unpackaged/custom-toggle-all-more-hide) | ||
181 | |||
182 | (defun unpackaged/custom-set-at-point () | ||
183 | "Set current value of widget at point." | ||
184 | (interactive) | ||
185 | (cl-labels ((find-widget (widget property) | ||
186 | (if (widget-get widget property) | ||
187 | widget | ||
188 | (find-widget (widget-get widget :parent) property)))) | ||
189 | (when-let* ((widget (find-widget (widget-at) :custom-set))) | ||
190 | (when (eq (widget-get widget :custom-state) 'modified) | ||
191 | (widget-apply widget :custom-set))))) | ||
192 | |||
193 | (:with-map custom-field-keymap | ||
194 | (:bind "C-c C-c" unpackaged/custom-set-at-point))) | ||
171 | 195 | ||
172 | (setup debugger | 196 | (setup debugger |
173 | (:hook visual-line-mode) | 197 | (:hook visual-line-mode) |