branch: externals/topspace commit f15aea85798062df3087bf9de40b1c5211b94510 Author: Trevor Pogue <pogu...@mcmaster.ca> Commit: Trevor Pogue <pogu...@mcmaster.ca>
Remove unused private variables and add .dir-locals.el --- .dir-locals.el | 2 ++ README.md | 30 ++++-------------------------- topspace.el | 5 +++-- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000000..83a5eaa381 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,2 @@ +((emacs-lisp-mode + (indent-tabs-mode nil))) diff --git a/README.md b/README.md index 372dfc0848..05d433fa67 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@  -TopSpace is an emacs minor mode that lets you scroll above the top line to vertically center top text. +TopSpace is an Emacs minor mode that lets you scroll above the top line to vertically center top text. No new keybindings are required as `topspace` automatically works for any commands or subsequent function calls which use `scroll-up`, `scroll-down`, or `recenter` as the underlying primitives for scrolling. This includes all -scrolling commands/functions available in Emacs that the author is aware of. +scrolling commands/functions available in Emacs as far as the author is aware. -Bonus: If you use [`centered-cursor-mode`][3], this means that `topspace` will automatically let you center the cursor all the way to the top line! +Bonus: If you use [`centered-cursor-mode`][1], this means that `topspace` will automatically let you center the cursor all the way to the top line! # Customization @@ -46,27 +46,5 @@ Customize `topspace-center-position` to adjust the centering position. Customize `topspace-autocenter-buffers` to run this command automatically after first opening buffers and after window sizes change. -<!-- # Installation --> -<!-- Save the file from this repository named `"topspace.el"` into a directory of your choice, then install it using [`use-package`][2] by adding the following lines to your [`init file`][1]: --> -<!-- ``` --> -<!-- (use-package topspace :load-path "<directory>") --> -<!-- ``` --> - -<!-- Above, `<directory>` should be the path to the directory in which you saved the `"topspace.el"` file. --> - -<!-- # Usage --> -<!-- After restarting Emacs, you can now activate or deactivate the mode by typing <kbd>M-x topspace-mode</kbd>. --> - -<!-- You can also globally enable the minor mode either manually by typing <kbd>M-x global-topspace-mode</kbd>, or on init by changing the `use-package` code to the following to your init file: --> - -<!-- ``` --> -<!-- (use-package topspace --> -<!-- :load-path "<directory>" --> -<!-- :config (global-topspace-mode)) --> -<!-- ``` --> - - - [1]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html - [2]: https://github.com/jwiegley/use-package - [3]: https://github.com/emacsmirror/centered-cursor-mode + [1]: https://github.com/andre-r/centered-cursor-mode.el diff --git a/topspace.el b/topspace.el index 522a7b01a9..9670ae114e 100644 --- a/topspace.el +++ b/topspace.el @@ -41,12 +41,13 @@ (defvar-local topspace--heights '()) (defvar-local topspace--autocenter-heights '()) (defvar-local topspace--previous-window-heights '()) -(defvar-local topspace--current-line-numbers '()) + (defvar-local topspace--window-start-before-scroll 2) (defvar-local topspace--total-lines-scrolling 0) + (defvar-local topspace--pre-command-point 1) (defvar-local topspace--pre-command-window-start 2) -(defvar-local topspace--total-lines-before-change 0) + (defvar-local topspace--enabled nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;