From 7b7dc00de551543a102ad7baff9e234cb0da8cb2 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 11 Jan 2025 21:32:19 +1100 Subject: [emacs] Add ytdl to infobox --- emacs/.emacs.d/lisp/my/infobox.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/infobox.el') 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) -- cgit v1.2.3