From 1a9d3ca2d181f919a4a5fb3dcd2a311289bda9d6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 23 Nov 2024 23:47:05 -0500 Subject: [PATCH] Set `make-window-start-visible` to `t` to enhance user experience. When `make-window-start-visible` is set to `t`, Emacs will ensure that the first line of text in a window is fully visible, which enhances the user experience. This commit also adds a new `defcustom`: `outline-indent-make-window-start-visible`. --- outline-indent.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/outline-indent.el b/outline-indent.el index 2016630..a44d961 100644 --- a/outline-indent.el +++ b/outline-indent.el @@ -133,6 +133,15 @@ display table). To apply the change, you need to execute :type '(choice string (const nil)) :group 'outline-indent) +(defcustom outline-indent-make-window-start-visible t + "Non-nil to ensure `window-start' is never invisible. +If you're in doubt, leave this to its default (t). +Setting this to t improves the user experience by ensuring that the first line +of text in a window is fully visible, rather than potentially becoming +invisible. This sets the buffer local variable `make-window-start-visible'." + :type 'boolean + :group 'outline-indent) + (defcustom outline-indent-advise-outline-functions t "If non-nil, advises built-in `outline' functions to improve compatibility. It is highly recommended to keep `outline-indent-advise-outline-functions' @@ -403,6 +412,10 @@ This mode sets up outline to work based on indentation." (not (any " \t\n")))) (outline-indent--update-ellipsis) + ;; Ensures that window-start is never invisible + (setq-local make-window-start-visible + outline-indent-make-window-start-visible) + (when outline-indent-advise-outline-functions ;; Advise the built-in `outline-mode' and `outline-minor-mode' ;; functions to improve compatibility with