diff options
Diffstat (limited to 'lib/eos/jao-buffers.el')
| -rw-r--r-- | lib/eos/jao-buffers.el | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/eos/jao-buffers.el b/lib/eos/jao-buffers.el index c3f4063..3339d33 100644 --- a/lib/eos/jao-buffers.el +++ b/lib/eos/jao-buffers.el @@ -18,11 +18,11 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see <https://www.gnu.org/licenses/>. -;;; Code: +;;; deps (require 'eldoc) -;;;; lines +;;; lines ;;;###autoload (defun jao-goto-visible-line (n) @@ -30,7 +30,20 @@ (goto-char (point-min)) (forward-visible-line n)) -;;;; attached buffers +;;; windows +;;;###autoload +(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 (> arg 0) (1- arg) (1+ arg)))))) +;;; attached buffers (defun jao-display-buffer-below-selected (buffer alist) (delete-other-windows-vertically) (display-buffer-below-selected buffer alist)) @@ -57,7 +70,7 @@ (add-to-list 'display-buffer-alist (jao-attached-buffer-entry name-rx height))) -;;;; eldoc +;;; eldoc ;;;###autoload (defun jao-eldoc-toggle () "Toggle eldoc's documentation buffer." @@ -89,7 +102,7 @@ (display-buffer-reuse-window jao-display-below-eldoc) (height . (or ,h 0.5))))) -;;;; same mode +;;; same mode ;;;###autoload (defun jao-buffer-same-mode (&optional mode pre-fn switch-fn) (interactive) |
