diff options
author | Yuchen Pei <id@ypei.org> | 2025-01-11 21:32:19 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2025-01-11 21:32:19 +1100 |
commit | 7b7dc00de551543a102ad7baff9e234cb0da8cb2 (patch) | |
tree | d60977e3acf596b0450bf767ef5fcafdf5e5d574 /emacs/.emacs.d/lisp/my/infobox.el | |
parent | a32df57496361ffd72c68e1e135439d0ec6ec87f (diff) |
[emacs] Add ytdl to infobox
Diffstat (limited to 'emacs/.emacs.d/lisp/my/infobox.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/infobox.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/emacs/.emacs.d/lisp/my/infobox.el b/emacs/.emacs.d/lisp/my/infobox.el index 81a66ce..0b84810 100644 --- a/emacs/.emacs.d/lisp/my/infobox.el +++ b/emacs/.emacs.d/lisp/my/infobox.el @@ -27,6 +27,15 @@ ;;; Code: +(defun infobox-default-specs (info) + (seq-map + (lambda (pair) + (cons (car pair) + (replace-regexp-in-string + "[-_]" " " + (capitalize (format "%s" (car pair)))))) + info)) + (defun infobox-translate (info specs) "Translate INFO according to SPECS. @@ -45,7 +54,7 @@ something like (defun infobox-render (info item &optional interactive-p) "Render and display a help buffer of INFO." (help-setup-xref item interactive-p) - (with-help-window (help-buffer) + (with-help-window "*infobox*" (with-current-buffer standard-output (let ((n-rows 0)) (seq-do @@ -54,7 +63,7 @@ something like (when (stringp (car pair)) (insert (car pair) ": ") (setq n-rows (1+ n-rows))) - (insert (cdr pair) "\n"))) + (insert (format "%s" (cdr pair)) "\n"))) info) (align-regexp (point-min) |