X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-mini.el;h=d540d17d9e372f16cd8536558b2958f7c728324e;hp=256bd51d0fc01dba9361c28068678d6b719e9a28;hb=69ba7c00944196072df74b1c66163a23c0457f96;hpb=f3259af63d4a93f0c6f27a2fe97ba7d2be99ea34 diff --git a/lisp/riece-mini.el b/lisp/riece-mini.el index 256bd51..d540d17 100644 --- a/lisp/riece-mini.el +++ b/lisp/riece-mini.el @@ -117,12 +117,17 @@ If twice (C-u C-u), then ask the channel." (defun riece-mini-show-backlog () "Send back logs to minibuffer." (interactive) - (let ((max-mini-window-height (1+ riece-mini-backlog-size)) - (resize-mini-windows t)) - (when riece-mini-backlog-history - (setq riece-mini-backlog-shown t) - (riece-mini-message-no-log "%s" - (mapconcat 'identity riece-mini-backlog-history "\n"))))) + (when riece-mini-backlog-history + (let ((height (1+ riece-mini-backlog-size))) + (mapc #'(lambda (string) + (setq height (+ height + (/ (length string) (window-width))))) + riece-mini-backlog-history) + (let ((max-mini-window-height height) + (resize-mini-windows t)) + (setq riece-mini-backlog-shown t) + (riece-mini-message-no-log + "%s" (mapconcat #'identity riece-mini-backlog-history "\n")))))) (defun riece-mini-pre-command () (when riece-mini-backlog-shown