summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-08-25 23:05:22 -0500
committerCase Duckworth2021-08-25 23:05:22 -0500
commit7792f81ffafb70f6b60a269873957571454718b8 (patch)
treef68f6e5056d6fe8ee4348fbfd1ef92b6549f446c
parentRearrange dired stuff (diff)
downloademacs-7792f81ffafb70f6b60a269873957571454718b8.tar.gz
emacs-7792f81ffafb70f6b60a269873957571454718b8.zip
Change other stuff for scroll-margin changes
-rw-r--r--init.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/init.el b/init.el index 3d739ef..162c86c 100644 --- a/init.el +++ b/init.el
@@ -344,6 +344,10 @@
344 (apply f r)))) 344 (apply f r))))
345 345
346 (add-hook 'kill-emacs-hook #'erc/disconnect) 346 (add-hook 'kill-emacs-hook #'erc/disconnect)
347
348 (add-hook 'erc-mode-hook
349 (defun erc-mode@setup ()
350 (setq-local scroll-margin 0)))
347 351
348 (:hook erc-autoaway-mode 352 (:hook erc-autoaway-mode
349 erc-track-mode 353 erc-track-mode
@@ -655,7 +659,11 @@ like a dumbass."
655 (defun recenter-to-top (&rest _) 659 (defun recenter-to-top (&rest _)
656 "Recenter the cursor to the top of the window." 660 "Recenter the cursor to the top of the window."
657 (when (called-interactively-p 'any) 661 (when (called-interactively-p 'any)
658 (recenter 5))) 662 (recenter (if (or (null scroll-margin)
663 (zerop scroll-margin))
664 3
665 scroll-margin))))
666
659 (:advise forward-page :after #'recenter-to-top 667 (:advise forward-page :after #'recenter-to-top
660 backward-page :after #'recenter-to-top) 668 backward-page :after #'recenter-to-top)
661 669