Michelson emacs-mode: auto resize type buffer.

This commit is contained in:
Benjamin Canou 2017-07-23 00:47:49 +02:00
parent 4a9fee3f11
commit 2e3d664069

View File

@ -326,7 +326,27 @@
nil nil
(setq message (concat message "\n"))) (setq message (concat message "\n")))
(setq message (concat message (cadr (cdr elt))))))) (setq message (concat message (cadr (cdr elt)))))))
(display-message-or-buffer message "*Michelson*")))) (if (string= message "")
(setq message "\n No instruction at point."))
(let
((message-window
(display-buffer-below-selected
(get-buffer-create "*Michelson*") nil))
(lines 0))
(save-excursion
(set-buffer "*Michelson*")
(toggle-read-only nil)
(erase-buffer)
(insert message)
(toggle-read-only t)
(beginning-of-buffer)
(while (not (eobp))
(vertical-motion 1)
(setq lines (+ 1 lines)))
(window-resize
message-window
(+ (- (max 4 lines)
(window-size message-window)) 1)))))))
(defun michelson-update-minibuffer-info () (defun michelson-update-minibuffer-info ()
(when (nth 2 michelson-state) (cancel-timer (nth 2 michelson-state))) (when (nth 2 michelson-state) (cancel-timer (nth 2 michelson-state)))