diff options
author | William Carroll <wpcarro@gmail.com> | 2020-09-06T12·47+0100 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-09-06T12·49+0100 |
commit | 5cf6a0b23da854d10a37eb84e7eff1557da51daa (patch) | |
tree | 6adc181e83c422b477346f0611f225db01f7b7b2 | |
parent | b89d1f0a1f2952241671ccd89913d34fe57da6d7 (diff) |
Add defgroup vterm-mgt for vterm-mgt
In the past I used `defconst` in many of my Elisp libraries where I should've used something like: ```elisp ;; some/path/to/some-lib.el (defgroup some-lib nil) (defcustom some-lib-setting nil :group 'some-lib) ``` When I encounter code that I should've structured this way, I'm cleaning it up to prefer this more idiomatic pattern.
-rw-r--r-- | emacs/.emacs.d/wpc/vterm-mgt.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/emacs/.emacs.d/wpc/vterm-mgt.el b/emacs/.emacs.d/wpc/vterm-mgt.el index e33a13429599..ce60bab149c0 100644 --- a/emacs/.emacs.d/wpc/vterm-mgt.el +++ b/emacs/.emacs.d/wpc/vterm-mgt.el @@ -31,11 +31,16 @@ ;; Configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defconst vterm-mgt--instances (cycle-new) - "A cycle tracking all of my vterm instances.") +(defgroup vterm-mgt nil + "Customization options for `vterm-mgt'.") (defcustom vterm-mgt-scroll-on-focus nil - "When t, call `end-of-buffer' after focusing a vterm instance.") + "When t, call `end-of-buffer' after focusing a vterm instance." + :type '(boolean) + :group 'vterm-mgt) + +(defconst vterm-mgt--instances (cycle-new) + "A cycle tracking all of my vterm instances.") (defun vterm-mgt--instance? (b) "Return t if the buffer B is a vterm instance." @@ -113,7 +118,7 @@ This function should be called from a buffer running vterm." If for whatever reason, the state of `vterm-mgt--instances' is corrupted and misaligns with the state of vterm buffers in Emacs, use this function to - attempt to restore the state." + restore the state." (interactive) (setq vterm-mgt--instances (->> (buffer-list) |