Skip to content

Commit

Permalink
Set make-window-start-visible to t to enhance user experience.
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
jamescherti committed Nov 24, 2024
1 parent 5659559 commit 5f440ec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions outline-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ 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
in a window is fully visible, rather than potentially becoming invisible. This
sets the buffer local variable `make-window-start-visible'.
You need to set the value of `outline-indent-make-window-start-visible' before
enabling `outline-indent-minor-mode'."
: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'
Expand Down Expand Up @@ -403,6 +416,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
Expand Down

0 comments on commit 5f440ec

Please sign in to comment.