add functions for docking current buffer in side windows (top, bottom, left or right)
This commit is contained in:
parent
7c06b7dead
commit
ebf4730101
|
@ -43,7 +43,7 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; open text-mode scratch in right side window
|
||||
(defun kmn/scratch-text-on-right (&optional dir_path)
|
||||
(defun kmn/scratch-text-on-right ()
|
||||
(defvar parameters
|
||||
'(window-parameters . ((no-other-window . t)
|
||||
(no-delete-other-windows . t))))
|
||||
|
@ -64,7 +64,7 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; open text-mode scratch in right side window
|
||||
(defun kmn/scratch-prompt-on-right (&optional dir_path)
|
||||
(defun kmn/scratch-prompt-on-right ()
|
||||
(defvar parameters
|
||||
'(window-parameters . ((no-other-window . t)
|
||||
(no-delete-other-windows . t))))
|
||||
|
@ -143,3 +143,51 @@ position between last non-whitespace and `end-of-line'."
|
|||
(call-interactively 'query-replace)))
|
||||
(message "Back to old point.")
|
||||
(goto-char orig-point))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; dock current buffer in given side panel
|
||||
(defun kmn/dock-current-buffer-on-side (selected_side)
|
||||
(defvar parameters
|
||||
'(window-parameters . ((no-delete-other-windows . t))))
|
||||
|
||||
(setq fit-window-to-buffer-horizontally t)
|
||||
(setq window-resize-pixelwise t)
|
||||
|
||||
"Display `default-directory' in side window on left, hiding details."
|
||||
(interactive)
|
||||
(let ((buffer (current-buffer)))
|
||||
(display-buffer-in-side-window
|
||||
buffer `((side . ,selected_side) (slot . -1)
|
||||
(window-width . fit-window-to-buffer)
|
||||
, parameters)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; dock current buffer on right
|
||||
(defun kmn/dock-current-buffer-on-right ()
|
||||
(interactive)
|
||||
(kmn/dock-current-buffer-on-side 'right)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; dock current buffer on right
|
||||
(defun kmn/dock-current-buffer-on-left ()
|
||||
(interactive)
|
||||
(kmn/dock-current-buffer-on-side 'left)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; dock current buffer on right
|
||||
(defun kmn/dock-current-buffer-on-top ()
|
||||
(interactive)
|
||||
(kmn/dock-current-buffer-on-side 'top)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; dock current buffer on right
|
||||
(defun kmn/dock-current-buffer-on-bottom ()
|
||||
(interactive)
|
||||
(kmn/dock-current-buffer-on-side 'bottom)
|
||||
)
|
||||
|
|
Reference in a new issue