emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 6a2ee981c3: Add new functions for splitting the root window


From: Emanuel Berg
Subject: Re: master 6a2ee981c3: Add new functions for splitting the root window
Date: Tue, 20 Sep 2022 01:55:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/window-incal.el

(setq display-buffer-base-action '((display-buffer-reuse-window
                                    display-buffer-same-window) ))

(defun beginning-of-line-at-top ()
  (beginning-of-line)
  (recenter 0) )

;; the two-window solution

(defun other-window-or-split ()
  (interactive)
  (when (one-window-p)
    (split-window-below) )
  (other-window 1) )

(defun swap-windows ()
  (interactive)
  (let ((buffer (current-buffer)))
    (other-window 1)
    (switch-to-buffer-other-window (current-buffer))
    (other-window 1)
    (switch-to-buffer buffer) ))

;; window size shorthands

(defun window-increase-size (&optional lines)
  (interactive "p")
  (unless (one-window-p)
    (or lines (setq lines 1))
    (window-resize nil lines) ))

(defun window-decrease-size (&optional lines)
  (interactive "p")
  (unless (one-window-p)
    (or lines (setq lines 1))
    (window-resize nil (* -1 lines) )))

(provide 'window-incal)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]