diff options
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) |