bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5615: 23.1.92; [PATCH] term.el: Calculation of window height is bad


From: Lars Ingebrigtsen
Subject: bug#5615: 23.1.92; [PATCH] term.el: Calculation of window height is bad (new patch)
Date: Sun, 28 Feb 2016 17:06:57 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

IRIE Shinsuke <address@hidden> writes:

> Sorry, the patch I sent with previous mail is bad, because the previous
> patch was made without considering `line-spacing' specified by a
> floating point number or frame-parameter.
>
> So I wrote the new patch. Please check it.

[...]

Is this still a problem in the current Emacs?

> + (defun term-window-height ()
> +   (if (display-graphic-p)
> +       (let ((e (window-inside-pixel-edges))
> +         (s (or (with-current-buffer (window-buffer) line-spacing)
> +                (frame-parameter nil 'line-spacing)
> +                0)))
> +     (if (floatp s)
> +         (setq s (truncate (* (frame-char-height) s))))
> +     (/ (+ (- (nth 3 e) (cadr e)) s)
> +        (+ (frame-char-height) s)))
> +     (window-text-height)))
>   
>   (put 'term-mode 'mode-class 'special)

[...]

>   (defun term-check-size (process)
> !   (when (or (/= term-height (1- (window-height)))
>           (/= term-width (term-window-width)))
> !     (term-reset-size (1- (window-height)) (term-window-width))
>       (set-process-window-size process term-height term-width)))
>   
>   (defun term-send-raw-string (chars)
> --- 1193,1201 ----
>       found))
>   
>   (defun term-check-size (process)
> !   (when (or (/= term-height (term-window-height))
>           (/= term-width (term-window-width)))
> !     (term-reset-size (term-window-height) (term-window-width))
>       (set-process-window-size process term-height term-width)))
>   
>   (defun term-send-raw-string (chars)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]