mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress the warnings introduced in Emacs 31 requiring all elisp files to have a `lexical-binding` comment. This retains the default behavior of dynamic binding when no `lexical-binding` comment is present. With it set to `t` across the board, various things break, and fixing those is a task for another day.
22 lines
676 B
EmacsLisp
22 lines
676 B
EmacsLisp
;;; siren-scroll-half-screen.el --- jimeh's Emacs Siren: scroll-half-screen. -*- lexical-binding: nil; -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;; Scroll up/down M-v/C-v half a screen instead of a full screen.
|
|
|
|
;;; Code:
|
|
|
|
;; Scroll half a screen when using scroll-up and scroll-down functions.
|
|
(defadvice scroll-up (around half-window activate)
|
|
(setq next-screen-context-lines
|
|
(max 1 (/ (1- (window-height (selected-window))) 2)))
|
|
ad-do-it)
|
|
|
|
(defadvice scroll-down (around half-window activate)
|
|
(setq next-screen-context-lines
|
|
(max 1 (/ (1- (window-height (selected-window))) 2)))
|
|
ad-do-it)
|
|
|
|
(provide 'siren-scroll-half-screen)
|
|
;;; siren-scroll-half-screen.el ends here
|