From: bg66 Date: Mon, 13 Sep 2004 11:01:56 +0000 (+0000) Subject: * riece-mini.el (riece-mini-show-backlog): Fix for long messages. X-Git-Tag: riece-1_0_4~20 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d2ccca583b81a150c37fc985324a61003d5ee58;p=elisp%2Friece.git * riece-mini.el (riece-mini-show-backlog): Fix for long messages. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 895c170..0fd5e9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-09-13 OHASHI Akira + + * riece-mini.el (riece-mini-show-backlog): Fix for long messages. + 2004-09-12 OHASHI Akira * riece-mini.el (riece-mini-show-backlog): Protect 1st arg of 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