Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; This paste is basically redundant. After I wrote the functions, I did some
- ;;; internet searching and found that these following functions are already in
- ;;; view.el, a part of the core emacs code. No regrets at writing them, because
- ;;; I learned more about elisp in the process.
- ;; View-scroll-half-page-forward
- ;; View-scroll-half-page-backward
- ;;; I'm still debating if I want to bind the View-* commands to keys and/or
- ;;; aliases.
- ;; Commands
- (defun scroll-up-half-window ()
- (interactive)
- (goto-center-row)
- (recenter-top-bottom 0))
- (defun scroll-down-half-window ()
- (interactive)
- (goto-center-row)
- (recenter-top-bottom -1))
- ;; Support function
- (defun goto-center-row ()
- (let ((recenter-positions '(middle top bottom)))
- (move-to-window-line-top-bottom)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement