440 |
;; set top scroll margin |
;; set top scroll margin |
441 |
(or (string= top "") |
(or (string= top "") |
442 |
(if (string= "%" (substring top -1)) |
(if (string= "%" (substring top -1)) |
443 |
(setq tpu-top-scroll-margin (string-to-int top)) |
(setq tpu-top-scroll-margin (string-to-number top)) |
444 |
(setq tpu-top-scroll-margin |
(setq tpu-top-scroll-margin |
445 |
(/ (1- (+ (* (string-to-int top) 100) (window-height))) |
(/ (1- (+ (* (string-to-number top) 100) (window-height))) |
446 |
(window-height))))) |
(window-height))))) |
447 |
;; set bottom scroll margin |
;; set bottom scroll margin |
448 |
(or (string= bottom "") |
(or (string= bottom "") |
449 |
(if (string= "%" (substring bottom -1)) |
(if (string= "%" (substring bottom -1)) |
450 |
(setq tpu-bottom-scroll-margin (string-to-int bottom)) |
(setq tpu-bottom-scroll-margin (string-to-number bottom)) |
451 |
(setq tpu-bottom-scroll-margin |
(setq tpu-bottom-scroll-margin |
452 |
(/ (1- (+ (* (string-to-int bottom) 100) (window-height))) |
(/ (1- (+ (* (string-to-number bottom) 100) (window-height))) |
453 |
(window-height))))) |
(window-height))))) |
454 |
;; report scroll margin settings if running interactively |
;; report scroll margin settings if running interactively |
455 |
(and (interactive-p) |
(and (interactive-p) |