Move window manipulating functions to window-manip.el
This commit is contained in:
parent
6ee76de7db
commit
954881e661
4
init.el
4
init.el
@ -887,15 +887,14 @@
|
|||||||
|
|
||||||
;; Load my own functions
|
;; Load my own functions
|
||||||
(load "gnu-c-header.el")
|
(load "gnu-c-header.el")
|
||||||
(load "toggle-window-split.el")
|
|
||||||
(load "round-number-to-decimals.el")
|
(load "round-number-to-decimals.el")
|
||||||
(load "transpose-windows.el")
|
|
||||||
(load "zim.el")
|
(load "zim.el")
|
||||||
(load "enclose-string.el")
|
(load "enclose-string.el")
|
||||||
(load "buf-manipulation.el")
|
(load "buf-manipulation.el")
|
||||||
(load "text-manip")
|
(load "text-manip")
|
||||||
(load "frame-manip")
|
(load "frame-manip")
|
||||||
(load "file-manip")
|
(load "file-manip")
|
||||||
|
(load "window-manip")
|
||||||
|
|
||||||
;; Define aliases
|
;; Define aliases
|
||||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||||
@ -960,6 +959,7 @@
|
|||||||
("C-r" . rename-current-buffer-file)
|
("C-r" . rename-current-buffer-file)
|
||||||
("C-d" . delete-current-buffer-file)
|
("C-d" . delete-current-buffer-file)
|
||||||
("~" . toggle-char-case)
|
("~" . toggle-char-case)
|
||||||
|
("|" . toggle-window-split)
|
||||||
:map isearch-mode-map
|
:map isearch-mode-map
|
||||||
("<C-return>" . isearch-exit-other-end)
|
("<C-return>" . isearch-exit-other-end)
|
||||||
:map gpolonkai/pers-map
|
:map gpolonkai/pers-map
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
(defun transpose-windows (arg)
|
|
||||||
"Transpose the buffers shown in two windows."
|
|
||||||
(interactive "p")
|
|
||||||
(let ((selector (if (>= arg 0) 'next-window 'previous-window)))
|
|
||||||
(while (/= arg 0)
|
|
||||||
(let ((this-win (window-buffer))
|
|
||||||
(next-win (window-buffer (funcall selector))))
|
|
||||||
(set-window-buffer (selected-window) next-win)
|
|
||||||
(set-window-buffer (funcall selector) this-win)
|
|
||||||
(select-window (funcall selector)))
|
|
||||||
(setq arg (if (plusp arg) (1- arg) (1+ arg))))))
|
|
@ -1,3 +1,15 @@
|
|||||||
|
(defun transpose-windows (arg)
|
||||||
|
"Transpose the buffers shown in two windows."
|
||||||
|
(interactive "p")
|
||||||
|
(let ((selector (if (>= arg 0) 'next-window 'previous-window)))
|
||||||
|
(while (/= arg 0)
|
||||||
|
(let ((this-win (window-buffer))
|
||||||
|
(next-win (window-buffer (funcall selector))))
|
||||||
|
(set-window-buffer (selected-window) next-win)
|
||||||
|
(set-window-buffer (funcall selector) this-win)
|
||||||
|
(select-window (funcall selector)))
|
||||||
|
(setq arg (if (plusp arg) (1- arg) (1+ arg))))))
|
||||||
|
|
||||||
(defun toggle-window-split ()
|
(defun toggle-window-split ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (= (count-windows) 2)
|
(if (= (count-windows) 2)
|
||||||
@ -23,5 +35,3 @@
|
|||||||
(select-window first-win)
|
(select-window first-win)
|
||||||
(if this-win-2nd (other-window 1))))
|
(if this-win-2nd (other-window 1))))
|
||||||
(error "This works only for two windows!")))
|
(error "This works only for two windows!")))
|
||||||
|
|
||||||
(global-set-key (kbd "C-x |") 'toggle-window-split)
|
|
Loading…
Reference in New Issue
Block a user