comparison lisp/emulation/tpu-extras.el @ 62402:a7e02ef1e3d6

Replace `string-to-int' by `string-to-number'.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 16 May 2005 11:33:47 +0000
parents 695cf19ef79e
children c9e18de90ee3 f042e7c0fe20
comparison
equal deleted inserted replaced
62401:4512c4db6912 62402:a7e02ef1e3d6
438 "sEnter top scroll margin (N lines or N%% or RETURN for current value): \ 438 "sEnter top scroll margin (N lines or N%% or RETURN for current value): \
439 \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ") 439 \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ")
440 ;; set top scroll margin 440 ;; set top scroll margin
441 (or (string= top "") 441 (or (string= top "")
442 (if (string= "%" (substring top -1)) 442 (if (string= "%" (substring top -1))
443 (setq tpu-top-scroll-margin (string-to-int top)) 443 (setq tpu-top-scroll-margin (string-to-number top))
444 (setq tpu-top-scroll-margin 444 (setq tpu-top-scroll-margin
445 (/ (1- (+ (* (string-to-int top) 100) (window-height))) 445 (/ (1- (+ (* (string-to-number top) 100) (window-height)))
446 (window-height))))) 446 (window-height)))))
447 ;; set bottom scroll margin 447 ;; set bottom scroll margin
448 (or (string= bottom "") 448 (or (string= bottom "")
449 (if (string= "%" (substring bottom -1)) 449 (if (string= "%" (substring bottom -1))
450 (setq tpu-bottom-scroll-margin (string-to-int bottom)) 450 (setq tpu-bottom-scroll-margin (string-to-number bottom))
451 (setq tpu-bottom-scroll-margin 451 (setq tpu-bottom-scroll-margin
452 (/ (1- (+ (* (string-to-int bottom) 100) (window-height))) 452 (/ (1- (+ (* (string-to-number bottom) 100) (window-height)))
453 (window-height))))) 453 (window-height)))))
454 ;; report scroll margin settings if running interactively 454 ;; report scroll margin settings if running interactively
455 (and (interactive-p) 455 (and (interactive-p)
456 (message "Scroll margins set. Top = %s%%, Bottom = %s%%" 456 (message "Scroll margins set. Top = %s%%, Bottom = %s%%"
457 tpu-top-scroll-margin tpu-bottom-scroll-margin))) 457 tpu-top-scroll-margin tpu-bottom-scroll-margin)))