Last active
September 21, 2020 07:00
-
-
Save salewski/55e7707fb59d78a9ca5ac7615db6b3c9 to your computer and use it in GitHub Desktop.
Provides function 'ads/maximize-window-vertically', plus a suggested key binding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; SPDX-FileCopyrightText: <text> © 1985, 1989, 1992-1994, 2000-2020 Free Software Foundation, Inc. | |
| ;; © 2020 Alan D. Salewski <ads@salewski.email> </text> | |
| ;; | |
| ;; SPDX-License-Identifier: GPL-3.0-or-later | |
| ;; This file IS NOT part of GNU Emacs, but it is derived from the function | |
| ;; `maximize-window', which IS part of GNU Emacs. At the time of writing | |
| ;; (2020-08-27) the `maximize-window' function is defined in the Emacs file | |
| ;; 'window.el': | |
| ;; | |
| ;; https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/window.el | |
| ;; Search for "(defun maximize-window " | |
| ;; Shamelessly borrowed (butchered?) from `maximize-window'; this is just like | |
| ;; it, but constrains its activity to the vertical dimension. | |
| ;; | |
| (defun ads/maximize-window-vertically (&optional window) | |
| "Maximize WINDOW, only in the vertical dimension. | |
| Make WINDOW as tall as possible without deleting any windows. | |
| WINDOW must be a valid window and defaults to the selected one. | |
| If the option `window-resize-pixelwise' is non-nil maximize | |
| WINDOW pixelwise." | |
| (interactive) | |
| (setq window (window-normalize-window window)) | |
| (window-resize window | |
| (window-max-delta window nil nil nil nil nil window-resize-pixelwise) | |
| nil ;; HORIZONTAL? | |
| nil window-resize-pixelwise)) | |
| (global-set-key [?\C-c ?^] 'ads/maximize-window-vertically) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment