Function: edt-set-scroll-margins
edt-set-scroll-margins is an autoloaded, interactive and byte-compiled
function defined in edt.el.gz.
Signature
(edt-set-scroll-margins TOP BOTTOM)
Documentation
Set scroll margins.
Argument TOP is the top margin in number of lines or percent of window. Argument BOTTOM is the bottom margin in number of lines or percent of window.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/emulation/edt.el.gz
;;;###autoload
(defun edt-set-scroll-margins (top bottom)
"Set scroll margins.
Argument TOP is the top margin in number of lines or percent of window.
Argument BOTTOM is the bottom margin in number of lines or percent of window."
(interactive
"sEnter top scroll margin (N lines or N%% or RETURN for current value): \
\nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ")
;; set top scroll margin
(or (string= top "")
(if (string= "%" (substring top -1))
(setq edt-top-scroll-margin (string-to-number top))
(setq edt-top-scroll-margin
(/ (1- (+ (* (string-to-number top) 100) (window-height)))
(window-height)))))
;; set bottom scroll margin
(or (string= bottom "")
(if (string= "%" (substring bottom -1))
(setq edt-bottom-scroll-margin (string-to-number bottom))
(setq edt-bottom-scroll-margin
(/ (1- (+ (* (string-to-number bottom) 100) (window-height)))
(window-height)))))
;; report scroll margin settings if running interactively
(and (called-interactively-p 'interactive)
(message "Scroll margins set. Top = %s%%, Bottom = %s%%"
edt-top-scroll-margin edt-bottom-scroll-margin)))