Emacs: Split git commit buffers vertically if buffer is dedicated.

If the current buffer is dedicated to a purpose, splitting horizontally is
impossible. To prevent stacking, we split vertically instead.
This commit is contained in:
tastytea 2020-01-24 23:17:35 +01:00
parent 4d3b29ff6b
commit 6f90c07076

View File

@ -1,6 +1,6 @@
;;; common.el --- Common programming settings. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-01-24T22:13:52+0100>
;; Time-stamp: <2020-01-24T23:17:24+0100>
;;; Commentary:
@ -251,7 +251,21 @@
;; Git integration.
(use-package git-commit
:pin melpa
:after (window-purpose)
:defer nil
:config
(defun my/split-vertically-if-dedicated ()
"Split buffers vertically if focused buffer is dedicated to a purpose."
(when (purpose-window-purpose-dedicated-p)
;; (setq-local split-width-threshold nil)
(setq-local split-height-threshold 40)
))
:hook
(git-commit-setup . my/split-vertically-if-dedicated)
)
(unless slow-computer
;; magit from melpa needs transient from melpa.
(use-package transient